Skip to content

Instantly share code, notes, and snippets.

@bonadio
Last active October 23, 2023 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bonadio/7cdb21101870dd1e5022dc34960b4ac5 to your computer and use it in GitHub Desktop.
Save bonadio/7cdb21101870dd1e5022dc34960b4ac5 to your computer and use it in GitHub Desktop.
API bot
POST https://algumservidor/api_send/v1/chat
{
"client_id": 123 # identificador do cliente
"app_id": 123 # identificador do app
"action": "INSERT", # INSERT REMOVE ASK
"id": "12", # identificador para INSERT ou REMOVE
"text": "texto", # se for REMOVE em branco
"secret": "codigo de segurança" # código de segurança que vamos compartilhar
"api_key": "open_ai_api_key" # a chave da API
}
A resposta será
{
"status": "OK", # OK ou ERROR se for ERROR no text tera a mensagem
"text": "texto da resposta", #
"result_action": "ACTION_RESPONSE", # ACTION_RESPONSE "estamos respondendo" ACTION_NO_RESPONSE nao achamos resposta
"tokens": [ # tokens vai ser um array com MODELO e QTD informando a quantidade de tokens usada em cada chamada
{
"model": "GPT-3.5",
"qtd": 300
},
{
"model": "OPENAI-EMBEDDING",
"qtd": 300
},
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment