coze chat proxy
v0.0.5
modeltoken e id(COZE_BOT_ID) exclusivo de BOT, que es el BOT alojado por Coze.token(BOT_TOKEN) , que es el mensaje enviado y recibido a BOT-01 y recibido.Send Messages , Read Message History , etc.) e invitan al servidor para grabar la ID del servidor ( GUILD_ID ).token de Discord-Bot, es decir, token de Bot-01. Después de hacer clic para completar, puede ver BOT-01 en línea en el servidor Discord y puede usarse @..env (las variables de entorno son efectivas) e inicie este proyecto. LOG_LEVEL:info , info predeterminada
SERVER_PORT:8080 , predeterminado 8080
BOT_CONFIG:bot.json Discord-Bot File de configuración, predeterminado bot.json
AUTH_TOKEN : 123456 Valor de verificación del encabezado de solicitud (extremo delantero y trasero unificados). Después de configurar este parámetro, agregue el parámetro Authorization al header de solicitud cada vez que inicie una solicitud, es decir, agregue Authorization:Bearer 123456 , predeterminado 1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ
.env en el mismo directorio que el programa. [
{
"model": "gpt-3.5-turbo", // bot模型可自定义,与请求接口保持一致 可自定义
"bot_token": "MTI************", //见如何使用.3
"coze_bot_id": "120**********", //见如何使用.2
"guild_id": "103************", //见如何使用.4
"channel_id": "120*********" //在所在服务器 创建频道 记录id
},
{
"model": "dall-e-3", // bot模型可自定义,与请求接口保持一致 可自定义
"bot_token": "MTI************", //见如何使用.3
"coze_bot_id": "120**********", //见如何使用.2
"guild_id": "103************", //见如何使用.4
"channel_id": "120*********" //在所在服务器 创建频道 记录id
}
]
mkdir -p $PWD/coze-chat-proxy
docker run -itd --name=coze-chat-proxy -p 8080:8080 -v $PWD/coze-chat-proxy:/data:/app/data -v $PWD/coze-chat-proxy/log:/app/log -e AUTH_TOKEN=<AUTH_TOKEN>
registry.cn-hangzhou.aliyuncs.com/aurorax/coze-chat-proxy:<tag>
bot.json en $PWD/coze-chat-proxy/data y reinicie el contenedor http://<ip>:<port>/v1/chat/completions
curl --location --request POST 'http://127.0.0.1:8080/v1/chat/completions'
--header 'Authorization: Bearer ****'
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)'
--header 'Content-Type: application/json'
--data-raw '{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "西红柿炒钢丝球怎么做?"
}
],
"stream": false,
}'
http://<ip>:<port>/v1/images/generations
curl --location --request POST 'http://127.0.0.1:8080/v1/images/generations'
--header 'Authorization: Bearer ****'
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)'
--header 'Content-Type: application/json'
--data-raw '{
"model": "dall-e-3",
"prompt": "A cute dog",
"n": 1,
"size": "1024x1024"
}'