Fix intermediate steps example in docs : replaced json.dumps with Langchain's dumps() (#10593)

The intermediate steps example in docs has an example on how to retrieve
and display the intermediate steps.
But the intermediate steps object is of type AgentAction which cannot be
passed to json.dumps (it raises an error).
I replaced it with Langchain's dumps function (from langchain.load.dump
import dumps) which is the preferred way to do so.
pull/10578/head
Jeremy Naccache 1 year ago committed by GitHub
parent a79f595543
commit c59a5bae48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -166,9 +166,9 @@
}
],
"source": [
"import json\n",
"from langchain.load.dump import dumps\n",
"\n",
"print(json.dumps(response[\"intermediate_steps\"], indent=2))"
"print(dumps(response[\"intermediate_steps\"], pretty=True))"
]
},
{

Loading…
Cancel
Save