Closed MarkHmnv closed 2 weeks ago
The error you're encountering, TypeError: 'MockValSer' object cannot be converted to 'SchemaSerializer'
, seems to be related to the serialization process in the AzureChatStore
when using the finalize_task
function with return_direct=True
in QueryEngineTool
. This issue might be due to a bug in the llama-index-storage-chat-store-azure
version 0.2.0, which affects how messages are serialized and stored.
The return_direct=True
parameter in QueryEngineTool
ensures that the response from the tool is returned directly, without being interpreted and rewritten by the agent. This can affect the execution flow and how messages are handled in the finalize_task
function [1].
To address this issue, you might want to check if there are any updates or patches available for the llama-index-storage-chat-store-azure
package that address this serialization problem. Additionally, reviewing the implementation of the MockValSer
and SchemaSerializer
objects in your code or dependencies might provide insights into resolving the type conversion issue.
To continue talking to Dosu, mention @dosu.
The issue is coming from calling message.dict()
on a message in the chat history (likely a response from the LLM). This is unrelated to the chat store being used tbh
Seems like an issue with the serialization logic in general with pydantic v2
Its a long-standing issue it seems 🤔 I guess the switch to full pydantic v2 support brought his on
https://github.com/pydantic/pydantic/issues/7713 https://github.com/openai/openai-python/issues/1306
Bug Description
This error occurs in the
finalize_task
function of theOpenAIAgentWorker
class, which is used inside OpenAIAgent. It occurs when it tries to save messages to the Azure Chat Store. While saving the metadata that shows the tools used during the agent's work, the errorTypeError: 'MockValSer' object cannot be converted to 'SchemaSerializer'
occurs. By and large, the error is due to a bug inside AzureChatStore. Version ofllama-index-storage-chat-store-azure
- 0.2.0Version
0.11.16
Steps to Reproduce
Relevant Logs/Tracbacks