langchain icon indicating copy to clipboard operation
langchain copied to clipboard

How to override prompt for JSON Agent

Open sid8491 opened this issue 1 year ago • 1 comments

How can I override the prompt used in JSON Agent (https://github.com/hwchase17/langchain/blob/master/langchain/agents/agent_toolkits/json/prompt.py)

Also, how can I print/log what information/text is being sent on every execution?

sid8491 avatar Apr 21 '23 12:04 sid8491

When you call create_json_agent() there are parameters you can pass in for the prefix and suffix.

my_prefix = "prefix here"
my_suffix = "suffix here"

agent = create_json_agent(
    llm=llm,
    prefix=my_prefix,
    suffix=my_suffix,
    verbose=True # verbose will print more detailed output
)

There are also verbosity settings you can set on your model, including different options for different chain types.

account00001 avatar Apr 24 '23 02:04 account00001