diff --git a/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/openai_assistant_agent.py b/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/openai_assistant_agent.py index afc462e9e0939..4f03d796a2ecf 100644 --- a/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/openai_assistant_agent.py +++ b/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/openai_assistant_agent.py @@ -28,13 +28,13 @@ def from_openai_thread_message(thread_message: Any) -> ChatMessage: """From OpenAI thread message.""" - from openai.types.beta.threads import MessageContentText, ThreadMessage + from openai.types.beta.threads import TextContentBlock, Message - thread_message = cast(ThreadMessage, thread_message) + thread_message = cast(Message, thread_message) # we don't have a way of showing images, just do text for now text_contents = [ - t for t in thread_message.content if isinstance(t, MessageContentText) + t for t in thread_message.content if isinstance(t, TextContentBlock) ] text_content_str = " ".join([t.text.value for t in text_contents]) diff --git a/llama-index-integrations/agent/llama-index-agent-openai/pyproject.toml b/llama-index-integrations/agent/llama-index-agent-openai/pyproject.toml index a5d9502c85acc..78c7e0767496e 100644 --- a/llama-index-integrations/agent/llama-index-agent-openai/pyproject.toml +++ b/llama-index-integrations/agent/llama-index-agent-openai/pyproject.toml @@ -28,12 +28,13 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-agent-openai" readme = "README.md" -version = "0.2.0" +version = "0.2.1" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" llama-index-core = "^0.10.1" llama-index-llms-openai = "^0.1.5" +openai = ">=1.14.0" [tool.poetry.group.dev.dependencies] ipython = "8.10.0"