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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prompts: FewShotPrompt implementation #199

Merged
merged 2 commits into from
Aug 11, 2023
Merged

prompts: FewShotPrompt implementation #199

merged 2 commits into from
Aug 11, 2023

Conversation

AMK9978
Copy link
Contributor

@AMK9978 AMK9978 commented Jul 17, 2023

Description

Added FewShotPrompt. Fixes #196.
Python source

PR Checklist

  • Read the Contributing documentation.
  • Read the Code of conduct documentation.
  • Name your Pull Request title clearly, concisely, and prefixed with the name of the primarily affected package you changed according to Good commit messages (such as memory: add interfaces for X, Y or util: add whizzbang helpers).
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. Fixes #123).
  • Describes the source of new concepts.
  • References existing implementations as appropriate.
  • Contains test coverage for new functions.
  • Passes all golangci-lint checks.

}

// FewShotCallOptions contains optional fields for FewShotPrompt.
type FewShotCallOptions struct {
Copy link
Owner

@tmc tmc Jul 23, 2023

Choose a reason for hiding this comment

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

if we're putting multiple fields in here then the options argument to New shouldn't be variadic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to let developers not provide any option instead of passing an empty CallOption instance. I guess we have the same with the llms.options.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think having options to the constructor is necessary for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about default values?

		ExampleSeparator: "\n\n",
		TemplateFormat:   TemplateFormatGoTemplate,
		ValidateTemplate: true,

these are their default values. I can set their type as a pointer to let developers set nil and I set their default. I want them to be able to use default values without explicitly setting them. Thoughts?

@AMK9978
Copy link
Contributor Author

AMK9978 commented Aug 9, 2023

@FluffyKebab
Could you take a look at this PR? It's essential for another PR which is ConstitutionalChain.

prompts/few_shot_test.go Outdated Show resolved Hide resolved
prompts/few_shot_test.go Outdated Show resolved Hide resolved
}

// FewShotCallOptions contains optional fields for FewShotPrompt.
type FewShotCallOptions struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think having options to the constructor is necessary for this.

@AMK9978
Copy link
Contributor Author

AMK9978 commented Aug 11, 2023

@FluffyKebab @tmc
I updated the code and removed FewShotCallOptions. I will appreciate it if you take another look at it.

@tmc tmc merged commit fd8b7f0 into tmc:main Aug 11, 2023
3 checks passed
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.

feat: FewShotPromptTemplate
3 participants