#OpenAI Provider Import Error on Python

1 messages · Page 1 of 1 (latest)

austere lagoon
#

This error happens on OpenAI 1.99.7
and composio 1.0.0rc10
composio-langchain 1.0.0rc10

Can you gives me the latest OpenAI package version that works in python?

Traceback (most recent call last):
File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 68, in serve
config.load()
File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 467, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/code/app/main.py", line 18, in <module>
from app.routes.integrations_v1 import integrations_v1_router
File "/code/app/routes/integrations_v1.py", line 28, in <module>
from app.utils.composio_handlers import (
File "/code/app/utils/composio_handlers.py", line 2, in <module>
from composio import Composio
File "/usr/local/lib/python3.11/site-packages/composio/init.py", line 7, in <module>
from .sdk import Composio
File "/usr/local/lib/python3.11/site-packages/composio/sdk.py", line 19, in <module>
from composio.core.provider._openai import OpenAIProvider
File "/usr/local/lib/python3.11/site-packages/composio/core/provider/_openai.py", line 15, in <module>
from openai.types.chat.chat_completion_message_tool_call import (
ImportError: cannot import name 'ChatCompletionMessageToolCall' from 'openai.types.chat.chat_completion_message_tool_call' (/usr/local/lib/python3.11/site-packages/openai/types/chat/chat_completion_message_tool_call.py)

#

I went down to 1.95.1 and it worked

sinful lindenBOT
#

Hey, here's the Pypi link to the package: https://pypi.org/project/composio/
Can you try on the latest? If issue persist, please share the reproducible code snippet along with requirements.txt // pyproject.toml

austere lagoon
#

I see, I was using 1.0.0 because of the new sdk but let me try that one