49 lines
1.0 KiB
C
49 lines
1.0 KiB
C
#ifndef __HTTP_CAHT_H__
|
|
#define __HTTP_CAHT_H__
|
|
|
|
#include "system/includes.h"
|
|
#include "wifi/wifi_connect.h"
|
|
#include "apps/http_client.h"
|
|
#include "app_config.h"
|
|
#include "cJSON.h"
|
|
#include "fs/fs.h"
|
|
|
|
//chat地址
|
|
#define HTTP_DEMO_URL "https://ark.cn-beijing.volces.com/api/v3/chat/completions"
|
|
|
|
//demo_chat发送信息
|
|
#define HTTP_DEMO_DATA "{\"model\":\"ep-20241018141941-6bn54\", \"messages\":[{\"role\":\"user\", \"content\":\"豆包,介绍一下上甘岭战役\"}]}"
|
|
|
|
//校验令牌
|
|
#define AUTHORIZATION "Bearer f311cc81-1c5b-42c3-bb8a-1b10d1348080"
|
|
|
|
//chat回复接收的最大数据
|
|
#define MAX_CONTENT_LENGTH 4*1024
|
|
|
|
//上下文最大留存
|
|
#define MAX_MSG_LENGTH 10
|
|
|
|
//上下文结构体
|
|
typedef struct message_session{
|
|
char role[10];
|
|
char content[5*1024];
|
|
}msg_session;
|
|
|
|
|
|
extern unsigned char chat_msg[4 * 1024];
|
|
|
|
extern OS_SEM chat_sem;
|
|
|
|
extern OS_SEM disconnet_sem;
|
|
|
|
//extern OS_MUTEX http_mutex;
|
|
|
|
//extern u8 sock_run_flag;
|
|
|
|
extern u8 playback_stop_flag;
|
|
|
|
//OS_SEM tts_sem;
|
|
|
|
void http_chat_task_create(void);//http_chat 主线程创建
|
|
#endif
|