mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
docs: change for optional variables in chatprompt (#25017)
Fixes #24884
This commit is contained in:
parent
423d286546
commit
8f33fce871
@ -46,7 +46,9 @@ class BasePromptTemplate(
|
|||||||
"""A list of the names of the variables whose values are required as inputs to the
|
"""A list of the names of the variables whose values are required as inputs to the
|
||||||
prompt."""
|
prompt."""
|
||||||
optional_variables: List[str] = Field(default=[])
|
optional_variables: List[str] = Field(default=[])
|
||||||
"""A list of the names of the variables that are optional in the prompt."""
|
"""optional_variables: A list of the names of the variables for placeholder
|
||||||
|
or MessagePlaceholder that are optional. These variables are auto inferred
|
||||||
|
from the prompt and user need not provide them."""
|
||||||
input_types: Dict[str, Any] = Field(default_factory=dict, exclude=True)
|
input_types: Dict[str, Any] = Field(default_factory=dict, exclude=True)
|
||||||
"""A dictionary of the types of the variables the prompt template expects.
|
"""A dictionary of the types of the variables the prompt template expects.
|
||||||
If not provided, all variables are assumed to be strings."""
|
If not provided, all variables are assumed to be strings."""
|
||||||
|
@ -946,8 +946,9 @@ class ChatPromptTemplate(BaseChatPromptTemplate):
|
|||||||
template_format: format of the template. Defaults to "f-string".
|
template_format: format of the template. Defaults to "f-string".
|
||||||
input_variables: A list of the names of the variables whose values are
|
input_variables: A list of the names of the variables whose values are
|
||||||
required as inputs to the prompt.
|
required as inputs to the prompt.
|
||||||
optional_variables: A list of the names of the variables that are optional
|
optional_variables: A list of the names of the variables for placeholder
|
||||||
in the prompt.
|
or MessagePlaceholder that are optional. These variables are auto inferred
|
||||||
|
from the prompt and user need not provide them.
|
||||||
partial_variables: A dictionary of the partial variables the prompt
|
partial_variables: A dictionary of the partial variables the prompt
|
||||||
template carries. Partial variables populate the template so that you
|
template carries. Partial variables populate the template so that you
|
||||||
don't need to pass them in every time you call the prompt.
|
don't need to pass them in every time you call the prompt.
|
||||||
|
Loading…
Reference in New Issue
Block a user