Skip to content

Support multiple prompts in CompletionRequest #84

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

Closed
Code-Hex opened this issue Feb 22, 2023 · 3 comments
Closed

Support multiple prompts in CompletionRequest #84

Code-Hex opened this issue Feb 22, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@Code-Hex
Copy link

Code-Hex commented Feb 22, 2023

Hi 👋 Thanks for developing a great library!

Openai create-prompt documentation says the prompt field is supported encoded as a string, array of strings, array of tokens, or array of token arrays. but this library seems to be supported only encoded as a string.

openai-js implemented type for that like this: https://github.com/threepointone/openai-js/blob/eaade749f2ead531d2ac9a2015184f7b6418a581/api.ts#L475

So I want to ask the question, How can I send a completion request with an array of string?

Thanks

@jamiesun
Copy link

Use one API call to answer multiple questions

I think multiple questions should be supported, and this should be a way to maintain the context of the conversation

@vvatanabe
Copy link
Collaborator

@sashabaranov
This feature was implemented in PR #220. The requirements for this Issue have been met. Can you close this Issue?

Example:

CompletionRequest{
	Prompt:    []string{"Lorem ipsum", "Lorem ipsum", "Lorem ipsum"}, //use string or []string 
	Model:     GPT3Curie,
	MaxTokens: 5,
}

@vvatanabe vvatanabe added the enhancement New feature or request label Jul 1, 2023
@vvatanabe
Copy link
Collaborator

Fixed #220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants