-
Notifications
You must be signed in to change notification settings - Fork 315
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
Message object does not have tool_call_id which is required when we add tool call message to history #325
Comments
@gurvinder-dhillon Are you using the collect and call tools method like this example https://github.com/MadcowD/ell/blob/main/examples/future/use_tool_once.py or something else? |
gurvinder-dhillon
added a commit
to gurvinder-dhillon/ell
that referenced
this issue
Nov 1, 2024
Fixes MadcowD#325 Add `tool_call_id` attribute to `Message` class and update methods to handle it. * Add `tool_call_id` attribute to `Message` class in `src/ell/types/message.py`. * Update `__init__` method in `Message` class to accept `tool_call_id` parameter. * Update `model_validate` method in `Message` class to handle `tool_call_id`. * Update `translate_to_provider` method in `src/ell/providers/openai.py` to add `tool_call_id` to `Message` object. * Update `translate_from_provider` method in `src/ell/providers/openai.py` to process `tool_call_id` in `Message` object. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/MadcowD/ell/issues/325?shareId=XXXX-XXXX-XXXX-XXXX).
Isn't tool call id already on the ToolCall object and ToolResult object. @alex-dixon's suggestion is the correct one., |
Yeah it's in that content blopck object. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Basically, if we add tool call to message history, it expects a follow up message that is tool result and it should have the tool_call_id.
Here is the reference - https://platform.openai.com/docs/guides/function-calling
and https://community.openai.com/t/formatting-assistant-messages-after-tool-function-calls-in-gpt-conversations/535360/2
BadRequestError: Error code: 400 - {'error': {'message': "Missing parameter 'tool_call_id': messages with role 'tool' must have a 'tool_call_id'.", 'type': 'invalid_request_error', 'param': 'messages.[3].tool_call_id', 'code': None}
The text was updated successfully, but these errors were encountered: