> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kuqoi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 知识库搜索

> 搜索知识库



## OpenAPI

````yaml POST /pub/42000401/gpt/knowledge/search
openapi: 3.0.1
info:
  title: OpenAPI
  description: ''
  version: 1.0.0
servers:
  - url: https://apaas.apaas.mypaas.com/
    description: 开发环境
security: []
tags: []
paths:
  /pub/42000401/gpt/knowledge/search:
    post:
      tags: []
      summary: 知识库搜索
      description: 搜索知识库
      parameters:
        - name: tenantCode
          in: header
          description: 租户编码
          required: true
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
            example: ''
      responses:
        '200':
          description: plant response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '400':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      deprecated: false
components:
  schemas:
    SearchRequest:
      type: object
      properties:
        knowledgeCode:
          type: string
          title: 编码
        topK:
          type: integer
          title: 数量
        input:
          type: string
          title: 问题
        context:
          $ref: '#/components/schemas/Context'
          title: 上下文
      x-apifox-orders:
        - knowledgeCode
        - topK
        - input
        - context
      x-apifox-ignore-properties: []
      x-apifox-folder: Schemas
    SearchResponse:
      type: object
      properties:
        success:
          description: The name of the plant
          type: boolean
        tag:
          description: Tag to specify the type
          type: string
      x-apifox-orders:
        - success
        - tag
      x-apifox-ignore-properties: []
      x-apifox-folder: Schemas
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
      x-apifox-orders:
        - error
        - message
      x-apifox-ignore-properties: []
      x-apifox-folder: Schemas
    Context:
      type: object
      properties:
        userCode:
          description: 用户编码
          type: string
        userName:
          description: 用户名称
          type: string
        appCode:
          description: 系统编码
          type: string
        appName:
          description: 系统名称
          type: string
        moduleCode:
          description: 模块名称
          type: string
        moduleName:
          description: 模块名称
          type: string
      x-apifox-orders:
        - userCode
        - userName
        - appCode
        - appName
        - moduleCode
        - moduleName
      x-apifox-ignore-properties: []
      x-apifox-folder: Schemas

````