feat(agent-mui): add agent canvas, nodes, and related components

docs(agent-hooks-guide): add comprehensive guide for agent hooks usage and implementation
This commit is contained in:
2025-11-07 17:49:44 +08:00
parent b610ee0a8f
commit ed6e0ab282
24 changed files with 528 additions and 166 deletions

View File

@@ -1,5 +1,5 @@
import { useState, useEffect, useCallback, useMemo } from 'react';
import { LLM_MODEL_TYPES, type LlmModelType } from "@/constants/knowledge";
import { DocumentParserType, LlmModelType } from "@/constants/knowledge";
import type { IThirdOAIModelCollection, IThirdOAIModel } from "@/interfaces/database/llm";
import userService from "@/services/user_service";
@@ -121,7 +121,7 @@ export function useLlmOptionsByModelType() {
* @returns 嵌入模型选项列表
*/
export function useEmbeddingModelOptions() {
return useLlmOptions(LLM_MODEL_TYPES.Embedding);
return useLlmOptions(LlmModelType.Embedding);
}
/**
@@ -129,7 +129,7 @@ export function useEmbeddingModelOptions() {
* @returns 聊天模型选项列表
*/
export function useChatModelOptions() {
return useLlmOptions(LLM_MODEL_TYPES.Chat);
return useLlmOptions(LlmModelType.Chat);
}
/**
@@ -137,7 +137,7 @@ export function useChatModelOptions() {
* @returns 重排序模型选项列表
*/
export function useRerankModelOptions() {
return useLlmOptions(LLM_MODEL_TYPES.Rerank);
return useLlmOptions(LlmModelType.Rerank);
}
/**
@@ -145,7 +145,7 @@ export function useRerankModelOptions() {
* @returns 图像转文本模型选项列表
*/
export function useImage2TextModelOptions() {
return useLlmOptions(LLM_MODEL_TYPES.Image2text);
return useLlmOptions(LlmModelType.Image2text);
}
/**
@@ -153,7 +153,7 @@ export function useImage2TextModelOptions() {
* @returns 语音转文本模型选项列表
*/
export function useSpeech2TextModelOptions() {
return useLlmOptions(LLM_MODEL_TYPES.Speech2text);
return useLlmOptions(LlmModelType.Speech2text);
}
/**
@@ -161,7 +161,7 @@ export function useSpeech2TextModelOptions() {
* @returns 文本转语音模型选项列表
*/
export function useTTSModelOptions() {
return useLlmOptions(LLM_MODEL_TYPES.TTS);
return useLlmOptions(LlmModelType.TTS);
}
/**