Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

partial variables #1308

Merged
merged 7 commits into from Feb 28, 2023
Merged

partial variables #1308

merged 7 commits into from Feb 28, 2023

Conversation

hwchase17
Copy link
Contributor

No description provided.

@agola11 agola11 self-requested a review February 27, 2023 06:28
Copy link
Collaborator

@agola11 agola11 left a 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

Comment on lines 114 to 118
partial_kwargs = {
k: v if isinstance(v, str) else v()
for k, v in self.partial_variables.items()
}
all_kwargs = {**partial_kwargs, **kwargs}
Copy link
Collaborator

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

@hwchase17
Copy link
Contributor Author

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

good point, ill add some check to stop serializing of partialed prompts

Copy link
Collaborator

@agola11 agola11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great

@hwchase17 hwchase17 merged commit 786852e into master Feb 28, 2023
@hwchase17 hwchase17 deleted the harrison/partial-variables branch February 28, 2023 16:40
zachschillaci27 pushed a commit to zachschillaci27/langchain that referenced this pull request Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants