对话补全

POSThttps://api.deepseek.com/chat/completions

根据输入的上下文,来让模型补全对话内容。

Request

  • APPLICATION/JSON

BODY

REQUIRED

Responses

  • 200 (No streaming)
  • 200 (Streaming)

OK, 返回一个 chat completion 对象。

  • APPLICATION/JSON
  • Schema
  • Example (from schema)
  • Example

SCHEMA

  • CURL
  • PYTHON
  • GO
  • NODEJS
  • RUBY
  • CSHARP
  • PHP
  • JAVA
  • POWERSHELL
  • CURL
curl -L -X POST 'https://api.deepseek.com/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"messages": [
{
"content": "You are a helpful assistant",
"role": "system"
},
{
"content": "Hi",
"role": "user"
}
],
"model": "deepseek-chat",
"frequency_penalty": 0,
"max_tokens": 2048,
"presence_penalty": 0,
"response_format": {
"type": "text"
},
"stop": null,
"stream": false,
"stream_options": null,
"temperature": 1,
"top_p": 1,
"tools": null,
"tool_choice": "none",
"logprobs": false,
"top_logprobs": null
}'

REQUESTCOLLAPSE ALLBase URL

https://api.deepseek.comAuthBearer TokenBody REQUIRED

{
  "messages": [
    {
      "content": "You are a helpful assistant",
      "role": "system"
    },
    {
      "content": "Hi",
      "role": "user"
    }
  ],
  "model": "deepseek-chat",
  "frequency_penalty": 0,
  "max_tokens": 2048,
  "presence_penalty": 0,
  "response_format": {
    "type": "text"
  },
  "stop": null,
  "stream": false,
  "stream_options": null,
  "temperature": 1,
  "top_p": 1,
  "tools": null,
  "tool_choice": "none",
  "logprobs": false,
  "top_logprobs": null
}

SEND API REQUEST

RESPONSECLEAR

Click the Send API Request button above and see the response here!上一页基本信息下一页FIM 补全(Beta)

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

////