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

__setstate__ calls update_llm(None, None) which requires valid OpenAI API keys #122

Closed
GordonMcGregor opened this issue May 25, 2023 · 2 comments

Comments

@GordonMcGregor
Copy link

Project is excellent - thank you for releasing it.

When trying to use it with other LLMs, everything works via the docs.init method, but after pickling, setstate calls self.update_llm(None, None) which resets everything to OpenAI LLMs. This requires a valid OpenAI key to validate, as llm is None, so you create instances of ChatOpenAi, which attempts to validate the OPENAI_API_KEY.

I can after, unpicking, call docs.update_llm() again with an instance of the LLM I want to use, but the current pickle /restore is still dependent on that ChatOpenAI instantiation in the first place.

I can hack around it by setting an invalid OpenAI key in the environment, but that's a bit of a kludge.

@whitead
Copy link
Collaborator

whitead commented May 25, 2023

Thanks - check out version 1.9.0. Should be fixed

@GordonMcGregor
Copy link
Author

works now. thank you.

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