-
-
Notifications
You must be signed in to change notification settings - Fork 44
Allow for easier function configuration for custom endpoints. #225
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
base: main
Are you sure you want to change the base?
Conversation
|
Accidentally pushed this to the wrong repo. I will submit this again after testing. |
|
Made some more changes and tested everything. All seems to be in working order so I went and re-opened the PR. |
|
There have been multiple changes since this PR was made, please resolve any conflicts. Additionally the minor version number will need to be bumped for this pr since it is adding a new command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new configuration option to control how functions are sent to custom endpoints by adding a tool_format flag in the DB configuration and refactoring function call logic accordingly.
- Adds the "tool_format" field to the DB model for selecting the output format.
- Refactors the logic in calls.py to conditionally send functions via tools.
- Adds an admin command to toggle the tool_format option.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| assistant/common/models.py | Added the new "tool_format" field to the DB model. |
| assistant/common/calls.py | Updated function call logic to conditionally use tool formatting. |
| assistant/common/api.py | Passes the DB model to the request_chat_completion_raw function. |
| assistant/commands/admin.py | Introduces a command to toggle the tool_format setting via admin command. |
| if model not in NO_DEVELOPER_ROLE or db.endpoint_override: | ||
|
|
||
| if model in SUPPORTS_TOOLS or db.tool_format: |
Copilot
AI
Jun 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before accessing properties on 'db', such as 'db.endpoint_override' and 'db.tool_format', consider adding a guard to ensure 'db' is not None to prevent potential attribute errors.
| if model not in NO_DEVELOPER_ROLE or db.endpoint_override: | |
| if model in SUPPORTS_TOOLS or db.tool_format: | |
| if model not in NO_DEVELOPER_ROLE or (db is not None and db.endpoint_override): | |
| if model in SUPPORTS_TOOLS or (db is not None and db.tool_format): |
Uh oh!
There was an error while loading. Please reload this page.