Class: OmniAI::OpenAI::Thread::Runs
- Inherits:
-
Object
- Object
- OmniAI::OpenAI::Thread::Runs
- Defined in:
- lib/omniai/openai/thread/runs.rb
Overview
An OpenAI scope for establishing messages.
Instance Method Summary collapse
- #all(limit: nil) ⇒ Array<OmniAI::Thread::Message>
- #build(assistant_id:, model: nil, temperature: nil, instructions: nil, tools: nil, metadata: {}) ⇒ OmniAI::OpenAI::Thread::Message
- #cancel!(id:) ⇒ Hash
- #find(id:) ⇒ OmniAI::OpenAI::Thread::Message
-
#initialize(client:, thread:) ⇒ Runs
constructor
A new instance of Runs.
Constructor Details
#initialize(client:, thread:) ⇒ Runs
Returns a new instance of Runs.
10 11 12 13 |
# File 'lib/omniai/openai/thread/runs.rb', line 10 def initialize(client:, thread:) @client = client @thread = thread end |
Instance Method Details
#all(limit: nil) ⇒ Array<OmniAI::Thread::Message>
17 18 19 |
# File 'lib/omniai/openai/thread/runs.rb', line 17 def all(limit: nil) Run.all(thread_id: @thread.id, limit:, client: @client) end |
#build(assistant_id:, model: nil, temperature: nil, instructions: nil, tools: nil, metadata: {}) ⇒ OmniAI::OpenAI::Thread::Message
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/omniai/openai/thread/runs.rb', line 40 def build(assistant_id:, model: nil, temperature: nil, instructions: nil, tools: nil, metadata: {}) Run.new( assistant_id:, thread_id: @thread.id, model:, temperature:, instructions:, tools:, metadata:, client: @client ) end |
#cancel!(id:) ⇒ Hash
29 30 31 |
# File 'lib/omniai/openai/thread/runs.rb', line 29 def cancel!(id:) Run.cancel!(id:, thread_id: @thread.id, client: @client) end |
#find(id:) ⇒ OmniAI::OpenAI::Thread::Message
23 24 25 |
# File 'lib/omniai/openai/thread/runs.rb', line 23 def find(id:) Run.find(id:, thread_id: @thread.id, client: @client) end |