Closed adieyal closed 3 months ago
Hey @adieyal, great to see you diving into the depths of LlamaIndex again! 👾
Thank you for bringing this to our attention. It seems like there has been a change in the OpenAI library that is causing incompatibility with the current LlamaIndex codebase.
The change you've suggested, moving from dictionary access to attribute access, is indeed the correct way to handle instances of the ChatCompletionMessageToolCall
class in the latest OpenAI library.
However, as you've pointed out, this change would mean that the LlamaIndex codebase is directly dependent on the OpenAI library's types, which might not be the intended design. The LlamaIndex framework is designed to be a general-purpose tool that can work with different libraries, so it's possible that the use of dictionaries was an attempt to keep the codebase library-agnostic.
In the meantime, you can use the version of the OpenAI library that is compatible with the current LlamaIndex codebase. According to the context provided, the compatible version of the OpenAI library is not explicitly mentioned, but it seems to be compatible with the version "^0.1.1" as per the llama-index-integrations/llms/llama-index-llms-azure-openai/pyproject.toml file.
We will take your feedback into account and consider updating the LlamaIndex codebase to be compatible with the latest version of the OpenAI library, or at least provide clear documentation on which version of the OpenAI library the codebase is compatible with.
For future reference, it would be helpful to know the exact version of the OpenAI library you're using when you encounter these issues. This will help us ensure compatibility with the most commonly used versions.
Thank you for your contribution to improving the LlamaIndex project. Your feedback is greatly appreciated. If you have any more questions or issues, feel free to ask.
To be clear, this is just the portion of the example showing creating your own agent, not our actual agent code in the framework
yep - but it's worth updating the documentation in case someone following along encounters the error and doesn't know how to proceed.
Documentation Issue Description
The openai_agent example and accompanying notebook are not compatible with the latest openai library https://github.com/run-llama/llama_index/blob/main/docs/examples/agent/openai_agent.ipynb https://docs.llamaindex.ai/en/stable/examples/agent/openai_agent.html
should be replaced with
strictly speaking
tool_call
is of typeopenai.types.chat.chat_completion_message_tool_call.ChatCompletionMessageToolCall
and no longerdict
- I am not sure whether there is an intention to abstract away the OpenAI typesDocumentation Link
https://docs.llamaindex.ai/en/stable/examples/agent/openai_agent.html