Class: OxAiWorkers::Request
Instance Attribute Summary
#call_stack, #client, #custom_id, #errors, #is_truncated, #last_call, #messages, #model, #result, #stop_double_calls, #tool_calls, #tools
Instance Method Summary
collapse
#append, #cleanup, #initialize_requests, #not_found_is_ok, #params, #parse_choices
Instance Method Details
#completed? ⇒ Boolean
31
32
33
34
35
36
37
|
# File 'lib/oxaiworkers/request.rb', line 31
def completed?
return false if @is_truncated
@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
|
#finish_without_cleanup ⇒ Object
Method to finish without clearing messages
13
14
15
16
17
18
19
20
|
# File 'lib/oxaiworkers/request.rb', line 13
def finish_without_cleanup
@custom_id = SecureRandom.uuid
@result = nil
@errors = nil
@tool_calls = nil
@is_truncated = false
end
|
#request! ⇒ Object
22
23
24
25
|
# File 'lib/oxaiworkers/request.rb', line 22
def request!
response = @model.request(params)
parse_choices(response)
end
|
#requested? ⇒ Boolean
27
28
29
|
# File 'lib/oxaiworkers/request.rb', line 27
def requested?
false
end
|