langchain
langchain copied to clipboard
ERROR:root:'OpenAIEmbeddings' object has no attribute 'max_retries'
version: 0.0.106
OpenAI seems to no longer support max_retries.
https://platform.openai.com/docs/api-reference/completions/create?lang=python
what is the full stack trace? what command are you running to generate this?
works in version: 0.0.0100, but not 0.0.106
I am using https://github.com/hwchase17/chat-langchain and sending input question to /chat.
WARNING:root:Failed to default session, using empty session: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /sessions (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x13f00ca50>: Failed to establish a new connection: [Errno 61] Connection refused'))
File "
Works up to 0.0.105, but not in 0.0.106
vectorstore: VectorStore, question_handler, stream_handler, tracing: bool = True
) -> ChatVectorDBChain:
"""Create a ChatVectorDBChain for question/answering."""
# Construct a ChatVectorDBChain with a streaming llm for combine docs
# and a separate, non-streaming llm for question generation
manager = AsyncCallbackManager([])
question_manager = AsyncCallbackManager([question_handler])
stream_manager = AsyncCallbackManager([stream_handler])
if tracing:
tracer = LangChainTracer()
tracer.load_default_session()
manager.add_handler(tracer)
question_manager.add_handler(tracer)
stream_manager.add_handler(tracer)
question_gen_llm = OpenAI(
temperature=0,
verbose=True,
callback_manager=question_manager,
)
streaming_llm = OpenAI(
streaming=True,
callback_manager=stream_manager,
verbose=True,
temperature=0,
)
question_generator = LLMChain(
llm=question_gen_llm, prompt=CONDENSE_QUESTION_PROMPT, callback_manager=manager
)
doc_chain = load_qa_chain(
streaming_llm, chain_type="stuff", prompt=QA_PROMPT, document_prompt=EOS_DOC_PROMPT,
callback_manager=manager
)
qa = ChatVectorDBChain(
vectorstore=vectorstore,
combine_docs_chain=doc_chain,
question_generator=question_generator,
callback_manager=manager,
)
traceback.print_stack()
return qa
```
Hello, I have the same error on version: 0.0.106, not sure why.
0.0.105 is working fine.
https://github.com/hwchase17/langchain/blob/c844d1fd4667f3748b712550221f2139755110a2/langchain/embeddings/openai.py
I think I know why, will update soon. user error I think.
βProblem: Loading vectorstore that was created using version openai.py embedding that did not contain max_retries attributes in class.
https://github.com/hwchase17/langchain/blob/383c67c1b259ddd0faada1469abdfa7b04cfe481/langchain/embeddings/openai.py
π‘Solution: Rebuild my vectorstore and all was good.
βProblem: Loading vectorstore that was created using version openai.py embedding that did not contain max_retries attributes in class.
https://github.com/hwchase17/langchain/blob/383c67c1b259ddd0faada1469abdfa7b04cfe481/langchain/embeddings/openai.pyπ‘Solution: Rebuild my vectorstore and all was good.
I have the same problem, could you share how to rebuild the vectorstore? If so, I will very appreciate!π
It depends on what youβre loading, are you using a specific Repo example?
Had the same issue, its an incompatablility with old vectorstores. I did a new document loader in colab and tried that one and worked. I was storing files in bucket on s3 and was having issues. Switching to new loader helped.