Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update function call doc with example of not using decorator syntax. #1441

Merged
merged 2 commits into from
Jan 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions website/docs/Use-Cases/agent_chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,19 @@ You can check the JSON schema generated by the decorator `chatbot.llm_config["to
'description': 'Quote currency'}},
'required': ['base_amount']}}}]
```

Python decorators are functions themselves. If you do not want to use the
`@chatbot.register...` decorator syntax,
you can call the decorators as functions:

```python
# Register the function with the chatbot's llm_config.
chatbot.register_for_llm(description="Currency exchange calculator.")(currency_calculator)

# Register the function with the user_proxy's function_map.
user_proxy.register_for_execution()(currency_calculator)
```

4. Agents can now use the function as follows:
```python
user_proxy.initiate_chat(
Expand Down
Loading