gpt4-copilot-java
  1. copilot接口
gpt4-copilot-java
  • 🦊 【开始】了解 gpt4-copilot-java !
  • 🦄 【基础】教你部署gpt4-copilot-java
  • 🔥 【基础】gpt4-copilot-java使用GPT-4(独享)
  • 🚗 【基础】gpt4-copilot-java使用GPT-4(公车或车主版)
  • 👍 【进阶】gpt4-copilot-java结合copilot使用fastGpt知识库
  • 👍 【进阶】gpt4-copilot-java使用自定义链接转api
  • copilot接口
    • 转发copilot chat 接口
      POST
    • 转发copilot embeddings接口
      POST
    • 查询copilot models
      GET
  • cocopliot车主接口
    • cocopliot车主 chat接口
      POST
    • cocopliot车主 embeddings接口
      POST
    • cocopliot车主 models接口
      GET
  • 自定义chat接口
    • 自定义 chat接口
      POST
    • 自定义 embeddings接口
      POST
  • 修改字符间隔时间接口
    • 字符间隔时间接口
      GET
  1. copilot接口

转发copilot chat 接口

POST
/自定义后缀/v1/chat/completions

请求参数

Header 参数
Authorization
string 
可选
示例值:
Bearer ghu-XXX
Body 参数text/plain
示例
示例值:{ "stream":true, "model":"gpt-4", "messages": [{"role": "user", "content": "你好"}] }

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/自定义后缀/v1/chat/completions' \
--header 'Authorization: Bearer ghu-XXX' \
--header 'Content-Type: text/plain' \
--data-raw '{
    "stream":true,
    "model":"gpt-4",
    "messages": [{"role": "user", "content": "你好"}]
}'

返回响应

🟢200成功
application/json
Body
object {0}
示例
data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": null,
                "role": "assistant"
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "你",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "好",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "!",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "有",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "什",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "么",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "我",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "可以",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "帮",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "助",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "你",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "的",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "吗",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "?",
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: {
    "choices": [
        {
            "finish_reason": "stop",
            "index": 0,
            "delta": {
                "content": null,
                "role": null
            }
        }
    ],
    "created": 1703682082,
    "id": "chatcmpl-8aNpCyVK7wPuBdxsIYXiFGrpwEsNm"
}

data: [DONE
]
修改于 2024-04-12 17:20:50
上一页
👍 【进阶】gpt4-copilot-java使用自定义链接转api
下一页
转发copilot embeddings接口
Built with