Class: OpenAI::Resources::Chat::Completions::Messages
- Inherits:
-
Object
- Object
- OpenAI::Resources::Chat::Completions::Messages
- Defined in:
- lib/openai/resources/chat/completions/messages.rb,
sig/openai/resources/chat/completions/messages.rbs
Overview
Given a list of messages comprising a conversation, the model will return a response.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Messages
constructor
private
A new instance of Messages.
-
#list(completion_id, after: nil, limit: nil, order: nil, request_options: {}) ⇒ OpenAI::Internal::CursorPage<OpenAI::Models::Chat::ChatCompletionStoreMessage>
Get the messages in a stored chat completion.
Constructor Details
#initialize(client:) ⇒ Messages
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Messages.
50 51 52 |
# File 'lib/openai/resources/chat/completions/messages.rb', line 50 def initialize(client:) @client = client end |
Instance Method Details
#list(completion_id, after: nil, limit: nil, order: nil, request_options: {}) ⇒ OpenAI::Internal::CursorPage<OpenAI::Models::Chat::ChatCompletionStoreMessage>
Get the messages in a stored chat completion. Only Chat Completions that have
been created with the store parameter set to true will be returned.
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/openai/resources/chat/completions/messages.rb', line 33 def list(completion_id, params = {}) parsed, = OpenAI::Chat::Completions::MessageListParams.dump_request(params) query = OpenAI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["chat/completions/%1$s/messages", completion_id], query: query, page: OpenAI::Internal::CursorPage, model: OpenAI::Chat::ChatCompletionStoreMessage, security: {bearer_auth: true}, options: ) end |