julep
julep copied to clipboard
feat: Add system tool calls to the chat endpoint
User description
Closes #1285
EntelligenceAI PR Summary
The recent update introduces a new utility function, eval_tool_calls, in tools.py to enhance the evaluation of tool calls within chat sessions. The chat function in chat.py has been updated to utilize this utility, replacing direct calls to litellm.acompletion. This change aims to improve code modularity and streamline the integration of tool responses in chat sessions.
PR Type
Enhancement, Tests
Description
-
Introduced
tool_calls_evaluatorto streamline tool call handling in chat sessions. -
Added a new utility function
call_toolfor executing system tool calls. -
Implemented extensive unit tests for
tool_calls_evaluatorandcall_tool. -
Enhanced modularity and maintainability of the chat endpoint.
Changes walkthrough 📝
| Relevant files | |||||
|---|---|---|---|---|---|
| Enhancement |
| ||||
| Tests |
|
Need help?
Type /help how to ...in the comments thread for any questions about Qodo Merge usage.Check out the documentation for more information.
[!IMPORTANT] Refactor chat endpoint to use
tool_calls_evaluatorfor tool call handling, enhancing modularity and adding extensive tests.
- Behavior:
- Refactor
chat()inchat.pyto usetool_calls_evaluatorfor handling tool calls, replacing directlitellm.acompletioncalls.- Introduce
call_toolintools.pyfor executing system tool calls.- Utilities:
- Add
tool_calls_evaluatordecorator intools.pyfor tool call evaluation.- Define
_system_tool_handlersmapping intools.pyfor tool-specific logic.- Tests:
- Add
test_tool_calls_evaluator.pywith unit tests fortool_calls_evaluatorandcall_tool.- Cover various tool operations and edge cases like unknown tools.
- Misc:
- Add utility functions for search request creation in
tools.py.This description was created by
for ebd3769ebebdd0d2aa05af0eba020399b93c0e25. It will automatically update as commits are pushed.