Class: OxAiWorkers::Request
Instance Attribute Summary
#client, #custom_id, #errors, #max_tokens, #messages, #model, #result, #temperature, #tool_calls, #tool_calls_raw, #tools
Instance Method Summary
collapse
#append, #cleanup, #initialize_requests, #not_found_is_ok, #params, #parse_choices
Instance Method Details
#completed? ⇒ Boolean
21
22
23
|
# File 'lib/oxaiworkers/request.rb', line 21
def completed?
@result.present? or @errors.present? or @tool_calls.present?
end
|
#finish ⇒ Object
7
8
9
10
|
# File 'lib/oxaiworkers/request.rb', line 7
def finish
@custom_id = SecureRandom.uuid
cleanup
end
|
#request! ⇒ Object
12
13
14
15
|
# File 'lib/oxaiworkers/request.rb', line 12
def request!
response = @client.chat(parameters: params)
parse_choices(response)
end
|
#requested? ⇒ Boolean
17
18
19
|
# File 'lib/oxaiworkers/request.rb', line 17
def requested?
false
end
|