patterns-ai-core / langchainrb

Build LLM-powered applications in Ruby
https://rubydoc.info/gems/langchainrb
MIT License
1.45k stars 195 forks source link

Introduce `assistant.execute_tools = true/false` option to replace the `auto_tool_execution` parameter. #829

Open andreibondarev opened 1 month ago

andreibondarev commented 1 month ago

Description

In order to make the Assistant's DSL more intuitive we should rename the auto_tool_execution: parameter to execute_tools:. This is also in line with the openai/swarm agent framework.

We should be able to set this option at the Assistant-level and not have to specify it every time. You should still be able to override this setting when you're explicitly calling the method with .run(execute_tools: false).

assistant = Langchain::Assistant.new(
  llm: llm,
  execute_tools: true
)

assistant.add_message(content: "...")

assistant.run(execute_tools: false)

Tasks