-
Notifications
You must be signed in to change notification settings - Fork 15.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
partial variables #1308
partial variables #1308
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, although how do we want to handle serializing prompt templates with partial_variables in play? I can see it being confusing to have one version of the prompt with partials and another one without
langchain/prompts/few_shot.py
Outdated
partial_kwargs = { | ||
k: v if isinstance(v, str) else v() | ||
for k, v in self.partial_variables.items() | ||
} | ||
all_kwargs = {**partial_kwargs, **kwargs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can probs factor this out, it's in all 3 format functions
good point, ill add some check to stop serializing of partialed prompts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great
No description provided.