mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-29 18:22:53 +00:00
fix: Update max_turns config (#12604)
Pass max_turns in the run config than during the initialization. --------- Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
@@ -15,7 +15,6 @@ Rails.application.config.after_initialize do
|
||||
config.openai_api_base = api_base
|
||||
end
|
||||
config.default_model = model
|
||||
config.max_turns = 30
|
||||
config.debug = false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -23,7 +23,7 @@ class Captain::Assistant::AgentRunnerService
|
||||
message_to_process = extract_last_user_message(message_history)
|
||||
runner = Agents::Runner.with_agents(*agents)
|
||||
runner = add_callbacks_to_runner(runner) if @callbacks.any?
|
||||
result = runner.run(message_to_process, context: context)
|
||||
result = runner.run(message_to_process, context: context, max_turns: 100)
|
||||
|
||||
process_agent_result(result)
|
||||
rescue StandardError => e
|
||||
|
||||
@@ -90,7 +90,8 @@ RSpec.describe Captain::Assistant::AgentRunnerService do
|
||||
|
||||
expect(mock_runner).to receive(:run).with(
|
||||
'I need help with my account',
|
||||
context: expected_context
|
||||
context: expected_context,
|
||||
max_turns: 100
|
||||
)
|
||||
|
||||
service.generate_response(message_history: message_history)
|
||||
|
||||
Reference in New Issue
Block a user