This commit is contained in:
刘可亮
2025-07-22 11:15:46 +08:00
parent d164b333ed
commit 11c97ef399
2870 changed files with 951307 additions and 26675 deletions

View File

@@ -13,8 +13,9 @@
#include "./module/thread_pool.h"
#define THREADPOOL_MAX 3
#define WIFI_NAME NULL
#define WIFI_PASSWORD NULL
#define WIFI_NAME "xxx"
#define WIFI_PASSWORD "xxx"
typedef struct _lv_llm_msg
{
int type;
@@ -52,6 +53,9 @@ void ui_init(void)
{
llm_config_load(LLM_DEEPSEEK_V3, NULL);
extern void llm_font_create(void);
llm_font_create();
lv_obj_t *llm_scr = lv_obj_create(NULL);
lv_obj_clear_flag(llm_scr, LV_OBJ_FLAG_SCROLLABLE);
chat_ui_create(llm_scr);
@@ -194,8 +198,8 @@ void wifi_config_init(const char *wifi_name, const char *password)
static void llm_msg_init(void)
{
task_req_mq = rt_mq_create("task_req_mq",
1024,
sizeof(lv_llm_msg_t),
128,
RT_IPC_FLAG_FIFO);
if (!task_req_mq) {
LV_LOG_ERROR("Failed to create request message queue");
@@ -203,8 +207,8 @@ static void llm_msg_init(void)
}
ui_resp_mq = rt_mq_create("ui_resp_mq",
1024,
sizeof(lv_llm_msg_t),
128,
RT_IPC_FLAG_FIFO);
if (!ui_resp_mq) {
LV_LOG_ERROR("Failed to create response message queue");

View File

@@ -18,6 +18,7 @@ enum {
LLM_TONGYI_QWQ32B,
LLM_DOUBAO_1_5_256k,
LLM_DOUBAO_1_5_32k,
LLM_TYPE_MAX,
};
typedef int llm_type_t;

View File

@@ -92,7 +92,7 @@ char *llm_generate_response(llm_config_t *config)
}
strcat(newAllContent, config->content_buffer);
allContent = newAllContent;
printf("%s", config->content_buffer);
// printf("%s", config->content_buffer);
free(oldAllContent);
if (config->callback)

View File

@@ -34,9 +34,9 @@ thread_pool_t *thread_pool_create(int thread_count)
if (!pool) return NULL;
pool->task_mq = rt_mq_create("tpool_mq",
2048,
sizeof(thread_pool_task_t),
RT_IPC_FLAG_FIFO);
sizeof(thread_pool_task_t),
128,
RT_IPC_FLAG_FIFO);
if (!pool->task_mq) {
return NULL;
}

View File

@@ -24,9 +24,6 @@ static lv_obj_t *wifi_img;
lv_obj_t *chat_ui_create(lv_obj_t *parent)
{
extern void llm_font_create(void);
llm_font_create();
lv_obj_t *chat_obj = lv_obj_create(parent);
lv_obj_remove_style_all(chat_obj);
lv_obj_clear_flag(chat_obj, LV_OBJ_FLAG_SCROLL_CHAIN);