basePath: /api/v1 definitions: github_com_Tencent_WeKnora_internal_errors.AppError: properties: code: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.ErrorCode' details: {} message: type: string type: object github_com_Tencent_WeKnora_internal_errors.ErrorCode: enum: - 1000 - 1001 - 1002 - 1003 - 1004 - 1005 - 1006 - 1007 - 1008 - 1009 - 1010 - 2000 - 2001 - 2002 - 2003 - 2004 - 2100 - 2101 - 2102 - 2103 type: integer x-enum-varnames: - ErrBadRequest - ErrUnauthorized - ErrForbidden - ErrNotFound - ErrMethodNotAllowed - ErrConflict - ErrTooManyRequests - ErrInternalServer - ErrServiceUnavailable - ErrTimeout - ErrValidation - ErrTenantNotFound - ErrTenantAlreadyExists - ErrTenantInactive - ErrTenantNameRequired - ErrTenantInvalidStatus - ErrAgentMissingThinkingModel - ErrAgentMissingAllowedTools - ErrAgentInvalidMaxIterations - ErrAgentInvalidTemperature github_com_Tencent_WeKnora_internal_types.AgentConfig: properties: allowed_tools: description: List of allowed tool names items: type: string type: array knowledge_bases: description: Accessible knowledge base IDs items: type: string type: array max_iterations: description: Maximum number of ReAct iterations type: integer reflection_enabled: description: Whether to enable reflection type: boolean system_prompt_web_disabled: description: Custom prompt when web search is disabled type: string system_prompt_web_enabled: description: Custom prompt when web search is enabled type: string temperature: description: LLM temperature for agent type: number use_custom_system_prompt: description: Whether to use custom system prompt instead of default type: boolean web_search_enabled: description: Whether web search tool is enabled type: boolean web_search_max_results: description: 'Maximum number of web search results (default: 5)' type: integer type: object github_com_Tencent_WeKnora_internal_types.AgentStep: properties: iteration: description: Iteration number (0-indexed) type: integer thought: description: LLM's reasoning/thinking (Think phase) type: string timestamp: description: When this step occurred type: string tool_calls: description: Tools called in this step (Act phase) items: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall' type: array type: object github_com_Tencent_WeKnora_internal_types.AnswerStrategy: enum: - all - random type: string x-enum-varnames: - AnswerStrategyAll - AnswerStrategyRandom github_com_Tencent_WeKnora_internal_types.ChunkingConfig: properties: chunk_overlap: description: Chunk overlap type: integer chunk_size: description: Chunk size type: integer enable_multimodal: description: EnableMultimodal (deprecated, kept for backward compatibility with old data) type: boolean separators: description: Separators items: type: string type: array type: object github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy: enum: - sliding_window - smart type: string x-enum-varnames: - ContextCompressionSlidingWindow - ContextCompressionSmart github_com_Tencent_WeKnora_internal_types.ContextConfig: properties: compression_strategy: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy' description: 'Compression strategy: "sliding_window" or "smart"' max_tokens: description: Maximum tokens allowed in LLM context type: integer recent_message_count: description: |- For sliding_window: number of messages to keep For smart: number of recent messages to keep uncompressed type: integer summarize_threshold: description: 'Summarize threshold: number of messages before summarization' type: integer type: object github_com_Tencent_WeKnora_internal_types.ConversationConfig: properties: context_template: description: ContextTemplate is the prompt template for summarizing retrieval results type: string embedding_top_k: type: integer enable_query_expansion: type: boolean enable_rewrite: type: boolean fallback_prompt: type: string fallback_response: type: string fallback_strategy: description: Fallback strategy type: string keyword_threshold: type: number max_completion_tokens: description: MaxTokens is the maximum number of tokens to generate type: integer max_rounds: description: Retrieval & strategy parameters type: integer prompt: type: string rerank_model_id: type: string rerank_threshold: type: number rerank_top_k: type: integer rewrite_prompt_system: description: Rewrite prompts type: string rewrite_prompt_user: type: string summary_model_id: description: Model configuration type: string temperature: description: Temperature controls the randomness of the model output type: number use_custom_context_template: type: boolean use_custom_system_prompt: description: Prompt is the system prompt for normal mode type: boolean vector_threshold: type: number type: object github_com_Tencent_WeKnora_internal_types.EmbeddingParameters: properties: dimension: type: integer truncate_prompt_tokens: type: integer type: object github_com_Tencent_WeKnora_internal_types.ExtractConfig: properties: enabled: type: boolean nodes: items: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode' type: array relations: items: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation' type: array tags: items: type: string type: array text: type: string type: object github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload: properties: entries: items: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload' type: array knowledge_id: type: string mode: enum: - append - replace type: string required: - entries type: object github_com_Tencent_WeKnora_internal_types.FAQConfig: properties: index_mode: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode' question_index_mode: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode' type: object github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate: properties: by_id: additionalProperties: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate' description: ByID 按条目ID更新,key为条目ID type: object by_tag: additionalProperties: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate' description: ByTag 按Tag批量更新,key为TagID(空字符串表示未分类) type: object type: object github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate: properties: is_enabled: type: boolean is_recommended: type: boolean tag_id: type: string type: object github_com_Tencent_WeKnora_internal_types.FAQEntryPayload: properties: answer_strategy: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy' answers: items: type: string type: array is_enabled: type: boolean is_recommended: type: boolean negative_questions: items: type: string type: array similar_questions: items: type: string type: array standard_question: type: string tag_id: type: string tag_name: type: string required: - answers - standard_question type: object github_com_Tencent_WeKnora_internal_types.FAQIndexMode: enum: - question_only - question_answer type: string x-enum-varnames: - FAQIndexModeQuestionOnly - FAQIndexModeQuestionAnswer github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode: enum: - combined - separate type: string x-enum-varnames: - FAQQuestionIndexModeCombined - FAQQuestionIndexModeSeparate github_com_Tencent_WeKnora_internal_types.FAQSearchRequest: properties: match_count: type: integer query_text: type: string vector_threshold: type: number required: - query_text type: object github_com_Tencent_WeKnora_internal_types.FallbackStrategy: enum: - fixed - model type: string x-enum-comments: FallbackStrategyFixed: Fixed response FallbackStrategyModel: Model fallback response x-enum-descriptions: - Fixed response - Model fallback response x-enum-varnames: - FallbackStrategyFixed - FallbackStrategyModel github_com_Tencent_WeKnora_internal_types.GraphNode: properties: attributes: items: type: string type: array chunks: items: type: string type: array name: type: string type: object github_com_Tencent_WeKnora_internal_types.GraphRelation: properties: node1: type: string node2: type: string type: type: string type: object github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig: properties: model_id: description: Model ID type: string type: object github_com_Tencent_WeKnora_internal_types.Knowledge: properties: created_at: description: Creation time of the knowledge type: string deleted_at: allOf: - $ref: '#/definitions/gorm.DeletedAt' description: Deletion time of the knowledge description: description: Description of the knowledge type: string embedding_model_id: description: ID of the embedding model type: string enable_status: description: Enable status of the knowledge type: string error_message: description: Error message of the knowledge type: string file_hash: description: File hash of the knowledge type: string file_name: description: File name of the knowledge type: string file_path: description: File path of the knowledge type: string file_size: description: File size of the knowledge type: integer file_type: description: File type of the knowledge type: string id: description: Unique identifier of the knowledge type: string knowledge_base_id: description: ID of the knowledge base type: string metadata: description: Metadata of the knowledge items: type: integer type: array parse_status: description: Parse status of the knowledge type: string processed_at: description: Processed time of the knowledge type: string source: description: Source of the knowledge type: string storage_size: description: Storage size of the knowledge type: integer summary_status: description: Summary status for async summary generation type: string tag_id: description: Optional tag ID for categorization within a knowledge base type: string tenant_id: description: Tenant ID type: integer title: description: Title of the knowledge type: string type: description: Type of the knowledge type: string updated_at: description: Last updated time of the knowledge type: string type: object github_com_Tencent_WeKnora_internal_types.KnowledgeBase: properties: chunk_count: description: Chunk count (not stored in database, calculated on query) type: integer chunking_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig' description: Chunking configuration cos_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig' description: Storage config created_at: description: Creation time of the knowledge base type: string deleted_at: allOf: - $ref: '#/definitions/gorm.DeletedAt' description: Deletion time of the knowledge base description: description: Description of the knowledge base type: string embedding_model_id: description: ID of the embedding model type: string extract_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig' description: Extract config faq_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig' description: FAQConfig stores FAQ specific configuration such as indexing strategy id: description: Unique identifier of the knowledge base type: string image_processing_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig' description: Image processing configuration is_processing: description: IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases) type: boolean is_temporary: description: Whether this knowledge base is temporary (ephemeral) and should be hidden from UI type: boolean knowledge_count: description: Knowledge count (not stored in database, calculated on query) type: integer name: description: Name of the knowledge base type: string processing_count: description: ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases) type: integer question_generation_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig' description: QuestionGenerationConfig stores question generation configuration for document knowledge bases summary_model_id: description: Summary model ID type: string tenant_id: description: Tenant ID type: integer type: description: Type of the knowledge base (document, faq, etc.) type: string updated_at: description: Last updated time of the knowledge base type: string vlm_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig' description: VLM config type: object github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig: properties: chunking_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig' description: Chunking configuration faq_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig' description: FAQ configuration (only for FAQ type knowledge bases) image_processing_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig' description: Image processing configuration type: object github_com_Tencent_WeKnora_internal_types.LoginRequest: properties: email: type: string password: minLength: 6 type: string required: - email - password type: object github_com_Tencent_WeKnora_internal_types.LoginResponse: properties: message: type: string refresh_token: type: string success: type: boolean tenant: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant' token: type: string user: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User' type: object github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig: properties: retry_count: description: 'Number of retries, default: 3' type: integer retry_delay: description: 'Delay between retries in seconds, default: 1' type: integer timeout: description: 'Timeout in seconds, default: 30' type: integer type: object github_com_Tencent_WeKnora_internal_types.MCPAuthConfig: properties: api_key: type: string custom_headers: additionalProperties: type: string type: object token: type: string type: object github_com_Tencent_WeKnora_internal_types.MCPEnvVars: additionalProperties: type: string type: object github_com_Tencent_WeKnora_internal_types.MCPHeaders: additionalProperties: type: string type: object github_com_Tencent_WeKnora_internal_types.MCPService: properties: advanced_config: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig' auth_config: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig' created_at: type: string deleted_at: $ref: '#/definitions/gorm.DeletedAt' description: type: string enabled: type: boolean env_vars: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars' description: Environment variables for stdio headers: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders' id: type: string name: type: string stdio_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig' description: Required for stdio transport tenant_id: type: integer transport_type: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType' updated_at: type: string url: description: 'Optional: required for SSE/HTTP Streamable' type: string type: object github_com_Tencent_WeKnora_internal_types.MCPStdioConfig: properties: args: description: Command arguments array items: type: string type: array command: description: 'Command: "uvx" or "npx"' type: string type: object github_com_Tencent_WeKnora_internal_types.MCPTransportType: enum: - sse - http-streamable - stdio type: string x-enum-comments: MCPTransportHTTPStreamable: HTTP Streamable MCPTransportSSE: Server-Sent Events MCPTransportStdio: Stdio (Standard Input/Output) x-enum-descriptions: - Server-Sent Events - HTTP Streamable - Stdio (Standard Input/Output) x-enum-varnames: - MCPTransportSSE - MCPTransportHTTPStreamable - MCPTransportStdio github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload: properties: content: type: string status: type: string title: type: string type: object github_com_Tencent_WeKnora_internal_types.MatchType: enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 type: integer x-enum-comments: MatchTypeParentChunk: 父Chunk匹配类型 MatchTypeRelationChunk: 关系Chunk匹配类型 MatchTypeWebSearch: 网络搜索匹配类型 x-enum-descriptions: - "" - "" - "" - "" - 父Chunk匹配类型 - 关系Chunk匹配类型 - "" - 网络搜索匹配类型 x-enum-varnames: - MatchTypeEmbedding - MatchTypeKeywords - MatchTypeNearByChunk - MatchTypeHistory - MatchTypeParentChunk - MatchTypeRelationChunk - MatchTypeGraph - MatchTypeWebSearch github_com_Tencent_WeKnora_internal_types.Message: properties: agent_steps: description: |- Agent execution steps (only for assistant messages generated by agent) This contains the detailed reasoning process and tool calls made by the agent Stored for user history display, but NOT included in LLM context to avoid redundancy items: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep' type: array content: description: Message text content type: string created_at: description: Message creation timestamp type: string deleted_at: allOf: - $ref: '#/definitions/gorm.DeletedAt' description: Soft delete timestamp id: description: Unique identifier for the message type: string is_completed: description: Whether message generation is complete type: boolean knowledge_references: description: References to knowledge chunks used in the response items: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult' type: array request_id: description: Request identifier for tracking API requests type: string role: description: 'Message role: "user", "assistant", "system"' type: string session_id: description: ID of the session this message belongs to type: string updated_at: description: Last update timestamp type: string type: object github_com_Tencent_WeKnora_internal_types.ModelParameters: properties: api_key: type: string base_url: type: string embedding_parameters: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters' interface_type: type: string parameter_size: description: Ollama model parameter size (e.g., "7B", "13B", "70B") type: string type: object github_com_Tencent_WeKnora_internal_types.ModelSource: enum: - local - remote - aliyun type: string x-enum-comments: ModelSourceAliyun: Aliyun DashScope model ModelSourceLocal: Local model ModelSourceRemote: Remote model x-enum-descriptions: - Local model - Remote model - Aliyun DashScope model x-enum-varnames: - ModelSourceLocal - ModelSourceRemote - ModelSourceAliyun github_com_Tencent_WeKnora_internal_types.ModelType: enum: - Embedding - Rerank - KnowledgeQA - VLLM type: string x-enum-comments: ModelTypeEmbedding: Embedding model ModelTypeKnowledgeQA: KnowledgeQA model ModelTypeRerank: Rerank model ModelTypeVLLM: VLLM model x-enum-descriptions: - Embedding model - Rerank model - KnowledgeQA model - VLLM model x-enum-varnames: - ModelTypeEmbedding - ModelTypeRerank - ModelTypeKnowledgeQA - ModelTypeVLLM github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig: properties: enabled: type: boolean question_count: description: 'Number of questions to generate per chunk (default: 3, max: 10)' type: integer type: object github_com_Tencent_WeKnora_internal_types.RegisterRequest: properties: email: type: string password: minLength: 6 type: string username: maxLength: 50 minLength: 3 type: string required: - email - password - username type: object github_com_Tencent_WeKnora_internal_types.RegisterResponse: properties: message: type: string success: type: boolean tenant: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant' user: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User' type: object github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams: properties: retriever_engine_type: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType' description: Retriever engine type retriever_type: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType' description: Retriever type type: object github_com_Tencent_WeKnora_internal_types.RetrieverEngineType: enum: - postgres - elasticsearch - infinity - elasticfaiss - qdrant type: string x-enum-varnames: - PostgresRetrieverEngineType - ElasticsearchRetrieverEngineType - InfinityRetrieverEngineType - ElasticFaissRetrieverEngineType - QdrantRetrieverEngineType github_com_Tencent_WeKnora_internal_types.RetrieverEngines: properties: engines: items: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams' type: array type: object github_com_Tencent_WeKnora_internal_types.RetrieverType: enum: - keywords - vector - websearch type: string x-enum-comments: KeywordsRetrieverType: Keywords retriever VectorRetrieverType: Vector retriever WebSearchRetrieverType: Web search retriever x-enum-descriptions: - Keywords retriever - Vector retriever - Web search retriever x-enum-varnames: - KeywordsRetrieverType - VectorRetrieverType - WebSearchRetrieverType github_com_Tencent_WeKnora_internal_types.SearchParams: properties: disable_keywords_match: type: boolean disable_vector_match: type: boolean keyword_threshold: type: number match_count: type: integer query_text: type: string vector_threshold: type: number type: object github_com_Tencent_WeKnora_internal_types.SearchResult: properties: chunk_index: description: Chunk index type: integer chunk_metadata: description: ChunkMetadata stores chunk-level metadata (e.g., generated questions) items: type: integer type: array chunk_type: description: Chunk 类型 type: string content: description: Content type: string end_at: description: End at type: integer id: description: ID type: string image_info: description: 图片信息 (JSON 格式) type: string knowledge_filename: description: |- Knowledge file name Used for file type knowledge, contains the original file name type: string knowledge_id: description: Knowledge ID type: string knowledge_source: description: |- Knowledge source Used to indicate the source of the knowledge, such as "url" type: string knowledge_title: description: Knowledge title type: string match_type: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType' description: Match type metadata: additionalProperties: type: string description: Metadata type: object parent_chunk_id: description: 父 Chunk ID type: string score: description: Score type: number seq: description: Seq type: integer start_at: description: Start at type: integer sub_chunk_id: description: SubChunkIndex items: type: string type: array type: object github_com_Tencent_WeKnora_internal_types.Session: properties: agent_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SessionAgentConfig' description: Agent 配置(会话级别,仅存储enabled和knowledge_bases) context_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig' description: 上下文管理配置(可选) created_at: type: string deleted_at: $ref: '#/definitions/gorm.DeletedAt' description: description: Description type: string embedding_top_k: description: 向量召回TopK type: integer enable_rewrite: description: 多轮改写开关 type: boolean fallback_response: description: 固定回复内容 type: string fallback_strategy: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FallbackStrategy' description: 兜底策略 id: description: ID type: string keyword_threshold: description: 关键词召回阈值 type: number knowledge_base_id: description: Strategy configuration type: string max_rounds: description: 多轮保持轮数 type: integer rerank_model_id: description: 排序模型ID type: string rerank_threshold: description: 排序阈值 type: number rerank_top_k: description: 排序TopK type: integer summary_model_id: description: 总结模型ID type: string summary_parameters: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SummaryConfig' description: 总结模型参数 tenant_id: description: Tenant ID type: integer title: description: Title type: string updated_at: type: string vector_threshold: description: 向量召回阈值 type: number type: object github_com_Tencent_WeKnora_internal_types.SessionAgentConfig: properties: agent_mode_enabled: description: Whether agent mode is enabled for this session type: boolean knowledge_bases: description: Accessible knowledge base IDs for this session items: type: string type: array web_search_enabled: description: Whether web search is enabled for this session type: boolean type: object github_com_Tencent_WeKnora_internal_types.StorageConfig: properties: app_id: description: App ID type: string bucket_name: description: Bucket Name type: string path_prefix: description: Path Prefix type: string provider: description: Provider type: string region: description: Region type: string secret_id: description: Secret ID type: string secret_key: description: Secret Key type: string type: object github_com_Tencent_WeKnora_internal_types.SummaryConfig: properties: context_template: description: Context template type: string frequency_penalty: description: Frequency penalty type: number max_completion_tokens: description: Max completion tokens type: integer max_tokens: description: Max tokens type: integer no_match_prefix: description: No match prefix type: string presence_penalty: description: Presence penalty type: number prompt: description: Prompt type: string repeat_penalty: description: Repeat penalty type: number seed: description: Seed type: integer temperature: description: Temperature type: number top_k: description: TopK type: integer top_p: description: TopP type: number type: object github_com_Tencent_WeKnora_internal_types.Tenant: properties: agent_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentConfig' description: Global Agent configuration for this tenant (default for all sessions) api_key: description: API key type: string business: description: Business type: string context_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig' description: Global Context configuration for this tenant (default for all sessions) conversation_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ConversationConfig' description: Global Conversation configuration for this tenant (default for normal mode sessions) created_at: description: Creation time type: string deleted_at: allOf: - $ref: '#/definitions/gorm.DeletedAt' description: Deletion time description: description: Description type: string id: description: ID type: integer name: description: Name type: string retriever_engines: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines' description: Retriever engines status: description: Status type: string storage_quota: description: Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc. type: integer storage_used: description: Storage used (Bytes) type: integer updated_at: description: Last updated time type: string web_search_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig' description: Global WebSearch configuration for this tenant type: object github_com_Tencent_WeKnora_internal_types.ToolCall: properties: args: additionalProperties: true description: Tool arguments type: object duration: description: Execution time in milliseconds type: integer id: description: Function call ID from LLM type: string name: description: Tool name type: string reflection: description: Agent's reflection on this tool call result (if enabled) type: string result: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult' description: Execution result (contains Output) type: object github_com_Tencent_WeKnora_internal_types.ToolResult: properties: data: additionalProperties: true description: Structured data for programmatic use type: object error: description: Error message if execution failed type: string output: description: Human-readable output type: string success: description: Whether the tool executed successfully type: boolean type: object github_com_Tencent_WeKnora_internal_types.User: properties: avatar: description: Avatar URL of the user type: string can_access_all_tenants: description: Whether the user can access all tenants (cross-tenant access) type: boolean created_at: description: Creation time of the user type: string deleted_at: allOf: - $ref: '#/definitions/gorm.DeletedAt' description: Deletion time of the user email: description: Email address of the user type: string id: description: Unique identifier of the user type: string is_active: description: Whether the user is active type: boolean tenant: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant' description: Association relationship, not stored in the database tenant_id: description: Tenant ID that the user belongs to type: integer updated_at: description: Last updated time of the user type: string username: description: Username of the user type: string type: object github_com_Tencent_WeKnora_internal_types.VLMConfig: properties: api_key: description: API Key type: string base_url: description: Base URL type: string enabled: type: boolean interface_type: description: 'Interface Type: "ollama" or "openai"' type: string model_id: type: string model_name: description: |- 兼容老版本 Model Name type: string type: object github_com_Tencent_WeKnora_internal_types.WebSearchConfig: properties: api_key: description: API密钥(如果需要) type: string blacklist: description: 黑名单规则列表 items: type: string type: array compression_method: description: 压缩方法:none, summary, extract, rag type: string document_fragments: description: 文档片段数量(用于RAG压缩) type: integer embedding_dimension: description: 嵌入维度(用于RAG压缩) type: integer embedding_model_id: description: RAG压缩相关配置 type: string include_date: description: 是否包含日期 type: boolean max_results: description: 最大搜索结果数 type: integer provider: description: 搜索引擎提供商ID type: string rerank_model_id: description: 重排模型ID(用于RAG压缩) type: string type: object gorm.DeletedAt: properties: time: type: string valid: description: Valid is true if Time is not NULL type: boolean type: object internal_handler.CopyKnowledgeBaseRequest: properties: source_id: type: string target_id: type: string required: - source_id type: object internal_handler.CreateModelRequest: properties: description: type: string name: type: string parameters: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters' source: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource' type: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType' required: - name - parameters - source - type type: object internal_handler.EvaluationRequest: properties: chat_id: description: ID of chat model to use type: string dataset_id: description: ID of dataset to evaluate type: string knowledge_base_id: description: ID of knowledge base to use type: string rerank_id: description: ID of rerank model to use type: string type: object internal_handler.FabriTextRequest: properties: llm_config: $ref: '#/definitions/internal_handler.LLMConfig' tags: items: type: string type: array type: object internal_handler.GetSystemInfoResponse: properties: build_time: type: string commit_id: type: string go_version: type: string graph_database_engine: type: string keyword_index_engine: type: string minio_enabled: type: boolean vector_store_engine: type: string version: type: string type: object internal_handler.KBModelConfigRequest: properties: documentSplitting: description: 文档分块配置 properties: chunkOverlap: type: integer chunkSize: type: integer separators: items: type: string type: array type: object embeddingModelId: type: string llmModelId: type: string multimodal: description: 多模态配置 properties: cos: properties: appId: type: string bucketName: type: string pathPrefix: type: string region: type: string secretId: type: string secretKey: type: string type: object enabled: type: boolean minio: properties: bucketName: type: string pathPrefix: type: string useSSL: type: boolean type: object storageType: description: '"cos" or "minio"' type: string type: object nodeExtract: description: 知识图谱配置 properties: enabled: type: boolean nodes: items: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode' type: array relations: items: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation' type: array tags: items: type: string type: array text: type: string type: object questionGeneration: description: 问题生成配置 properties: enabled: type: boolean questionCount: type: integer type: object vlm_config: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig' required: - embeddingModelId - llmModelId type: object internal_handler.LLMConfig: properties: api_key: type: string base_url: type: string model_name: type: string source: type: string type: object internal_handler.RemoteModelCheckRequest: properties: apiKey: type: string baseUrl: type: string modelName: type: string required: - baseUrl - modelName type: object internal_handler.TextRelationExtractionRequest: properties: llm_config: $ref: '#/definitions/internal_handler.LLMConfig' tags: items: type: string type: array text: type: string required: - tags - text type: object internal_handler.UpdateChunkRequest: properties: chunk_index: type: integer content: type: string embedding: items: type: number type: array end_at: type: integer image_info: type: string is_enabled: type: boolean start_at: type: integer type: object internal_handler.UpdateKnowledgeBaseRequest: properties: config: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig' description: type: string name: type: string required: - config - name type: object internal_handler.UpdateModelRequest: properties: description: type: string name: type: string parameters: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters' source: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource' type: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType' type: object internal_handler_session.CreateKnowledgeQARequest: properties: agent_enabled: description: Whether agent mode is enabled for this request type: boolean knowledge_base_ids: description: Selected knowledge base ID for this request items: type: string type: array query: description: Query text for knowledge base search type: string summary_model_id: description: Optional summary model ID for this request (overrides session default) type: string web_search_enabled: description: Whether web search is enabled for this request type: boolean required: - query type: object internal_handler_session.CreateSessionRequest: properties: agent_config: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SessionAgentConfig' description: 'Agent configuration (optional, session-level config only: enabled and knowledge_bases)' knowledge_base_id: description: ID of the associated knowledge base (optional, can be set/changed during queries) type: string session_strategy: allOf: - $ref: '#/definitions/internal_handler_session.SessionStrategy' description: Session strategy configuration type: object internal_handler_session.GenerateTitleRequest: properties: messages: description: Messages to use as context for title generation items: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Message' type: array required: - messages type: object internal_handler_session.SearchKnowledgeRequest: properties: knowledge_base_id: description: ID of the knowledge base to search type: string query: description: Query text to search for type: string required: - knowledge_base_id - query type: object internal_handler_session.SessionStrategy: properties: embedding_top_k: description: Number of top results to retrieve from vector search type: integer enable_rewrite: description: Whether to enable query rewrite for multi-round conversations type: boolean fallback_response: description: Fixed response content for fallback type: string fallback_strategy: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FallbackStrategy' description: Strategy to use when no relevant knowledge is found keyword_threshold: description: Threshold for keyword-based retrieval type: number max_rounds: description: Maximum number of conversation rounds to maintain type: integer no_match_prefix: description: Prefix for responses when no match is found type: string rerank_model_id: description: ID of the model used for reranking results type: string rerank_threshold: description: Threshold for reranking results type: number rerank_top_k: description: Number of top results after reranking type: integer summary_model_id: description: ID of the model used for summarization type: string summary_parameters: allOf: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SummaryConfig' description: Parameters for the summary model vector_threshold: description: Threshold for vector-based retrieval type: number type: object internal_handler_session.StopSessionRequest: properties: message_id: type: string required: - message_id type: object host: localhost:8080 info: contact: name: WeKnora Github url: https://github.com/Tencent/WeKnora description: WeKnora 知识库管理系统 API 文档 termsOfService: http://swagger.io/terms/ title: WeKnora API version: "1.0" paths: /api/v1/web-search/providers: get: consumes: - application/json description: Returns the list of available web search providers from configuration produces: - application/json responses: "200": description: List of providers schema: additionalProperties: true type: object summary: Get available web search providers tags: - web-search /auth/change-password: post: consumes: - application/json description: 修改当前用户的登录密码 parameters: - description: 密码修改请求 in: body name: request required: true schema: properties: new_password: type: string old_password: type: string type: object produces: - application/json responses: "200": description: 修改成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 修改密码 tags: - 认证 /auth/login: post: consumes: - application/json description: 用户登录并获取访问令牌 parameters: - description: 登录请求参数 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse' "401": description: 认证失败 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' summary: 用户登录 tags: - 认证 /auth/logout: post: consumes: - application/json description: 撤销当前访问令牌并登出 produces: - application/json responses: "200": description: 登出成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 用户登出 tags: - 认证 /auth/me: get: consumes: - application/json description: 获取当前登录用户的详细信息 produces: - application/json responses: "200": description: 用户信息 schema: additionalProperties: true type: object "401": description: 未授权 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取当前用户信息 tags: - 认证 /auth/refresh: post: consumes: - application/json description: 使用刷新令牌获取新的访问令牌 parameters: - description: 刷新令牌 in: body name: request required: true schema: properties: refreshToken: type: string type: object produces: - application/json responses: "200": description: 新令牌 schema: additionalProperties: true type: object "401": description: 令牌无效 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' summary: 刷新令牌 tags: - 认证 /auth/register: post: consumes: - application/json description: 注册新用户账号 parameters: - description: 注册请求参数 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterResponse' "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' summary: 用户注册 tags: - 认证 /auth/validate: get: consumes: - application/json description: 验证访问令牌是否有效 produces: - application/json responses: "200": description: 令牌有效 schema: additionalProperties: true type: object "401": description: 令牌无效 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 验证令牌 tags: - 认证 /chunks/{knowledge_id}: delete: consumes: - application/json description: 删除指定知识下的所有分块 parameters: - description: 知识ID in: path name: knowledge_id required: true type: string produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 删除知识下所有分块 tags: - 分块管理 get: consumes: - application/json description: 获取指定知识下的所有分块列表,支持分页 parameters: - description: 知识ID in: path name: knowledge_id required: true type: string - default: 1 description: 页码 in: query name: page type: integer - default: 10 description: 每页数量 in: query name: page_size type: integer produces: - application/json responses: "200": description: 分块列表 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取知识分块列表 tags: - 分块管理 /chunks/{knowledge_id}/{id}: delete: consumes: - application/json description: 删除指定的分块 parameters: - description: 知识ID in: path name: knowledge_id required: true type: string - description: 分块ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' "404": description: 分块不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 删除分块 tags: - 分块管理 put: consumes: - application/json description: 更新指定分块的内容和属性 parameters: - description: 知识ID in: path name: knowledge_id required: true type: string - description: 分块ID in: path name: id required: true type: string - description: 更新请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler.UpdateChunkRequest' produces: - application/json responses: "200": description: 更新后的分块 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' "404": description: 分块不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新分块 tags: - 分块管理 /chunks/by-id/{id}: get: consumes: - application/json description: 仅通过分块ID获取分块详情(不需要knowledge_id) parameters: - description: 分块ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 分块详情 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' "404": description: 分块不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 通过ID获取分块 tags: - 分块管理 /chunks/by-id/{id}/questions: delete: consumes: - application/json description: 删除分块中生成的问题 parameters: - description: 分块ID in: path name: id required: true type: string - description: 问题ID in: body name: request required: true schema: properties: question_id: type: string type: object produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' "404": description: 分块不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 删除生成的问题 tags: - 分块管理 /evaluation/: get: consumes: - application/json description: 根据任务ID获取评估结果 parameters: - description: 评估任务ID in: query name: task_id required: true type: string produces: - application/json responses: "200": description: 评估结果 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取评估结果 tags: - 评估 post: consumes: - application/json description: 对知识库进行评估测试 parameters: - description: 评估请求参数 in: body name: request required: true schema: $ref: '#/definitions/internal_handler.EvaluationRequest' produces: - application/json responses: "200": description: 评估任务 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 执行评估 tags: - 评估 /initialization/extract/relations: post: consumes: - application/json description: 从文本中提取实体和关系 parameters: - description: 提取请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler.TextRelationExtractionRequest' produces: - application/json responses: "200": description: 提取结果 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 提取文本关系 tags: - 初始化 /initialization/fabri/tag: get: consumes: - application/json description: 随机生成一组标签 produces: - application/json responses: "200": description: 生成的标签 schema: additionalProperties: true type: object summary: 生成随机标签 tags: - 初始化 /initialization/fabri/text: post: consumes: - application/json description: 根据标签生成示例文本 parameters: - description: 生成请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler.FabriTextRequest' produces: - application/json responses: "200": description: 生成的文本 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 生成示例文本 tags: - 初始化 /initialization/kb/{kbId}: post: consumes: - application/json description: 根据知识库ID执行完整配置更新 parameters: - description: 知识库ID in: path name: kbId required: true type: string - description: 初始化请求 in: body name: request required: true schema: type: object produces: - application/json responses: "200": description: 初始化成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 初始化知识库配置 tags: - 初始化 /initialization/kb/{kbId}/config: get: consumes: - application/json description: 根据知识库ID获取当前配置信息 parameters: - description: 知识库ID in: path name: kbId required: true type: string produces: - application/json responses: "200": description: 配置信息 schema: additionalProperties: true type: object "404": description: 知识库不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取知识库配置 tags: - 初始化 put: consumes: - application/json description: 根据知识库ID更新模型和分块配置 parameters: - description: 知识库ID in: path name: kbId required: true type: string - description: 配置请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler.KBModelConfigRequest' produces: - application/json responses: "200": description: 更新成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' "404": description: 知识库不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新知识库配置 tags: - 初始化 /initialization/models/embedding/test: post: consumes: - application/json description: 测试Embedding接口是否可用并返回向量维度 parameters: - description: Embedding测试请求 in: body name: request required: true schema: type: object produces: - application/json responses: "200": description: 测试结果 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 测试Embedding模型 tags: - 初始化 /initialization/models/remote/check: post: consumes: - application/json description: 检查远程API模型连接是否正常 parameters: - description: 模型检查请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler.RemoteModelCheckRequest' produces: - application/json responses: "200": description: 检查结果 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 检查远程模型 tags: - 初始化 /initialization/models/rerank/check: post: consumes: - application/json description: 检查Rerank模型连接和功能是否正常 parameters: - description: Rerank检查请求 in: body name: request required: true schema: type: object produces: - application/json responses: "200": description: 检查结果 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 检查Rerank模型 tags: - 初始化 /initialization/multimodal/test: post: consumes: - multipart/form-data description: 上传图片测试多模态处理功能 parameters: - description: 测试图片 in: formData name: image required: true type: file - description: VLM模型名称 in: formData name: vlm_model required: true type: string - description: VLM Base URL in: formData name: vlm_base_url required: true type: string - description: VLM API Key in: formData name: vlm_api_key type: string - description: VLM接口类型 in: formData name: vlm_interface_type type: string - description: 存储类型(cos/minio) in: formData name: storage_type required: true type: string produces: - application/json responses: "200": description: 测试结果 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 测试多模态功能 tags: - 初始化 /initialization/ollama/download/{taskId}: get: consumes: - application/json description: 获取Ollama模型下载任务的进度 parameters: - description: 任务ID in: path name: taskId required: true type: string produces: - application/json responses: "200": description: 下载进度 schema: additionalProperties: true type: object "404": description: 任务不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取下载进度 tags: - 初始化 /initialization/ollama/download/tasks: get: consumes: - application/json description: 列出所有Ollama模型下载任务 produces: - application/json responses: "200": description: 任务列表 schema: additionalProperties: true type: object security: - Bearer: [] summary: 列出下载任务 tags: - 初始化 /initialization/ollama/models: get: consumes: - application/json description: 列出已安装的Ollama模型 produces: - application/json responses: "200": description: 模型列表 schema: additionalProperties: true type: object "500": description: 服务器错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 列出Ollama模型 tags: - 初始化 /initialization/ollama/models/check: post: consumes: - application/json description: 检查指定的Ollama模型是否已安装 parameters: - description: 模型名称列表 in: body name: request required: true schema: properties: models: items: type: string type: array type: object produces: - application/json responses: "200": description: 模型状态 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 检查Ollama模型状态 tags: - 初始化 /initialization/ollama/models/download: post: consumes: - application/json description: 异步下载指定的Ollama模型 parameters: - description: 模型名称 in: body name: request required: true schema: properties: modelName: type: string type: object produces: - application/json responses: "200": description: 下载任务信息 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 下载Ollama模型 tags: - 初始化 /initialization/ollama/status: get: consumes: - application/json description: 检查Ollama服务是否可用 produces: - application/json responses: "200": description: Ollama状态 schema: additionalProperties: true type: object summary: 检查Ollama服务状态 tags: - 初始化 /knowledge-bases: get: consumes: - application/json description: 获取当前租户的所有知识库 produces: - application/json responses: "200": description: 知识库列表 schema: additionalProperties: true type: object "500": description: 服务器错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取知识库列表 tags: - 知识库 post: consumes: - application/json description: 创建新的知识库 parameters: - description: 知识库信息 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase' produces: - application/json responses: "201": description: 创建的知识库 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 创建知识库 tags: - 知识库 /knowledge-bases/{id}: delete: consumes: - application/json description: 删除指定的知识库及其所有内容 parameters: - description: 知识库ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 删除知识库 tags: - 知识库 get: consumes: - application/json description: 根据ID获取知识库详情 parameters: - description: 知识库ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 知识库详情 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' "404": description: 知识库不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取知识库详情 tags: - 知识库 put: consumes: - application/json description: 更新知识库的名称、描述和配置 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 更新请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler.UpdateKnowledgeBaseRequest' produces: - application/json responses: "200": description: 更新后的知识库 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新知识库 tags: - 知识库 /knowledge-bases/{id}/faq/entries: delete: consumes: - application/json description: 批量删除指定的FAQ条目 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 要删除的FAQ ID列表 in: body name: request required: true schema: properties: ids: items: type: string type: array type: object produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 批量删除FAQ条目 tags: - FAQ管理 get: consumes: - application/json description: 获取知识库下的FAQ条目列表,支持分页和筛选 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 页码 in: query name: page type: integer - description: 每页数量 in: query name: page_size type: integer - description: 标签ID筛选 in: query name: tag_id type: string - description: 关键词搜索 in: query name: keyword type: string produces: - application/json responses: "200": description: FAQ列表 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取FAQ条目列表 tags: - FAQ管理 post: consumes: - application/json description: 异步批量更新或插入FAQ条目 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 批量操作请求 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload' produces: - application/json responses: "200": description: 任务ID schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 批量更新/插入FAQ条目 tags: - FAQ管理 /knowledge-bases/{id}/faq/entries/{entry_id}: put: consumes: - application/json description: 更新指定的FAQ条目 parameters: - description: 知识库ID in: path name: id required: true type: string - description: FAQ条目ID in: path name: entry_id required: true type: string - description: FAQ条目 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload' produces: - application/json responses: "200": description: 更新成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新FAQ条目 tags: - FAQ管理 /knowledge-bases/{id}/faq/entries/export: get: consumes: - application/json description: 将所有FAQ条目导出为CSV文件 parameters: - description: 知识库ID in: path name: id required: true type: string produces: - text/csv responses: "200": description: CSV文件 schema: type: file "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 导出FAQ条目 tags: - FAQ管理 /knowledge-bases/{id}/faq/entries/fields: put: consumes: - application/json description: 批量更新FAQ条目的多个字段(is_enabled, is_recommended, tag_id) parameters: - description: 知识库ID in: path name: id required: true type: string - description: 字段更新请求 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate' produces: - application/json responses: "200": description: 更新成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 批量更新FAQ字段 tags: - FAQ管理 /knowledge-bases/{id}/faq/entries/tags: put: consumes: - application/json description: 批量更新FAQ条目的标签 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 标签更新请求 in: body name: request required: true schema: type: object produces: - application/json responses: "200": description: 更新成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 批量更新FAQ标签 tags: - FAQ管理 /knowledge-bases/{id}/faq/entry: post: consumes: - application/json description: 同步创建单个FAQ条目 parameters: - description: 知识库ID in: path name: id required: true type: string - description: FAQ条目 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload' produces: - application/json responses: "200": description: 创建的FAQ条目 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 创建单个FAQ条目 tags: - FAQ管理 /knowledge-bases/{id}/faq/search: post: consumes: - application/json description: 使用混合搜索在FAQ中搜索 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 搜索请求 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest' produces: - application/json responses: "200": description: 搜索结果 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 搜索FAQ tags: - FAQ管理 /knowledge-bases/{id}/hybrid-search: get: consumes: - application/json description: 在知识库中执行向量和关键词混合搜索 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 搜索参数 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SearchParams' produces: - application/json responses: "200": description: 搜索结果 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 混合搜索 tags: - 知识库 /knowledge-bases/{id}/knowledge: get: consumes: - application/json description: 获取知识库下的知识列表,支持分页和筛选 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 页码 in: query name: page type: integer - description: 每页数量 in: query name: page_size type: integer - description: 标签ID筛选 in: query name: tag_id type: string - description: 关键词搜索 in: query name: keyword type: string - description: 文件类型筛选 in: query name: file_type type: string produces: - application/json responses: "200": description: 知识列表 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取知识列表 tags: - 知识管理 /knowledge-bases/{id}/knowledge/file: post: consumes: - multipart/form-data description: 上传文件并创建知识条目 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 上传的文件 in: formData name: file required: true type: file - description: 自定义文件名 in: formData name: fileName type: string - description: 元数据JSON in: formData name: metadata type: string - description: 启用多模态处理 in: formData name: enable_multimodel type: boolean produces: - application/json responses: "200": description: 创建的知识 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' "409": description: 文件重复 schema: additionalProperties: true type: object security: - Bearer: [] summary: 从文件创建知识 tags: - 知识管理 /knowledge-bases/{id}/knowledge/manual: post: consumes: - application/json description: 手工录入Markdown格式的知识内容 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 手工知识内容 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload' produces: - application/json responses: "200": description: 创建的知识 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 手工创建知识 tags: - 知识管理 /knowledge-bases/{id}/knowledge/url: post: consumes: - application/json description: 从指定URL抓取内容并创建知识条目 parameters: - description: 知识库ID in: path name: id required: true type: string - description: URL请求 in: body name: request required: true schema: properties: enable_multimodel: type: boolean title: type: string url: type: string type: object produces: - application/json responses: "201": description: 创建的知识 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' "409": description: URL重复 schema: additionalProperties: true type: object security: - Bearer: [] summary: 从URL创建知识 tags: - 知识管理 /knowledge-bases/{id}/tags: get: consumes: - application/json description: 获取知识库下的所有标签及统计信息 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 页码 in: query name: page type: integer - description: 每页数量 in: query name: page_size type: integer - description: 关键词搜索 in: query name: keyword type: string produces: - application/json responses: "200": description: 标签列表 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取标签列表 tags: - 标签管理 post: consumes: - application/json description: 在知识库下创建新标签 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 标签信息 in: body name: request required: true schema: properties: color: type: string name: type: string sort_order: type: integer type: object produces: - application/json responses: "200": description: 创建的标签 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 创建标签 tags: - 标签管理 /knowledge-bases/{id}/tags/{tag_id}: delete: consumes: - application/json description: 删除标签,可使用force=true强制删除被引用的标签 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 标签ID in: path name: tag_id required: true type: string - description: 强制删除 in: query name: force type: boolean produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 删除标签 tags: - 标签管理 put: consumes: - application/json description: 更新标签信息 parameters: - description: 知识库ID in: path name: id required: true type: string - description: 标签ID in: path name: tag_id required: true type: string - description: 标签更新信息 in: body name: request required: true schema: type: object produces: - application/json responses: "200": description: 更新后的标签 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新标签 tags: - 标签管理 /knowledge-bases/copy: post: consumes: - application/json description: 将一个知识库的内容复制到另一个知识库 parameters: - description: 复制请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler.CopyKnowledgeBaseRequest' produces: - application/json responses: "200": description: 复制成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 复制知识库 tags: - 知识库 /knowledge/{id}: delete: consumes: - application/json description: 根据ID删除知识条目 parameters: - description: 知识ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 删除知识 tags: - 知识管理 get: consumes: - application/json description: 根据ID获取知识条目详情 parameters: - description: 知识ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 知识详情 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' "404": description: 知识不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取知识详情 tags: - 知识管理 put: consumes: - application/json description: 更新知识条目信息 parameters: - description: 知识ID in: path name: id required: true type: string - description: 知识信息 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge' produces: - application/json responses: "200": description: 更新成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新知识 tags: - 知识管理 /knowledge/{id}/download: get: consumes: - application/json description: 下载知识条目关联的原始文件 parameters: - description: 知识ID in: path name: id required: true type: string produces: - application/octet-stream responses: "200": description: 文件内容 schema: type: file "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 下载知识文件 tags: - 知识管理 /knowledge/batch: get: consumes: - application/json description: 根据ID列表批量获取知识条目 parameters: - collectionFormat: csv description: 知识ID列表 in: query items: type: string name: ids required: true type: array produces: - application/json responses: "200": description: 知识列表 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 批量获取知识 tags: - 知识管理 /knowledge/image/{id}/{chunk_id}: put: consumes: - application/json description: 更新知识分块的图像信息 parameters: - description: 知识ID in: path name: id required: true type: string - description: 分块ID in: path name: chunk_id required: true type: string - description: 图像信息 in: body name: request required: true schema: properties: image_info: type: string type: object produces: - application/json responses: "200": description: 更新成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新图像信息 tags: - 知识管理 /knowledge/manual/{id}: put: consumes: - application/json description: 更新手工录入的Markdown知识内容 parameters: - description: 知识ID in: path name: id required: true type: string - description: 手工知识内容 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload' produces: - application/json responses: "200": description: 更新后的知识 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新手工知识 tags: - 知识管理 /knowledge/tags: put: consumes: - application/json description: 批量更新知识条目的标签 parameters: - description: 标签更新请求 in: body name: request required: true schema: type: object produces: - application/json responses: "200": description: 更新成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 批量更新知识标签 tags: - 知识管理 /mcp-services: get: consumes: - application/json description: 获取当前租户的所有MCP服务 produces: - application/json responses: "200": description: MCP服务列表 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取MCP服务列表 tags: - MCP服务 post: consumes: - application/json description: 创建新的MCP服务配置 parameters: - description: MCP服务配置 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPService' produces: - application/json responses: "200": description: 创建的MCP服务 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 创建MCP服务 tags: - MCP服务 /mcp-services/{id}: delete: consumes: - application/json description: 删除指定的MCP服务 parameters: - description: MCP服务ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "500": description: 服务器错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 删除MCP服务 tags: - MCP服务 get: consumes: - application/json description: 根据ID获取MCP服务详情 parameters: - description: MCP服务ID in: path name: id required: true type: string produces: - application/json responses: "200": description: MCP服务详情 schema: additionalProperties: true type: object "404": description: 服务不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取MCP服务详情 tags: - MCP服务 put: consumes: - application/json description: 更新MCP服务配置 parameters: - description: MCP服务ID in: path name: id required: true type: string - description: 更新字段 in: body name: request required: true schema: type: object produces: - application/json responses: "200": description: 更新后的MCP服务 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新MCP服务 tags: - MCP服务 /mcp-services/{id}/resources: get: consumes: - application/json description: 获取MCP服务提供的资源列表 parameters: - description: MCP服务ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 资源列表 schema: additionalProperties: true type: object "500": description: 服务器错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取MCP服务资源列表 tags: - MCP服务 /mcp-services/{id}/test: post: consumes: - application/json description: 测试MCP服务是否可以正常连接 parameters: - description: MCP服务ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 测试结果 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 测试MCP服务连接 tags: - MCP服务 /mcp-services/{id}/tools: get: consumes: - application/json description: 获取MCP服务提供的工具列表 parameters: - description: MCP服务ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 工具列表 schema: additionalProperties: true type: object "500": description: 服务器错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取MCP服务工具列表 tags: - MCP服务 /messages/{session_id}/{id}: delete: consumes: - application/json description: 从会话中删除指定消息 parameters: - description: 会话ID in: path name: session_id required: true type: string - description: 消息ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "500": description: 服务器错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 删除消息 tags: - 消息 /messages/{session_id}/load: get: consumes: - application/json description: 加载会话的消息历史,支持分页和时间筛选 parameters: - description: 会话ID in: path name: session_id required: true type: string - default: 20 description: 返回数量 in: query name: limit type: integer - description: 在此时间之前的消息(RFC3339Nano格式) in: query name: before_time type: string produces: - application/json responses: "200": description: 消息列表 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 加载消息历史 tags: - 消息 /models: get: consumes: - application/json description: 获取当前租户的所有模型 produces: - application/json responses: "200": description: 模型列表 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取模型列表 tags: - 模型管理 post: consumes: - application/json description: 创建新的模型配置 parameters: - description: 模型信息 in: body name: request required: true schema: $ref: '#/definitions/internal_handler.CreateModelRequest' produces: - application/json responses: "201": description: 创建的模型 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 创建模型 tags: - 模型管理 /models/{id}: delete: consumes: - application/json description: 删除指定的模型 parameters: - description: 模型ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "404": description: 模型不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 删除模型 tags: - 模型管理 get: consumes: - application/json description: 根据ID获取模型详情 parameters: - description: 模型ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 模型详情 schema: additionalProperties: true type: object "404": description: 模型不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取模型详情 tags: - 模型管理 put: consumes: - application/json description: 更新模型配置信息 parameters: - description: 模型ID in: path name: id required: true type: string - description: 更新信息 in: body name: request required: true schema: $ref: '#/definitions/internal_handler.UpdateModelRequest' produces: - application/json responses: "200": description: 更新后的模型 schema: additionalProperties: true type: object "404": description: 模型不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新模型 tags: - 模型管理 /sessions: get: consumes: - application/json description: 获取当前租户的会话列表,支持分页 parameters: - description: 页码 in: query name: page type: integer - description: 每页数量 in: query name: page_size type: integer produces: - application/json responses: "200": description: 会话列表 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取会话列表 tags: - 会话 post: consumes: - application/json description: 创建新的对话会话 parameters: - description: 会话创建请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler_session.CreateSessionRequest' produces: - application/json responses: "201": description: 创建的会话 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 创建会话 tags: - 会话 /sessions/{id}: delete: consumes: - application/json description: 删除指定的会话 parameters: - description: 会话ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "404": description: 会话不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 删除会话 tags: - 会话 get: consumes: - application/json description: 根据ID获取会话详情 parameters: - description: 会话ID in: path name: id required: true type: string produces: - application/json responses: "200": description: 会话详情 schema: additionalProperties: true type: object "404": description: 会话不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取会话详情 tags: - 会话 put: consumes: - application/json description: 更新会话属性 parameters: - description: 会话ID in: path name: id required: true type: string - description: 会话信息 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Session' produces: - application/json responses: "200": description: 更新后的会话 schema: additionalProperties: true type: object "404": description: 会话不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新会话 tags: - 会话 /sessions/{session_id}/agent-qa: post: consumes: - application/json description: 基于Agent的智能问答,支持多轮对话和SSE流式响应 parameters: - description: 会话ID in: path name: session_id required: true type: string - description: 问答请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler_session.CreateKnowledgeQARequest' produces: - text/event-stream responses: "200": description: 问答结果(SSE流) schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: Agent问答 tags: - 问答 /sessions/{session_id}/continue: get: consumes: - application/json description: 继续获取正在进行的流式响应 parameters: - description: 会话ID in: path name: session_id required: true type: string - description: 消息ID in: query name: message_id required: true type: string produces: - text/event-stream responses: "200": description: 流式响应 schema: additionalProperties: true type: object "404": description: 会话或消息不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 继续流式响应 tags: - 问答 /sessions/{session_id}/knowledge-qa: post: consumes: - application/json description: 基于知识库的问答(使用LLM总结),支持SSE流式响应 parameters: - description: 会话ID in: path name: session_id required: true type: string - description: 问答请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler_session.CreateKnowledgeQARequest' produces: - text/event-stream responses: "200": description: 问答结果(SSE流) schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 知识问答 tags: - 问答 /sessions/{session_id}/stop: post: consumes: - application/json description: 停止当前正在进行的生成任务 parameters: - description: 会话ID in: path name: session_id required: true type: string - description: 停止请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler_session.StopSessionRequest' produces: - application/json responses: "200": description: 停止成功 schema: additionalProperties: true type: object "404": description: 会话或消息不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 停止生成 tags: - 问答 /sessions/{session_id}/title: post: consumes: - application/json description: 根据消息内容自动生成会话标题 parameters: - description: 会话ID in: path name: session_id required: true type: string - description: 生成请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler_session.GenerateTitleRequest' produces: - application/json responses: "200": description: 生成的标题 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 生成会话标题 tags: - 会话 /sessions/search: post: consumes: - application/json description: 在知识库中搜索(不使用LLM总结) parameters: - description: 搜索请求 in: body name: request required: true schema: $ref: '#/definitions/internal_handler_session.SearchKnowledgeRequest' produces: - application/json responses: "200": description: 搜索结果 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 知识搜索 tags: - 问答 /system/info: get: consumes: - application/json description: 获取系统版本、构建信息和引擎配置 produces: - application/json responses: "200": description: 系统信息 schema: $ref: '#/definitions/internal_handler.GetSystemInfoResponse' summary: 获取系统信息 tags: - 系统 /tenants: get: consumes: - application/json description: 获取当前用户可访问的租户列表 produces: - application/json responses: "200": description: 租户列表 schema: additionalProperties: true type: object "500": description: 服务器错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取租户列表 tags: - 租户管理 post: consumes: - application/json description: 创建新的租户 parameters: - description: 租户信息 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant' produces: - application/json responses: "201": description: 创建的租户 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 创建租户 tags: - 租户管理 /tenants/{id}: delete: consumes: - application/json description: 删除指定的租户 parameters: - description: 租户ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: 删除成功 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 删除租户 tags: - 租户管理 get: consumes: - application/json description: 根据ID获取租户详情 parameters: - description: 租户ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: 租户详情 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' "404": description: 租户不存在 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取租户详情 tags: - 租户管理 put: consumes: - application/json description: 更新租户信息 parameters: - description: 租户ID in: path name: id required: true type: integer - description: 租户信息 in: body name: request required: true schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant' produces: - application/json responses: "200": description: 更新后的租户 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新租户 tags: - 租户管理 /tenants/all: get: consumes: - application/json description: 获取系统中所有租户(需要跨租户访问权限) produces: - application/json responses: "200": description: 所有租户列表 schema: additionalProperties: true type: object "403": description: 权限不足 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取所有租户列表 tags: - 租户管理 /tenants/kv/{key}: get: consumes: - application/json description: 获取租户级别的KV配置(支持agent-config、web-search-config、conversation-config) parameters: - description: 配置键名 in: path name: key required: true type: string produces: - application/json responses: "200": description: 配置值 schema: additionalProperties: true type: object "400": description: 不支持的键 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取租户KV配置 tags: - 租户管理 put: consumes: - application/json description: 更新租户级别的KV配置(支持agent-config、web-search-config、conversation-config) parameters: - description: 配置键名 in: path name: key required: true type: string - description: 配置值 in: body name: request required: true schema: type: object produces: - application/json responses: "200": description: 更新成功 schema: additionalProperties: true type: object "400": description: 不支持的键 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 更新租户KV配置 tags: - 租户管理 /tenants/kv/agent-config: get: consumes: - application/json description: 获取租户的全局Agent配置(默认应用于所有会话) produces: - application/json responses: "200": description: Agent配置 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取租户Agent配置 tags: - 租户管理 /tenants/kv/conversation-config: get: consumes: - application/json description: 获取租户的全局对话配置(默认应用于普通模式会话) produces: - application/json responses: "200": description: 对话配置 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取租户对话配置 tags: - 租户管理 /tenants/kv/web-search-config: get: consumes: - application/json description: 获取租户的网络搜索配置 produces: - application/json responses: "200": description: 网络搜索配置 schema: additionalProperties: true type: object "400": description: 请求参数错误 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 获取租户网络搜索配置 tags: - 租户管理 /tenants/search: get: consumes: - application/json description: 分页搜索租户(需要跨租户访问权限) parameters: - description: 搜索关键词 in: query name: keyword type: string - description: 租户ID筛选 in: query name: tenant_id type: integer - default: 1 description: 页码 in: query name: page type: integer - default: 20 description: 每页数量 in: query name: page_size type: integer produces: - application/json responses: "200": description: 搜索结果 schema: additionalProperties: true type: object "403": description: 权限不足 schema: $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError' security: - Bearer: [] summary: 搜索租户 tags: - 租户管理 securityDefinitions: Bearer: description: 输入 Bearer {token} 格式的 JWT 令牌 in: header name: Authorization type: apiKey swagger: "2.0"