mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-10 15:06:18 +00:00
Add load json prompt example (#1776)
Hi, I just want to add a PR on the prompt serialization examples of loading from JSON so that it can contain the same as loading from YAML.
This commit is contained in:
parent
3701b2901e
commit
3d6fcb85dc
@ -120,6 +120,25 @@
|
|||||||
"!cat simple_prompt.json"
|
"!cat simple_prompt.json"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "de75e959",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"prompt = load_prompt(\"simple_prompt.json\")\n",
|
||||||
|
"print(prompt.format(adjective=\"funny\", content=\"chickens\"))"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "d1d788f9",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"Tell me a funny joke about chickens."
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "d788a83c",
|
"id": "d788a83c",
|
||||||
|
Loading…
Reference in New Issue
Block a user