Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

save_agent for AgentType.OpenAI_Functions not implemented #53

Open
Saksham2703 opened this issue Aug 1, 2023 · 0 comments
Open

save_agent for AgentType.OpenAI_Functions not implemented #53

Saksham2703 opened this issue Aug 1, 2023 · 0 comments

Comments

@Saksham2703
Copy link


NotImplementedError Traceback (most recent call last)
Cell In[6], line 1
----> 1 agent.save_agent("file_name.yaml")

File ~/anaconda3/envs/python3/lib/python3.10/site-packages/langchain/agents/agent.py:733, in AgentExecutor.save_agent(self, file_path)
731 def save_agent(self, file_path: Union[Path, str]) -> None:
732 """Save the underlying agent."""
--> 733 return self.agent.save(file_path)

File ~/anaconda3/envs/python3/lib/python3.10/site-packages/langchain/agents/agent.py:166, in BaseSingleActionAgent.save(self, file_path)
163 directory_path.mkdir(parents=True, exist_ok=True)
165 # Fetch dictionary to save
--> 166 agent_dict = self.dict()
168 if save_path.suffix == ".json":
169 with open(file_path, "w") as f:

File ~/anaconda3/envs/python3/lib/python3.10/site-packages/langchain/agents/agent.py:137, in BaseSingleActionAgent.dict(self, **kwargs)
135 """Return dictionary representation of agent."""
136 _dict = super().dict()
--> 137 _type = self._agent_type
138 if isinstance(_type, AgentType):
139 _dict["_type"] = str(_type.value)

File ~/anaconda3/envs/python3/lib/python3.10/site-packages/langchain/agents/agent.py:132, in BaseSingleActionAgent._agent_type(self)
129 @Property
130 def _agent_type(self) -> str:
131 """Return Identifier of agent type."""
--> 132 raise NotImplementedError

NotImplementedError:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant