OpenAI NodeJS

Global

Type Definitions

AnswerBody

Type

  • Object

Properties

  • examples Array.<Array.<String>>

    List of (question, answer) pairs that will help steer the model towards the tone and answer format you'd like.

  • examples_context String

    A text snippet containing the contextual information used to generate the answers for the examples you provide.

  • documents Array.<String> <optional>

    List of documents from which the answer for the input question should be derived.

  • file String <optional>

    The ID of an uploaded file that contains documents to search over.

  • search_model String <optional>

    ID of the engine to use for Search.

  • return_prompt Boolean <optional>

    If set to true, the returned JSON will include a "prompt" field containing the final prompt that was used to request a completion.

  • expand Array.<String> <optional>

    If an object name is in the list, we provide the full information of the object; otherwise, we only provide the object ID.

  • max_rerank Number <optional>

    The maximum number of documents to be ranked by Search when using file.

  • return_metadata Boolean <optional>

    A special boolean flag for showing metadata.

  • max_tokens Number <optional>

    The maximum number of tokens allowed for the generated answer.

  • temperature Number <optional>

    What sampling temperature to use.

  • n Number <optional>

    How many answers to generate for each question.

  • logprobs Number <optional>

    Include the log probabilities on the logprobs most likely tokens, as well the chosen tokens.

  • stop String | Array.<String> <optional>

    Up to 4 sequences where the API will stop generating further tokens.

  • logit_bias Object <optional>

    Modify the likelihood of specified tokens appearing in the completion.

Source

ClassificationBody

Type

  • Object

Properties

  • examples Array.<Array.<String>> <optional>

    A list of examples with labels.

  • file String <optional>

    The ID of the uploaded file that contains training examples.

  • labels Array.<String> <optional>

    The set of categories being classified.

  • search_model String <optional>

    ID of the engine to use for Search.

  • temperature Number <optional>

    What sampling temperature to use.

  • logprobs Number <optional>

    Include the log probabilities on the logprobs most likely tokens, as well the chosen tokens.

  • max_examples Number <optional>

    The maximum number of examples to be ranked by Search when using file.

  • logit_bias Object <optional>

    Modify the likelihood of specified tokens appearing in the completion.

  • return_prompt Boolean <optional>

    If set to true, the returned JSON will include a "prompt" field containing the final prompt that was used to request a completion.

  • return_metadata Boolean <optional>

    A special boolean flag for showing metadata.

  • expand Array.<String> <optional>

    If an object name is in the list, we provide the full information of the object; otherwise, we only provide the object ID.

Source

CompletionBody

Type

  • Object

Properties

  • max_tokens Number <optional>

    The maximum number of tokens to generate.

  • temperature Number <optional>

    What sampling temperature to use.

  • top_p Number <optional>

    An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.

  • n Number <optional>

    How many completions to generate for each prompt.

  • stream Boolean <optional>

    Whether to stream back partial progress.

  • logprobs Number <optional>

    Include the log probabilities on the logprobs most likely tokens, as well the chosen tokens.

  • echo Boolean <optional>

    Echo back the prompt in addition to the completion

  • stop String | Array.<String> <optional>

    Up to 4 sequences where the API will stop generating further tokens.

  • presence_penalty Number <optional>

    Number between 0 and 1 that penalizes new tokens based on whether they appear in the text so far.

  • frequency_penalty Number <optional>

    Number between 0 and 1 that penalizes new tokens based on their existing frequency in the text so far.

  • best_of Number <optional>

    Generates best_of completions server-side and returns the "best" (the one with the lowest log probability per token).

  • logit_bias Object <optional>

    Modify the likelihood of specified tokens appearing in the completion.

Source

SearchBody

Type

  • Object

Properties

  • documents Array.<String> <optional>

    Up to 200 documents to search over, provided as a list of strings.

  • file String <optional>

    The ID of an uploaded file that contains documents to search over.

  • max_rerank Number <optional>

    The maximum number of documents to be re-ranked and returned by search.

  • return_metadata Boolean <optional>

    A special boolean flag for showing metadata.

Source