Liking cljdoc? Tell your friends :D
Clojure only.

openai-clj.completion


create-completionclj

(create-completion params)
(create-completion params options)

Creates a completion for the provided prompt and parameters.

Example:

(create-completion {:model "gpt-3.5-turbo-instruct"
                    :prompt "Say this is a test"
                    :max_tokens 7
                    :temperature 0})

Response:

{
"id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
"object": "text_completion",
"created": 1589478378,
"model": "gpt-3.5-turbo-instruct",
"system_fingerprint": "fp_44709d6fcb",
"choices": [
  {
    "text": "\n\nThis is indeed a test",
    "index": 0,
    "logprobs": null,
    "finish_reason": "length"
  }
],
"usage": {
  "prompt_tokens": 5,
  "completion_tokens": 7,
  "total_tokens": 12
}
}

Also see the OpenAI documentation

Creates a completion for the provided prompt and parameters.

  Example:
  ```
  (create-completion {:model "gpt-3.5-turbo-instruct"
                      :prompt "Say this is a test"
                      :max_tokens 7
                      :temperature 0})
  ```

  Response:
  ```
  {
  "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
  "object": "text_completion",
  "created": 1589478378,
  "model": "gpt-3.5-turbo-instruct",
  "system_fingerprint": "fp_44709d6fcb",
  "choices": [
    {
      "text": "\n\nThis is indeed a test",
      "index": 0,
      "logprobs": null,
      "finish_reason": "length"
    }
  ],
  "usage": {
    "prompt_tokens": 5,
    "completion_tokens": 7,
    "total_tokens": 12
  }
}

  ```

  Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/completions/create)
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close