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

aconvert_to_graph_documents intermittently raises openai.APIConnectionError #18

Open
kaustubh-darekar opened this issue Nov 19, 2024 · 0 comments

Comments

@kaustubh-darekar
Copy link

I am encountering an intermittent issue while using the LLMGraphTransformer asynchronously. The error occurs occasionally during the execution of the aconvert_to_graph_documents method. Below is the code snippet causing the issue:

llm_transformer = LLMGraphTransformer(
   llm=llm,
   node_properties=node_properties,
   relationship_properties=relationship_properties,
   allowed_nodes=allowedNodes,
   allowed_relationships=allowedRelationship,
   ignore_tool_usage=True,
)
graph_document_list = await llm_transformer.aconvert_to_graph_documents(combined_chunk_document_list)

Error Traceback:

File "/opt/conda/envs/myenv310/lib/python3.10/site-packages/langchain_experimental/graph_transformers/llm.py", line 1022, in aconvert_to_graph_documents
   results = await asyncio.gather(*tasks)
 File "/opt/conda/envs/myenv310/lib/python3.10/site-packages/langchain_experimental/graph_transformers/llm.py", line 933, in aprocess_response
   raw_schema = await self.chain.ainvoke({"input": text}, config=config)
 File "/opt/conda/envs/myenv310/lib/python3.10/site-packages/langchain_core/runnables/base.py", line 3068, in ainvoke
   input = await asyncio.create_task(part())
 ...
 File "/opt/conda/envs/myenv310/lib/python3.10/site-packages/openai/_base_client.py", line 1606, in _request
   raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.

Additional Information:
• The issue occurs sporadically, not consistently.
• I am using github codespace linux based environment.

Environment Details:
• Python version: 3.10
• langchain: 0.3.7
• langchain-community: 0.3.0
• langchain-openai : 0.2.9
• langchain-experimental : 0.3.3

Let me know if you need further details.

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