Configure particular Runnable fields at runtime.
The name of the Runnable. Used for debugging and tracing.
Input type.
Output Type.
The type of input this Runnable accepts specified as a Pydantic model.
Output schema.
List configurable fields for this Runnable.
Get the name of the Runnable.
Get a Pydantic model that can be used to validate input to the Runnable.
Get a JSON schema that represents the input to the Runnable.
Get a Pydantic model that can be used to validate output to the Runnable.
Template represented by a dictionary.
Recognizes variables in f-string or mustache formatted string dict values.
Does NOT recognize variables in dict keys. Applies recursively.
Example:
prompt = DictPromptTemplate(
template={
"type": "text",
"text": "Hello {name}",
"metadata": {"source": "{source}"},
},
template_format="f-string",
)
prompt.format(name="Alice", source="docs")
# {
# "type": "text",
# "text": "Hello Alice",
# "metadata": {"source": "docs"},
# }Get a JSON schema that represents the output of the Runnable.