adamrushy / OpenAISwift

This is a wrapper library around the ChatGPT and OpenAI HTTP API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adding numChoices to sendCompletion

workingDog opened this issue · comments

Thank you for creating such a useful Swift Package.

It would be great if you could tweak your code by adding a simple property, to allow for selecting the
number of choices to the input of text sendCompletion(), similar to what you already have for sendImages()
with numImages.

This would mean:
in struct Command: Encodable add let numChoices: Int.
In extension OpenAISwift add numChoices: Int = 1 to the end of sendCompletion(with prompt:...),
similarly for sendCompletion(with prompt:...) async.

I feel that a formal pull request for such a minor update is not warranted.