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.
tool-patch
hung_ng__ 1 year ago committed by GitHub
parent 3701b2901e
commit 3d6fcb85dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -120,6 +120,25 @@
"!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",
"id": "d788a83c",

Loading…
Cancel
Save