You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tools allow models to get real-world data or take actions. In LitAI, there is no magic with tool use, agents can decide to call tools (`auto_tool_calls=True`), or you can manually call a tool with `llm.call_tool(...)` for full control. Zero magic, just plain Python.
136
+
Tools allow models to get real-world data or take actions. In LitAI, there is no magic with tool use, agents can decide to call tools (`auto_call_tools=True`), or you can manually call a tool with `llm.call_tool(...)` for full control. Zero magic, just plain Python.
result = llm.chat("What's the weather in Tokyo?", tools=[get_weather], auto_tool_calls=True)
147
+
result = llm.chat("What's the weather in Tokyo?", tools=[get_weather], auto_call_tools=True)
148
148
# The weather in Tokyo is sunny
149
149
150
150
chosen_tool = llm.chat("What's the weather in Tokyo?", tools=[get_weather])
151
151
result = llm.call_tool(chosen_tool, tools=[get_weather])
152
152
# The weather in London is sunny
153
153
```
154
154
155
-
Choose automatic or manual tool calling based on production needs. `auto_tool_calls=True` is great for quick demos, but can obscure when and why a tool runs which can lead to surprises in production. `llm.call_tool(...)` gives you full control to decide when tools execute, making it easier to log, debug, test, and audit. This clarity is critical for reliability, safety, and trust in real-world systems.
155
+
Choose automatic or manual tool calling based on production needs. `auto_call_tools=True` is great for quick demos, but can obscure when and why a tool runs which can lead to surprises in production. `llm.call_tool(...)` gives you full control to decide when tools execute, making it easier to log, debug, test, and audit. This clarity is critical for reliability, safety, and trust in real-world systems.
0 commit comments