Skip to content

Issue while running Openagent with latest langchain and pydantic libs #59

Closed as not planned
@yadavj2008

Description

@yadavj2008

Hello Team,

I need to run Openagent on latest langchain & pydantic version due to other application dependencies issues. When I upgraded the these libs, I'm getting below error.

2023-11-02 14:54:53 | ERROR - DefaultUser++6543adffef58bdc242f70815->/chat Chat error:'llm_chain' Traceback (most recent call last): File "/home/admin_co/OpenAgents/backend/api/chat_copilot.py", line 386, in chat interaction_executor = create_interaction_executor( File "/home/admin_co/OpenAgents/backend/api/chat_copilot.py", line 311, in create_interaction_executor interaction_executor = initialize_agent(tools, llm, continue_model, memory=memory, File "/home/admin_co/OpenAgents/real_agents/adapters/interactive_executor.py", line 38, in initialize_agent agent_obj = ConversationalChatAgent.from_llm_and_tools( File "/home/admin_co/OpenAgents/real_agents/data_agent/copilot.py", line 197, in from_llm_and_tools return cls( File "/home/admin_co/anaconda3/envs/openagents/lib/python3.10/site-packages/pydantic/v1/main.py", line 339, in __init__ values, fields_set, validation_error = validate_model(__pydantic_self__.__class__, data) File "/home/admin_co/anaconda3/envs/openagents/lib/python3.10/site-packages/pydantic/v1/main.py", line 1102, in validate_model values = validator(cls_, values) File "/home/admin_co/OpenAgents/real_agents/adapters/agent_helpers/agent.py", line 291, in validate_prompt prompt = values["llm_chain"].prompt KeyError: 'llm_chain'

I tried several things including using pydantic.v1 to make code compatible with previous pydantic version but this also didn't work.

Below is the lib versions I'm using. Can someone please guide me on this?.

`(openagents)$ conda list|grep lang
langchain 0.0.323 pypi_0 pypi
langsmith 0.0.54 pypi_0 pypi

(openagents)$ conda list|grep pydantic

openapi-schema-pydantic 1.2.4 pypi_0 pypi
pydantic 2.4.2 pypi_0 pypi
pydantic-core 2.10.1 pypi_0 pypi
`
Also, is there any plan to upgrade openagent with latest langchain version, as there are lot of features been added into it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions