Find answers from the community

Updated 6 months ago

Langchain prompt

At a glance

The community member is asking if there is a way to inject an additional prompt or description onto an agent, specifically a conversational chat agent. The comments indicate that it is possible to customize the prefix of the agent, but it can be a little complicated. The community members suggest that the approach depends on the specific agent being used, and that the prefix is passed in under agent_kwargs when calling initialize_agent. However, there is no explicitly marked answer in the provided information.

Useful resources
Any way to inject an additional prompt / description onto agent? I know i can add descriptions to tools. Perhaps any way I can modify the conversational chat agent a little bit.
L
3 comments
Definitely, you can customize the prefix to the agent.

It's a little complicated though lol

Depending on the agent you are using, there are different prefixes. Here is the one for conversational chat react

https://github.com/hwchase17/langchain/blob/master/langchain/agents/conversational_chat/prompt.py
It's a little different to set for each agent tbh, but it's passed in under agent_kwargs when calling initialize_agent
I have to read the source code every time to figure it out lol
Add a reply
Sign up and join the conversation on Discord