---
title: "AI20 Life Science Large Model"
method: POST
path: "/chat/pharm-gpt-stream"
tags: ["Patsnap LLM"]
---

# AI20 Life Science Large Model

`POST /chat/pharm-gpt-stream`

## Request

- Base URL: `https://connect.patsnap.com`
- URL: `https://connect.patsnap.com/chat/pharm-gpt-stream`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/patsnap/apis/patsnap-open-platform-api/docs/chat/pharm-gpt-stream/post.ts> (a function with typed inputs; its response is checked against the schema)

Hiro-LS API supports inquiries related to the pharmaceutical competitive landscape, clinical trials and evidence-based medicine, sequence/compound patents, as well as policies and regulartions issues. The biopharmaceutical large model (Hiro-LS) aims to perform intelligent retrieval, analysis, and data mining in response to these questions, providing continuously evolving biopharmaceutical information to create limitless opportunities for exploration in life sciences.

## Request body `text/event-stream`

- AI20ChatPharmGptStreamRequest
  - `query` string, required: User question Note: No more than 500 character.
  - `session_id` string: Session ID is a unique identifier used to identify a single conversation or a multi-turn dialogue. Note: When multiple rounds of dialogue are required, this field is a mandatory parameter. The session_id from the previous round of dialogue and the query for the second round must be included as input parameters.

## Response `200`

Successful ai20 life science large model response.

- AI20ChatPharmGptStreamResponse
  - `data` AI20ChatPharmGptStreamAiPharmGptResponse
    - `output` AI20ChatPharmGptStreamAiPharmGptOutPut
      - `usage` AI20ChatPharmGptStreamAiPatGptUsage
        - `input_tokens` integer: The length of the user's question after tokenization.
        - `total_tokens` integer: The total length of tokens consumed after the model invocation is complete.
        - `output_tokens` integer: The length of the text generated by the model after tokenization.
      - `status` string: Model Return Status Note: When status = "running", the system is outputting via SSE, When status = "finished", the request has ended, When status = "length", the generated content exceeds the model's maximum length.
      - `content` string: Conversation result
      - `references` AI20ChatPharmGptStreamRefdocInfo[]: Cited literature Note: Only when status = "finished" will the request end and return the cited literature content, that is ref_doc,
        - `link` string: Hyperlink
        - `text` string: Related text
        - `type` string: Text type
        - `index` integer: Corresponding index number, indicating the sequence number of the GPT-generated text for that reference
        - `doc_id` string: Citation ID
        - `doc_type` string: Literature type
        - `post_date` integer: Publication date of the literature
        - `text_summary` string: Summary of the related text
      - `session_id` string: Session ID, which is a unique identifier for a single or multiple rounds of dialogue
  - `status` boolean, required: Status
  - `error_msg` string: Error Message
  - `error_code` integer, required: Error Code

---

[API](https://skmtc.dev/patsnap/apis/patsnap-open-platform-api.md) - [All operations](https://skmtc.dev/patsnap/apis/patsnap-open-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/patsnap/apis/patsnap-open-platform-api/revisions/c2264a0de595?raw)
