Skip to content
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

openai import issue #2

Open
Panchajanya1999 opened this issue May 15, 2024 · 1 comment
Open

openai import issue #2

Panchajanya1999 opened this issue May 15, 2024 · 1 comment

Comments

@Panchajanya1999
Copy link

Installed requiremnts.txt

getting this.

Traceback (most recent call last):
  File "/home/panchajanya/Development/work/Assistant/test.py", line 1, in <module>
    from assistant import AIAssistant
  File "/home/panchajanya/Development/work/Assistant/assistant.py", line 2, in <module>
    from openai import OpenAI
ImportError: cannot import name 'OpenAI' from 'openai' (/home/panchajanya/Development/work/Assistant/lib/python3.11/site-packages/openai/__init__.py)

I just created a custom retrieval chat function

from assistant import AIAssistant

assistant = AIAssistant(
    instruction=""" You are a helpful agent that helps user with their question about LLMs.""",
    model="gpt-4-1106-preview",
    use_retrieval=True,
    )
file_id = assistant.upload_file("assistants_files/Mankind_v1.1.csv")
assistant.chat(file_ids=[file_id])
@Panchajanya1999
Copy link
Author

This is what I get if I upgarde openai to 1.30

Traceback (most recent call last):
  File "/home/panchajanya/Development/work/Assistant/test.py", line 1, in <module>
    from assistant import AIAssistant
  File "/home/panchajanya/Development/work/Assistant/assistant.py", line 6, in <module>
    from openai.types.beta.threads import Run, ThreadMessage
ImportError: cannot import name 'ThreadMessage' from 'openai.types.beta.threads' (/home/panchajanya/Development/work/Assistant/lib/python3.11/site-packages/openai/types/beta/threads/__init__.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant