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

'AzureOpenAI' object is not callable #235

Closed
lingxiankong opened this issue May 9, 2024 · 5 comments
Closed

'AzureOpenAI' object is not callable #235

lingxiankong opened this issue May 9, 2024 · 5 comments

Comments

@lingxiankong
Copy link

Example code:

from phi.assistant import Assistant
from phi.llm.azure import AzureOpenAIChat

assistant = Assistant(
    llm=AzureOpenAIChat(model="gpt-35-turbo"),
    description="You help people with their health and fitness goals.",
)
assistant.print_response("Share a quick healthy breakfast recipe.", markdown=True)

Exception:

Traceback (most recent call last):
  File "/Users/kongli/code/testtest.py", line 11, in <module>
    assistant.print_response("Share a quick healthy breakfast recipe.", markdown=True)
  File "/Users/kongli/code/test.venv/lib/python3.11/site-packages/phi/assistant/assistant.py", line 1402, in print_response
    for resp in self.run(message=message, messages=messages, stream=True, **kwargs):
  File "/Users/kongli/code/test.venv/lib/python3.11/site-packages/phi/assistant/assistant.py", line 841, in _run
    for response_chunk in self.llm.response_stream(messages=llm_messages):
  File "/Users/kongli/code/test.venv/lib/python3.11/site-packages/phi/llm/openai/chat.py", line 615, in response_stream
    for response in self.invoke_stream(messages=messages):
  File "/Users/kongli/code/test.venv/lib/python3.11/site-packages/phi/llm/openai/chat.py", line 218, in invoke_stream
    yield from self.get_client().chat.completions.create(
               ^^^^^^^^^^^^^^^^^
TypeError: 'AzureOpenAI' object is not callable

Lib versions:

  • phidata 2.4.2
  • openai 1.27.0
@ashpreetbedi
Copy link
Contributor

thanks @lingxiankong , checking

@lingxiankong
Copy link
Author

@ashpreetbedi any update please?

@ashpreetbedi
Copy link
Contributor

@ysolanky is testing this today

@ysolanky
Copy link
Contributor

Hey @lingxiankong, we have identified the issue and it will be patched it the next release. Thank you for debugging this for us :)

@ashpreetbedi
Copy link
Contributor

@lingxiankong this is now fixed in the v2.4.8 release. Thank you so much for the bug, we appreciate your patience and support so much :)

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

3 participants