call_open_ai_completion_api#

call_open_ai_completion_api(inputs: Sequence[str], max_tokens=200, batch_size=20, model: str = 'text-davinci-003', temperature: float = 0.5) List[str][source]#

Call the open ai completion api with the given inputs batch by batch.

Parameters
inputsSequence[str]

The inputs to send to the api.

max_tokensint, default 200

The maximum number of tokens to return for each input.

batch_sizeint, default 20

The number of inputs to send in each batch.

modelstr, default ‘text-davinci-003’

The model to use for the question answering task. For more information about the models, see: https://beta.openai.com/docs/api-reference/models

temperaturefloat, default 0.5

The temperature to use for the question answering task. For more information about the temperature, see: https://beta.openai.com/docs/api-reference/completions/create-completion

Returns
List[str]

The answers for the questions.