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

Fix OpenAI deprecation warning #14

Open
digitalronin opened this issue Jul 26, 2023 · 1 comment
Open

Fix OpenAI deprecation warning #14

digitalronin opened this issue Jul 26, 2023 · 1 comment

Comments

@digitalronin
Copy link

Whenever I run promptimize, using the gpt-3.5-turbo model, I get the following deprecation warning:

~/.pyenv/versions/myenv/lib/python3.10/site-packages/langchain/llms/openai.py:172: UserWarning: You are trying to use a chat model. This way of initializing it is no longer supported. Instead, please use: `from langchain.chat_models import ChatOpenAI`

I think this relates to this langchain discussion thread, but when I try to implement the suggested fix, I get a different error:

~/.pyenv/versions/myenv/lib/python3.10/site-packages/langchain/callbacks/manager.py", line 297, in _handle_event
    getattr(handler, event_name)(*args, **kwargs)
  File "~/.pyenv/versions/myenv/lib/python3.10/site-packages/langchain/callbacks/base.py", line 167, in on_chat_model_start
    raise NotImplementedError(
NotImplementedError: OpenAICallbackHandler does not implement `on_chat_model_start`
@ybsun0215
Copy link

Hello, i get the following error when running the code, presumably because the model is not specified.

"pydantic.errors.PydanticUserError: A non-annotated attribute was detected: lookup_index = 0. All model fields require a type annotation; if lookup_index is not meant to be a field, you may be able to resolve this error by annotating it as a ClassVar or updating model_config['ignored_types']."

where can I set up the model?

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

2 participants