Skip to content

Commit e7a54a8

Browse files
authored
document auto tool calling in README (#31)
* Update README.md to reflect changes in tool calling syntax - Modified the description of tool usage to replace `auto_tool_call=True` with `call_tools=True` for clarity. - Updated example code to demonstrate the new syntax for invoking tools in the LLM class. * update * update * rename * fix ci
1 parent 54ccb1b commit e7a54a8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ print("Sentiment:", sentiment)
133133
```
134134

135135
### Tools ([docs](https://lightning.ai/docs/litai/features/tools))
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_tool_call=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_tool_calls=True`), or you can manually call a tool with `llm.call_tool(...)` for full control. Zero magic, just plain Python.
137137

138138
```python
139139
from litai import LLM, tool
@@ -144,13 +144,15 @@ def get_weather(location: str):
144144

145145
llm = LLM(model="openai/gpt-4")
146146

147-
chosen_tool = llm.chat("What's the weather in Tokyo?", tools=[get_weather])
147+
result = llm.chat("What's the weather in Tokyo?", tools=[get_weather], auto_tool_calls=True)
148+
# The weather in Tokyo is sunny
148149

150+
chosen_tool = llm.chat("What's the weather in Tokyo?", tools=[get_weather])
149151
result = llm.call_tool(chosen_tool, tools=[get_weather])
150152
# The weather in London is sunny
151153
```
152154

153-
Choose automatic or manual tool calling based on production needs. `auto_tool_call=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_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.
154156

155157
<br/>
156158

src/litai/llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def chat( # noqa: D417
324324
conversation_history (Dict[str, List[Dict[str, Any]]]): A dictionary to store conversation history,
325325
categorized by conversation ID.
326326
full_response (bool): Whether the entire response should be returned from the chat.
327-
auto_call_tools (bool): Tools will be executed automatically whenever applicable. Defaults to False.
327+
auto_call_tools (bool): Tools will be executed automatically whenever applicable. Defaults to False.
328328
**kwargs (Any): Additional keyword arguments
329329
330330
Returns:

0 commit comments

Comments
 (0)