Patsnap Bio-Pharma Encyclopedia Q&A API

Bio-Pharma Encyclopedia Q&A APIs.

OpenAPI Specification

patsnap-bio-pharma-encyclopedia-q-a-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Patsnap Open Platform AI Translation Bio-Pharma Encyclopedia Q&A API
  version: 1.0.0
  description: OpenAPI specification for Patsnap Open Platform APIs, including patent search, analytics, and Eureka AI capabilities.
servers:
- url: https://connect.patsnap.com
  description: Patsnap Open Platform API gateway
tags:
- name: Bio-Pharma Encyclopedia Q&A
  description: Bio-Pharma Encyclopedia Q&A APIs.
paths:
  /chat/ai-ls-chat:
    post:
      operationId: ai68-1ChatAiLsChat
      summary: AI68-1 Hiro LS Researcher-Create
      description: 'This interface is used to initialize an Biomedical Encyclopedia Q&A chat session, obtain chat ID and chat item ID, as well as related reference document information. Usage flow: first call this interface to get chatId and chatItemId, then use these IDs to call the streaming interface to get AI responses.'
      tags:
      - Bio-Pharma Encyclopedia Q&A
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Successful ai68-1 hiro ls researcher-create response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AI68-1ChatAiLsChatResponse'
      externalDocs:
        description: API Reference documentation
        url: https://open.patsnap.com/devportal/api-reference/chat/ai-ls-chat
      requestBody:
        required: true
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/AI68-1ChatAiLsChatRequest'
  /chat/ai-ls-stream:
    post:
      operationId: ai68-2ChatAiLsStream
      summary: AI68-2 Hiro LS Researcher-Obtain Result
      description: This interface supports inputting questions related to biomedicine. The Biomedical Encyclopedia Q&A aims to intelligently retrieve, analyze, and mine data in response to the posed questions, providing relevant biomedical knowledge, concept explanations, and encyclopedia information.
      tags:
      - Bio-Pharma Encyclopedia Q&A
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Successful ai68-2 hiro ls researcher-obtain result response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AI68-2ChatAiLsStreamResponse'
      externalDocs:
        description: API Reference documentation
        url: https://open.patsnap.com/devportal/api-reference/chat/ai-ls-stream
      requestBody:
        required: true
        content:
          text/event-stream:
            schema:
              $ref: '#/components/schemas/AI68-2ChatAiLsStreamRequest'
components:
  schemas:
    AI68-1ChatAiLsChat_EurekalsChatRefDoc:
      type: object
      properties:
        link:
          type: string
          example: <cn>https://zhuanlan.zhihu.com/p/391356908</cn><us>https://zhuanlan.zhihu.com/p/391356908</us>
          description: Document link address
        text:
          type: string
          example: <cn>2021年中国EGFR抑制剂行业分析报告-市场格局现状与未来前景研究</cn><us>2021 China EGFR Inhibitor Industry Analysis Report - Market Structure Status and Future Prospects Research</us>
          description: Document text content
        type:
          type: string
          example: <cn>web-site</cn><us>web-site</us>
          description: Document type
        index:
          type: string
          example: 1
          description: Document Index
        post_time:
          type: string
          example: <cn>20210720</cn><us>20210720</us>
          description: Post time
        _text_display:
          type: string
          example: <cn>2021年中国EGFR抑制剂行业分析报告-市场格局现状与未来前景研究</cn><us>2021 China EGFR Inhibitor Industry Analysis Report - Market Structure Status and Future Prospects Research</us>
          description: Text display content
        doc_type_detail:
          type: string
          example: <cn>zhihu</cn><us>zhihu</us>
          description: Document type detail
    AI68-2ChatAiLsStream_EurekalsChatResponse:
      type: object
      properties:
        usage:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatUsage'
        chat_id:
          type: string
          example: <cn>019ae7682af371d991f228fc8eac9ada</cn><us>019ae7682af371d991f228fc8eac9ada</us>
          description: Chat ID
        choices:
          type: array
          example: 'Please check the form: EurekalsChatChoice'
          description: Choices list
          items:
            $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatChoice'
        chat_item_id:
          type: string
          example: <cn>322d39265d444c53b8ad6d1b3a70974a</cn><us>322d39265d444c53b8ad6d1b3a70974a</us>
          description: Chat item ID
        system_fingerprint:
          type: string
          example: <cn></cn><us></us>
          description: System fingerprint
    AI68-1ChatAiLsChat_EurekalsChatFlagResponse:
      type: object
      properties:
        chat_id:
          type: string
          example: <cn>019ae7682af371d991f228fc8eac9ada</cn><us>019ae7682af371d991f228fc8eac9ada</us>
          description: Chat ID
        ref_doc:
          type: array
          example: 'Please check the form: EurekalsChatRefDoc'
          description: Reference document list, containing related document reference information
          items:
            $ref: '#/components/schemas/AI68-1ChatAiLsChat_EurekalsChatRefDoc'
        chat_item_id:
          type: string
          example: <cn>322d39265d444c53b8ad6d1b3a70974a</cn><us>322d39265d444c53b8ad6d1b3a70974a</us>
          description: Chat item ID
    AI68-2ChatAiLsStream_EurekalsChatCompletionTokensDetails:
      type: object
      properties:
        audio_tokens:
          type: integer
          format: int32
          example: <cn>0</cn><us>0</us>
          description: Audio tokens
        reasoning_tokens:
          type: integer
          format: int32
          example: <cn>2338</cn><us>2338</us>
          description: Reasoning tokens
        accepted_prediction_tokens:
          type: integer
          format: int32
          example: <cn>0</cn><us>0</us>
          description: Accepted prediction tokens
        rejected_prediction_tokens:
          type: integer
          format: int32
          example: <cn>0</cn><us>0</us>
          description: Rejected prediction tokens
    AI68-1ChatAiLsChatResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/AI68-1ChatAiLsChat_EurekalsChatFlagResponse'
        status:
          type: boolean
          example: 'false'
          description: Status
        error_msg:
          type: string
          example: The request parameter format is incorrect!
          description: Error Message
        error_code:
          type: integer
          example: '0'
          description: Error Code
      required:
      - status
      - error_code
    AI68-2ChatAiLsStream_EurekalsChatUsage:
      type: object
      properties:
        image_tokens:
          type: integer
          format: int32
          example: <cn>0</cn><us>0</us>
          description: Image tokens
        total_tokens:
          type: integer
          format: int32
          example: <cn>15529</cn><us>15529</us>
          description: Total tokens
        prompt_tokens:
          type: integer
          format: int32
          example: <cn>12476</cn><us>12476</us>
          description: Prompt tokens
        thinking_tokens:
          type: integer
          format: int32
          example: <cn>0</cn><us>0</us>
          description: Thinking tokens
        completion_tokens:
          type: integer
          format: int32
          example: <cn>3053</cn><us>3053</us>
          description: Completion tokens
        prompt_tokens_details:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatPromptTokensDetails'
        completion_tokens_details:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatCompletionTokensDetails'
    AI68-2ChatAiLsStream_EurekalsChatChoice:
      type: object
      properties:
        delta:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatDelta'
        index:
          type: integer
          format: int32
          example: <cn>0</cn><us>0</us>
          description: Index
        finish_reason:
          type: string
          example: <cn>stop</cn><us>stop</us>
          description: Finish reason
        content_filter_results:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatContentFilterResults'
    AI68-2ChatAiLsStreamRequest:
      type: object
      properties:
        chat_id:
          type: string
          example: a4a14dcbc26849b3a5bb338acb4ceccc
          description: Chat ID
        chat_item_id:
          type: string
          example: 52347f9d260a48438a1fb122f593c12f
          description: Chat item ID
      required:
      - chat_id
      - chat_item_id
    AI68-1ChatAiLsChatRequest:
      type: object
      properties:
        data_source:
          type: integer
          format: int32
          example: <cn>1</cn><us>1</us>
          description: "data source     1: all\n     2: paper\n     3: patent\n     4: clinical trials\n     5: fda label\n     6: financial report\n     7: clinical guideline\n     8: epidemiology"
        deep_search:
          type: boolean
          example: false
          description: deep think
        long_think:
          type: boolean
          example: false
          description: long think
        query:
          type: string
          example: <cn>药物RMC6236的PK/PD数据有哪些?</cn><us>What is the data of the drug RMC6236?</us>
          description: User question
        search_website:
          type: boolean
          example: false
          description: search website
      required:
      - deep_search
      - long_think
      - query
      - search_website
    AI68-2ChatAiLsStream_EurekalsChatDelta:
      type: object
      properties:
        role:
          type: string
          example: <cn>assistant</cn><us>assistant</us>
          description: Role
        content:
          type: string
          example: <cn>EGFR已经成为非小细胞肺癌治疗的主要靶点之一。全球非小细胞肺癌患者的EGFR基因平均突变率约为35%,中国非小细胞肺癌患者的EGFR基因突变率约为40%。</cn><us>EGFR has become one of the main targets for non-small cell lung cancer treatment. The average EGFR gene mutation rate in global non-small cell lung cancer patients is about 35%, and the EGFR gene mutation rate in Chinese non-small cell lung cancer patients is about 40%.</us>
          description: Content
    AI68-2ChatAiLsStream_EurekalsChatFilterResult:
      type: object
      properties:
        detected:
          type: boolean
          example: false
          description: Whether detected
        filtered:
          type: boolean
          example: false
          description: Whether filtered
    AI68-2ChatAiLsStreamResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatResponse'
        status:
          type: boolean
          example: 'false'
          description: Status
        error_msg:
          type: string
          example: The request parameter format is incorrect!
          description: Error Message
        error_code:
          type: integer
          example: '0'
          description: Error Code
      required:
      - status
      - error_code
    AI68-2ChatAiLsStream_EurekalsChatContentFilterResults:
      type: object
      properties:
        hate:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatFilterResult'
        sexual:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatFilterResult'
        violence:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatFilterResult'
        jailbreak:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatFilterResult'
        profanity:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatFilterResult'
        self_harm:
          $ref: '#/components/schemas/AI68-2ChatAiLsStream_EurekalsChatFilterResult'
    AI68-2ChatAiLsStream_EurekalsChatPromptTokensDetails:
      type: object
      properties:
        audio_tokens:
          type: integer
          format: int32
          example: <cn>0</cn><us>0</us>
          description: Audio tokens
        cached_tokens:
          type: integer
          format: int32
          example: <cn>0</cn><us>0</us>
          description: Cached tokens
        cache_read_tokens:
          type: integer
          format: int32
          example: <cn>0</cn><us>0</us>
          description: Cache read tokens
        cached_creation_tokens:
          type: integer
          format: int32
          example: <cn>0</cn><us>0</us>
          description: Cached creation tokens
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer