sidebar_position: 1
A complete reference for RAGFlow’s RESTful API. Before proceeding, please ensure you have your RAGFlow API key ready for authentication.
POST /api/v1/datasets
Creates a dataset.
/api/v1/datasets'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"name": string"avatar": string"description": string"language": string"embedding_model": string"permission": string"chunk_method": string"parser_config": objectcurl --request POST \
     --url http://{address}/api/v1/datasets \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '{
      "name": "test_1"
      }'
"name": (Body parameter), string, Required
The unique name of the dataset to create. It must adhere to the following requirements:
"avatar": (Body parameter), string
Base64 encoding of the avatar.
"description": (Body parameter), string
A brief description of the dataset to create.
"language": (Body parameter), string
The language setting of the dataset to create. Available options:
"English" (default)"Chinese""embedding_model": (Body parameter), string
The name of the embedding model to use. For example: "BAAI/bge-zh-v1.5"
"permission": (Body parameter), string
Specifies who can access the dataset to create. Available options:
"me": (Default) Only you can manage the dataset."team": All team members can manage the dataset."chunk_method": (Body parameter), enum<string>
The chunking method of the dataset to create. Available options:
"naive": General (default)"manual": Manual"qa": Q&A"table": Table"paper": Paper"book": Book"laws": Laws"presentation": Presentation"picture": Picture"one": One"knowledge_graph": Knowledge Graph"email": Email"parser_config": (Body parameter), object
The configuration settings for the dataset parser. The attributes in this JSON object vary with the selected "chunk_method":
"chunk_method" is "naive", the "parser_config" object contains the following attributes:"chunk_token_count": Defaults to 128."layout_recognize": Defaults to true."html4excel": Indicates whether to convert Excel documents into HTML format. Defaults to false."delimiter": Defaults to "\n!?。;!?"."task_page_size": Defaults to 12. For PDF only."raptor": Raptor-specific settings. Defaults to: {"use_raptor": false}."chunk_method" is "qa", "manuel", "paper", "book", "laws", or "presentation", the "parser_config" object contains the following attribute:"raptor": Raptor-specific settings. Defaults to: {"use_raptor": false}."chunk_method" is "table", "picture", "one", or "email", "parser_config" is an empty JSON object."chunk_method" is "knowledge_graph", the "parser_config" object contains the following attributes:"chunk_token_count": Defaults to 128."delimiter": Defaults to "\n!?。;!?"."entity_types": Defaults to ["organization","person","location","event","time"]Success:
{
    "code": 0,
    "data": {
        "avatar": null,
        "chunk_count": 0,
        "chunk_method": "naive",
        "create_date": "Thu, 24 Oct 2024 09:14:07 GMT",
        "create_time": 1729761247434,
        "created_by": "69736c5e723611efb51b0242ac120007",
        "description": null,
        "document_count": 0,
        "embedding_model": "BAAI/bge-large-zh-v1.5",
        "id": "527fa74891e811ef9c650242ac120006",
        "language": "English",
        "name": "test_1",
        "parser_config": {
            "chunk_token_num": 128,
            "delimiter": "\\n!?;。;!?",
            "html4excel": false,
            "layout_recognize": true,
            "raptor": {
                "user_raptor": false
            }
        },
        "permission": "me",
        "similarity_threshold": 0.2,
        "status": "1",
        "tenant_id": "69736c5e723611efb51b0242ac120007",
        "token_num": 0,
        "update_date": "Thu, 24 Oct 2024 09:14:07 GMT",
        "update_time": 1729761247434,
        "vector_similarity_weight": 0.3
    }
}
Failure:
{
    "code": 102,
    "message": "Duplicated knowledgebase name in creating dataset."
}
DELETE /api/v1/datasets
Deletes datasets by ID.
/api/v1/datasets'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"ids": list[string]curl --request DELETE \
     --url http://{address}/api/v1/datasets \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '{
     "ids": ["test_1", "test_2"]
     }'
"ids": (Body parameter), list[string]Success:
{
    "code": 0 
}
Failure:
{
    "code": 102,
    "message": "You don't own the dataset."
}
PUT /api/v1/datasets/{dataset_id}
Updates configurations for a specified dataset.
/api/v1/datasets/{dataset_id}'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"name": string"embedding_model": string"chunk_method": enum<string>curl --request PUT \
     --url http://{address}/api/v1/datasets/{dataset_id} \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "name": "updated_dataset"
     }'
dataset_id: (Path parameter)"name": (Body parameter), string"embedding_model": (Body parameter), string"chunk_count" is 0 before updating "embedding_model"."chunk_method": (Body parameter), enum<string>"naive": General"manual: Manual"qa": Q&A"table": Table"paper": Paper"book": Book"laws": Laws"presentation": Presentation"picture": Picture"one":One"email": Email"knowledge_graph": Knowledge GraphSuccess:
{
    "code": 0 
}
Failure:
{
    "code": 102,
    "message": "Can't change tenant_id."
}
GET /api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}
Lists datasets.
/api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}'Authorization: Bearer <YOUR_API_KEY>'curl --request GET \
     --url http://{address}/api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \
     --header 'Authorization: Bearer <YOUR_API_KEY>'
page: (Filter parameter)1.page_size: (Filter parameter)30.orderby: (Filter parameter)create_time (default)update_timedesc: (Filter parameter)true.name: (Filter parameter)id: (Filter parameter)Success:
{
    "code": 0,
    "data": [
        {
            "avatar": "",
            "chunk_count": 59,
            "create_date": "Sat, 14 Sep 2024 01:12:37 GMT",
            "create_time": 1726276357324,
            "created_by": "69736c5e723611efb51b0242ac120007",
            "description": null,
            "document_count": 1,
            "embedding_model": "BAAI/bge-large-zh-v1.5",
            "id": "6e211ee0723611efa10a0242ac120007",
            "language": "English",
            "name": "mysql",
            "chunk_method": "knowledge_graph",
            "parser_config": {
                "chunk_token_num": 8192,
                "delimiter": "\\n!?;。;!?",
                "entity_types": [
                    "organization",
                    "person",
                    "location",
                    "event",
                    "time"
                ]
            },
            "permission": "me",
            "similarity_threshold": 0.2,
            "status": "1",
            "tenant_id": "69736c5e723611efb51b0242ac120007",
            "token_num": 12744,
            "update_date": "Thu, 10 Oct 2024 04:07:23 GMT",
            "update_time": 1728533243536,
            "vector_similarity_weight": 0.3
        }
    ]
}
Failure:
{
    "code": 102,
    "message": "The dataset doesn't exist"
}
POST /api/v1/datasets/{dataset_id}/documents
Uploads documents to a specified dataset.
/api/v1/datasets/{dataset_id}/documents'Content-Type: multipart/form-data''Authorization: Bearer <YOUR_API_KEY>''file=@{FILE_PATH}'curl --request POST \
     --url http://{address}/api/v1/datasets/{dataset_id}/documents \
     --header 'Content-Type: multipart/form-data' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \     
     --form 'file=@./test1.txt' \
     --form 'file=@./test2.pdf'
dataset_id: (Path parameter)'file': (Body parameter)Success:
{
    "code": 0,
    "data": [
        {
            "chunk_method": "naive",
            "created_by": "69736c5e723611efb51b0242ac120007",
            "dataset_id": "527fa74891e811ef9c650242ac120006",
            "id": "b330ec2e91ec11efbc510242ac120004",
            "location": "1.txt",
            "name": "1.txt",
            "parser_config": {
                "chunk_token_num": 128,
                "delimiter": "\\n!?;。;!?",
                "html4excel": false,
                "layout_recognize": true,
                "raptor": {
                    "user_raptor": false
                }
            },
            "run": "UNSTART",
            "size": 17966,
            "thumbnail": "",
            "type": "doc"
        }
    ]
}
Failure:
{
    "code": 101,
    "message": "No file part!"
}
PUT /api/v1/datasets/{dataset_id}/documents/{document_id}
Updates configurations for a specified document.
/api/v1/datasets/{dataset_id}/documents/{document_id}'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"name":string"chunk_method":string"parser_config":objectcurl --request PUT \
     --url http://{address}/api/v1/datasets/{dataset_id}/info/{document_id} \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --header 'Content-Type: application/json' \
     --data '
     {
          "name": "manual.txt", 
          "chunk_method": "manual", 
          "parser_config": {"chunk_token_count": 128}
     }'
dataset_id: (Path parameter)document_id: (Path parameter)"name": (Body parameter), string"chunk_method": (Body parameter), string"naive": General"manual: Manual"qa": Q&A"table": Table"paper": Paper"book": Book"laws": Laws"presentation": Presentation"picture": Picture"one": One"knowledge_graph": Knowledge Graph"email": Email"parser_config": (Body parameter), object"chunk_method":"chunk_method" is "naive", the "parser_config" object contains the following attributes:"chunk_token_count": Defaults to 128."layout_recognize": Defaults to true."html4excel": Indicates whether to convert Excel documents into HTML format. Defaults to false."delimiter": Defaults to "\n!?。;!?"."task_page_size": Defaults to 12. For PDF only."raptor": Raptor-specific settings. Defaults to: {"use_raptor": false}."chunk_method" is "qa", "manuel", "paper", "book", "laws", or "presentation", the "parser_config" object contains the following attribute:"raptor": Raptor-specific settings. Defaults to: {"use_raptor": false}."chunk_method" is "table", "picture", "one", or "email", "parser_config" is an empty JSON object."chunk_method" is "knowledge_graph", the "parser_config" object contains the following attributes:"chunk_token_count": Defaults to 128."delimiter": Defaults to "\n!?。;!?"."entity_types": Defaults to ["organization","person","location","event","time"]Success:
{
    "code": 0
}
Failure:
{
    "code": 102,
    "message": "The dataset does not have the document."
}
GET /api/v1/datasets/{dataset_id}/documents/{document_id}
Downloads a document from a specified dataset.
/api/v1/datasets/{dataset_id}/documents/{document_id}'Authorization: Bearer <YOUR_API_KEY>''{PATH_TO_THE_FILE}'curl --request GET \
     --url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id} \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --output ./ragflow.txt
dataset_id: (Path parameter)documents_id: (Path parameter)Success:
This is a test to verify the file download feature.
Failure:
{
    "code": 102,
    "message": "You do not own the dataset 7898da028a0511efbf750242ac1220005."
}
GET /api/v1/datasets/{dataset_id}/documents?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&keywords={keywords}&id={document_id}&name={document_name}
Lists documents in a specified dataset.
/api/v1/datasets/{dataset_id}/documents?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&keywords={keywords}&id={document_id}&name={document_name}'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'curl --request GET \
     --url http://{address}/api/v1/datasets/{dataset_id}/documents?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&keywords={keywords}&id={document_id}&name={document_name} \
     --header 'Authorization: Bearer <YOUR_API_KEY>'
dataset_id: (Path parameter)keywords: (Filter parameter), stringpage: (Filter parameter), integer
Specifies the page on which the documents will be displayed. Defaults to 1.page_size: (Filter parameter), integer30.orderby: (Filter parameter), stringcreate_time (default)update_timedesc: (Filter parameter), booleantrue.id: (Filter parameter), stringSuccess:
{
    "code": 0,
    "data": {
        "docs": [
            {
                "chunk_count": 0,
                "create_date": "Mon, 14 Oct 2024 09:11:01 GMT",
                "create_time": 1728897061948,
                "created_by": "69736c5e723611efb51b0242ac120007",
                "id": "3bcfbf8a8a0c11ef8aba0242ac120006",
                "knowledgebase_id": "7898da028a0511efbf750242ac120005",
                "location": "Test_2.txt",
                "name": "Test_2.txt",
                "parser_config": {
                    "chunk_token_count": 128,
                    "delimiter": "\n!?。;!?",
                    "layout_recognize": true,
                    "task_page_size": 12
                },
                "chunk_method": "naive",
                "process_begin_at": null,
                "process_duation": 0.0,
                "progress": 0.0,
                "progress_msg": "",
                "run": "0",
                "size": 7,
                "source_type": "local",
                "status": "1",
                "thumbnail": null,
                "token_count": 0,
                "type": "doc",
                "update_date": "Mon, 14 Oct 2024 09:11:01 GMT",
                "update_time": 1728897061948
            }
        ],
        "total": 1
    }
}
Failure:
{
    "code": 102,
    "message": "You don't own the dataset 7898da028a0511efbf750242ac1220005. "
}
DELETE /api/v1/datasets/{dataset_id}/documents
Deletes documents by ID.
/api/v1/datasets/{dataset_id}/documents'Content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"ids": list[string]curl --request DELETE \
     --url http://{address}/api/v1/datasets/{dataset_id}/documents \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "ids": ["id_1","id_2"]
     }'
dataset_id: (Path parameter)"ids": (Body parameter), list[string]Success:
{
    "code": 0
}.
Failure:
{
    "code": 102,
    "message": "You do not own the dataset 7898da028a0511efbf750242ac1220005."
}
POST /api/v1/datasets/{dataset_id}/chunks
Parses documents in a specified dataset.
/api/v1/datasets/{dataset_id}/chunks'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"document_ids": list[string]curl --request POST \
     --url http://{address}/api/v1/datasets/{dataset_id}/chunks \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"]
     }'
dataset_id: (Path parameter)"document_ids": (Body parameter), list[string], RequiredSuccess:
{
    "code": 0
}
Failure:
{
    "code": 102,
    "message": "`document_ids` is required"
}
DELETE /api/v1/datasets/{dataset_id}/chunks
Stops parsing specified documents.
/api/v1/datasets/{dataset_id}/chunks'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"document_ids": list[string]curl --request DELETE \
     --url http://{address}/api/v1/datasets/{dataset_id}/chunks \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"]
     }'
dataset_id: (Path parameter)"document_ids": (Body parameter), list[string], RequiredSuccess:
{
    "code": 0
}
Failure:
{
    "code": 102,
    "message": "`document_ids` is required"
}
POST /api/v1/datasets/{dataset_id}/documents/{document_id}/chunks
Adds a chunk to a specified document in a specified dataset.
/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"content": string"important_keywords": list[string]curl --request POST \
     --url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "content": "<CHUNK_CONTENT_HERE>"
     }'
dataset_id: (Path parameter)document_ids: (Path parameter)"content": (Body parameter), string, Required"important_keywords(Body parameter), list[string]Success:
{
    "code": 0,
    "data": {
        "chunk": {
            "content": "ragflow content",
            "create_time": "2024-10-16 08:05:04",
            "create_timestamp": 1729065904.581025,
            "dataset_id": [
                "c7ee74067a2c11efb21c0242ac120006"
            ],
            "document_id": "5c5999ec7be811ef9cab0242ac120005",
            "id": "d78435d142bd5cf6704da62c778795c5",
            "important_keywords": []
        }
    }
}
Failure:
{
    "code": 102,
    "message": "`content` is required"
}
GET /api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&page={page}&page_size={page_size}&id={id}
Lists chunks in a specified document.
/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&page={page}&page_size={page_size}&id={chunk_id}'Authorization: Bearer <YOUR_API_KEY>'curl --request GET \
     --url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&page={page}&page_size={page_size}&id={chunk_id} \
     --header 'Authorization: Bearer <YOUR_API_KEY>' 
dataset_id: (Path parameter)document_ids: (Path parameter)keywords(Filter parameter), stringpage(Filter parameter), integer1.page_size(Filter parameter), integer1024.id(Filter parameter), stringSuccess:
{
    "code": 0,
    "data": {
        "chunks": [
            {
                "available_int": 1,
                "content": "This is a test content.",
                "docnm_kwd": "1.txt",
                "document_id": "b330ec2e91ec11efbc510242ac120004",
                "id": "b48c170e90f70af998485c1065490726",
                "image_id": "",
                "important_keywords": "",
                "positions": [
                    ""
                ]
            }
        ],
        "doc": {
            "chunk_count": 1,
            "chunk_method": "naive",
            "create_date": "Thu, 24 Oct 2024 09:45:27 GMT",
            "create_time": 1729763127646,
            "created_by": "69736c5e723611efb51b0242ac120007",
            "dataset_id": "527fa74891e811ef9c650242ac120006",
            "id": "b330ec2e91ec11efbc510242ac120004",
            "location": "1.txt",
            "name": "1.txt",
            "parser_config": {
                "chunk_token_num": 128,
                "delimiter": "\\n!?;。;!?",
                "html4excel": false,
                "layout_recognize": true,
                "raptor": {
                    "user_raptor": false
                }
            },
            "process_begin_at": "Thu, 24 Oct 2024 09:56:44 GMT",
            "process_duation": 0.54213,
            "progress": 0.0,
            "progress_msg": "Task dispatched...",
            "run": "2",
            "size": 17966,
            "source_type": "local",
            "status": "1",
            "thumbnail": "",
            "token_count": 8,
            "type": "doc",
            "update_date": "Thu, 24 Oct 2024 11:03:15 GMT",
            "update_time": 1729767795721
        },
        "total": 1
    }
}
Failure:
{
    "code": 102,
    "message": "You don't own the document 5c5999ec7be811ef9cab0242ac12000e5."
}
DELETE /api/v1/datasets/{dataset_id}/documents/{document_id}/chunks
Deletes chunks by ID.
/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"chunk_ids": list[string]curl --request DELETE \
     --url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "chunk_ids": ["test_1", "test_2"]
     }'
dataset_id: (Path parameter)document_ids: (Path parameter)"chunk_ids": (Body parameter), list[string]Success:
{
    "code": 0
}
Failure:
{
    "code": 102,
    "message": "`chunk_ids` is required"
}
PUT /api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}
Updates content or configurations for a specified chunk.
/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"content": string"important_keywords": list[string]"available": booleancurl --request PUT \
     --url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id} \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {   
          "content": "ragflow123",  
          "important_keywords": []  
     }'
dataset_id: (Path parameter)document_ids: (Path parameter)chunk_id: (Path parameter)"content": (Body parameter), string"important_keywords": (Body parameter), list[string]"available": (Body parameter) booleantrue: Available (default)false: UnavailableSuccess:
{
    "code": 0
}
Failure:
{
    "code": 102,
    "message": "Can't find this chunk 29a2d9987e16ba331fb4d7d30d99b71d2"
}
POST /api/v1/retrieval
Retrieves chunks from specified datasets.
/api/v1/retrieval'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"question": string"dataset_ids": list[string]"document_ids": list[string]"page": integer"page_size": integer"similarity_threshold": float"vector_similarity_weight": float"top_k": integer"rerank_id": string"keyword": boolean"highlight": booleancurl --request POST \
     --url http://{address}/api/v1/retrieval \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "question": "What is advantage of ragflow?",
          "dataset_ids": ["b2a62730759d11ef987d0242ac120004"],
          "document_ids": ["77df9ef4759a11ef8bdd0242ac120004"]
     }'
"question": (Body parameter), string, Required"dataset_ids": (Body parameter) list[string]"document_ids"."document_ids": (Body parameter), list[string]"dataset_ids"."page": (Body parameter), integer1."page_size": (Body parameter)30."similarity_threshold": (Body parameter)0.2."vector_similarity_weight": (Body parameter), float0.3. If x represents the weight of vector cosine similarity, then (1 - x) is the term similarity weight."top_k": (Body parameter), integer1024."rerank_id": (Body parameter), integer"keyword": (Body parameter), booleantrue: Enable keyword-based matching.false: Disable keyword-based matching (default)."highlight": (Body parameter), booleantrue: Enable highlighting of matched terms.false: Disable highlighting of matched terms (default).Success:
{
    "code": 0,
    "data": {
        "chunks": [
            {
                "content": "ragflow content",
                "content_ltks": "ragflow content",
                "document_id": "5c5999ec7be811ef9cab0242ac120005",
                "document_keyword": "1.txt",
                "highlight": "<em>ragflow</em> content",
                "id": "d78435d142bd5cf6704da62c778795c5",
                "image_id": "",
                "important_keywords": [
                    ""
                ],
                "kb_id": "c7ee74067a2c11efb21c0242ac120006",
                "positions": [
                    ""
                ],
                "similarity": 0.9669436601210759,
                "term_similarity": 1.0,
                "vector_similarity": 0.8898122004035864
            }
        ],
        "doc_aggs": [
            {
                "count": 1,
                "doc_id": "5c5999ec7be811ef9cab0242ac120005",
                "doc_name": "1.txt"
            }
        ],
        "total": 1
    }
}
Failure:
{
    "code": 102,
    "message": "`datasets` is required."
}
POST /api/v1/chats
Creates a chat assistant.
/api/v1/chats'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"name": string"avatar": string"dataset_ids": list[string]"llm": object"prompt": objectcurl --request POST \
     --url http://{address}/api/v1/chats \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>'
     --data '{
    "dataset_ids": ["0b2cbc8c877f11ef89070242ac120005"],
    "name":"new_chat_1"
}'
"name": (Body parameter), string, Required"avatar": (Body parameter), string"dataset_ids": (Body parameter), list[string]"llm": (Body parameter), objectllm JSON object contains the following attributes:"model_name", string"temperature": float0.1."top_p": float0.3"presence_penalty": float0.2."frequency penalty": float0.7."max_token": integer512. If disabled, you lift the maximum token limit, allowing the model to determine the number of tokens in its responses."prompt": (Body parameter), objectprompt JSON object contains the following attributes:"similarity_threshold": float RAGFlow employs either a combination of weighted keyword similarity and weighted vector cosine similarity, or a combination of weighted keyword similarity and weighted reranking score during retrieval. This argument sets the threshold for similarities between the user query and chunks. If a similarity score falls below this threshold, the corresponding chunk will be excluded from the results. The default value is 0.2."keywords_similarity_weight": float This argument sets the weight of keyword similarity in the hybrid similarity score with vector cosine similarity or reranking model similarity. By adjusting this weight, you can control the influence of keyword similarity in relation to other similarity measures. The default value is 0.7."top_n": int This argument specifies the number of top chunks with similarity scores above the similarity_threshold that are fed to the LLM. The LLM will only access these ‘top N’ chunks.  The default value is 8."variables": object[] This argument lists the variables to use in the ‘System’ field of Chat Configurations. Note that:"knowledge" is a reserved variable, which represents the retrieved chunks.[{"key": "knowledge", "optional": true}]."rerank_model": string If it is not specified, vector cosine similarity will be used; otherwise, reranking score will be used."empty_response": string If nothing is retrieved in the dataset for the user’s question, this will be used as the response. To allow the LLM to improvise when nothing is found, leave this blank."opener": string The opening greeting for the user. Defaults to "Hi! I am your assistant, can I help you?"."show_quote: boolean Indicates whether the source of text should be displayed. Defaults to true."prompt": string The prompt content.Success:
{
    "code": 0,
    "data": {
        "avatar": "",
        "create_date": "Thu, 24 Oct 2024 11:18:29 GMT",
        "create_time": 1729768709023,
        "dataset_ids": [
            "527fa74891e811ef9c650242ac120006"
        ],
        "description": "A helpful Assistant",
        "do_refer": "1",
        "id": "b1f2f15691f911ef81180242ac120003",
        "language": "English",
        "llm": {
            "frequency_penalty": 0.7,
            "max_tokens": 512,
            "model_name": "qwen-plus@Tongyi-Qianwen",
            "presence_penalty": 0.4,
            "temperature": 0.1,
            "top_p": 0.3
        },
        "name": "12234",
        "prompt": {
            "empty_response": "Sorry! No relevant content was found in the knowledge base!",
            "keywords_similarity_weight": 0.3,
            "opener": "Hi! I'm your assistant, what can I do for you?",
            "prompt": "You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, your answer must include the sentence \"The answer you are looking for is not found in the knowledge base!\" Answers need to consider chat history.\n ",
            "rerank_model": "",
            "similarity_threshold": 0.2,
            "top_n": 6,
            "variables": [
                {
                    "key": "knowledge",
                    "optional": false
                }
            ]
        },
        "prompt_type": "simple",
        "status": "1",
        "tenant_id": "69736c5e723611efb51b0242ac120007",
        "top_k": 1024,
        "update_date": "Thu, 24 Oct 2024 11:18:29 GMT",
        "update_time": 1729768709023
    }
}
Failure:
{
    "code": 102,
    "message": "Duplicated chat name in creating dataset."
}
PUT /api/v1/chats/{chat_id}
Updates configurations for a specified chat assistant.
/api/v1/chats/{chat_id}'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"name": string"avatar": string"dataset_ids": list[string]"llm": object"prompt": objectcurl --request PUT \
     --url http://{address}/api/v1/chats/{chat_id} \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "name":"Test"
     }'
chat_id: (Path parameter)"name": (Body parameter), string, Required"avatar": (Body parameter), string"dataset_ids": (Body parameter), list[string]"llm": (Body parameter), objectllm object contains the following attributes:"model_name", string"temperature": float0.1."top_p": float0.3"presence_penalty": float0.2."frequency penalty": float0.7."max_token": integer512. If disabled, you lift the maximum token limit, allowing the model to determine the number of tokens in its responses."prompt": (Body parameter), objectprompt object contains the following attributes:"similarity_threshold": float RAGFlow employs either a combination of weighted keyword similarity and weighted vector cosine similarity, or a combination of weighted keyword similarity and weighted rerank score during retrieval. This argument sets the threshold for similarities between the user query and chunks. If a similarity score falls below this threshold, the corresponding chunk will be excluded from the results. The default value is 0.2."keywords_similarity_weight": float This argument sets the weight of keyword similarity in the hybrid similarity score with vector cosine similarity or reranking model similarity. By adjusting this weight, you can control the influence of keyword similarity in relation to other similarity measures. The default value is 0.7."top_n": int This argument specifies the number of top chunks with similarity scores above the similarity_threshold that are fed to the LLM. The LLM will only access these ‘top N’ chunks.  The default value is 8."variables": object[] This argument lists the variables to use in the ‘System’ field of Chat Configurations. Note that:"knowledge" is a reserved variable, which represents the retrieved chunks.[{"key": "knowledge", "optional": true}]"rerank_model": string If it is not specified, vector cosine similarity will be used; otherwise, reranking score will be used."empty_response": string If nothing is retrieved in the dataset for the user’s question, this will be used as the response. To allow the LLM to improvise when nothing is found, leave this blank."opener": string The opening greeting for the user. Defaults to "Hi! I am your assistant, can I help you?"."show_quote: boolean Indicates whether the source of text should be displayed. Defaults to true."prompt": string The prompt content.Success:
{
    "code": 0
}
Failure:
{
    "code": 102,
    "message": "Duplicated chat name in updating dataset."
}
DELETE /api/v1/chats
Deletes chat assistants by ID.
/api/v1/chats'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"ids": list[string]curl --request DELETE \
     --url http://{address}/api/v1/chats \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "ids": ["test_1", "test_2"]
     }'
"ids": (Body parameter), list[string]Success:
{
    "code": 0
}
Failure:
{
    "code": 102,
    "message": "ids are required"
}
GET /api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={chat_name}&id={chat_id}
Lists chat assistants.
/api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}'Authorization: Bearer <YOUR_API_KEY>'curl --request GET \
     --url http://{address}/api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \
     --header 'Authorization: Bearer <YOUR_API_KEY>'
page: (Filter parameter), integer1.page_size: (Filter parameter), integer30.orderby: (Filter parameter), stringcreate_time (default)update_timedesc: (Filter parameter), booleantrue.id: (Filter parameter), stringname: (Filter parameter), stringSuccess:
{
    "code": 0,
    "data": [
        {
            "avatar": "",
            "create_date": "Fri, 18 Oct 2024 06:20:06 GMT",
            "create_time": 1729232406637,
            "description": "A helpful Assistant",
            "do_refer": "1",
            "id": "04d0d8e28d1911efa3630242ac120006",
            "dataset_ids": ["527fa74891e811ef9c650242ac120006"],
            "language": "English",
            "llm": {
                "frequency_penalty": 0.7,
                "max_tokens": 512,
                "model_name": "qwen-plus@Tongyi-Qianwen",
                "presence_penalty": 0.4,
                "temperature": 0.1,
                "top_p": 0.3
            },
            "name": "13243",
            "prompt": {
                "empty_response": "Sorry! No relevant content was found in the knowledge base!",
                "keywords_similarity_weight": 0.3,
                "opener": "Hi! I'm your assistant, what can I do for you?",
                "prompt": "You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, your answer must include the sentence \"The answer you are looking for is not found in the knowledge base!\" Answers need to consider chat history.\n",
                "rerank_model": "",
                "similarity_threshold": 0.2,
                "top_n": 6,
                "variables": [
                    {
                        "key": "knowledge",
                        "optional": false
                    }
                ]
            },
            "prompt_type": "simple",
            "status": "1",
            "tenant_id": "69736c5e723611efb51b0242ac120007",
            "top_k": 1024,
            "update_date": "Fri, 18 Oct 2024 06:20:06 GMT",
            "update_time": 1729232406638
        }
    ]
}
Failure:
{
    "code": 102,
    "message": "The chat doesn't exist"
}
POST /api/v1/chats/{chat_id}/sessions
Creates a session with a chat assistant.
/api/v1/chats/{chat_id}/sessions'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"name": stringcurl --request POST \
     --url http://{address}/api/v1/chats/{chat_id}/sessions \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "name": "new session"
     }'
chat_id: (Path parameter)"name": (Body parameter), stringSuccess:
{
    "code": 0,
    "data": {
        "chat_id": "2ca4b22e878011ef88fe0242ac120005",
        "create_date": "Fri, 11 Oct 2024 08:46:14 GMT",
        "create_time": 1728636374571,
        "id": "4606b4ec87ad11efbc4f0242ac120006",
        "messages": [
            {
                "content": "Hi! I am your assistant,can I help you?",
                "role": "assistant"
            }
        ],
        "name": "new session",
        "update_date": "Fri, 11 Oct 2024 08:46:14 GMT",
        "update_time": 1728636374571
    }
}
Failure:
{
    "code": 102,
    "message": "Name cannot be empty."
}
PUT /api/v1/chats/{chat_id}/sessions/{session_id}
Updates a session of a specified chat assistant.
/api/v1/chats/{chat_id}/sessions/{session_id}'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"name: stringcurl --request PUT \
     --url http://{address}/api/v1/chats/{chat_id}/sessions/{session_id} \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "name": "<REVISED_SESSION_NAME_HERE>"
     }'
chat_id: (Path parameter)session_id: (Path parameter)"name": (Body Parameter), stringSuccess:
{
    "code": 0
}
Failure:
{
    "code": 102,
    "message": "Name cannot be empty."
}
GET /api/v1/chats/{chat_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id}
Lists sessions associated with a specified chat assistant.
/api/v1/chats/{chat_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id}'Authorization: Bearer <YOUR_API_KEY>'curl --request GET \
     --url http://{address}/api/v1/chats/{chat_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id} \
     --header 'Authorization: Bearer <YOUR_API_KEY>'
chat_id: (Path parameter)page: (Filter parameter), integer1.page_size: (Filter parameter), integer30.orderby: (Filter parameter), stringcreate_time (default)update_timedesc: (Filter parameter), booleantrue.name: (Filter parameter) stringid: (Filter parameter), stringSuccess:
{
    "code": 0,
    "data": [
        {
            "chat": "2ca4b22e878011ef88fe0242ac120005",
            "create_date": "Fri, 11 Oct 2024 08:46:43 GMT",
            "create_time": 1728636403974,
            "id": "578d541e87ad11ef96b90242ac120006",
            "messages": [
                {
                    "content": "Hi! I am your assistant,can I help you?",
                    "role": "assistant"
                }
            ],
            "name": "new session",
            "update_date": "Fri, 11 Oct 2024 08:46:43 GMT",
            "update_time": 1728636403974
        }
    ]
}
Failure:
{
    "code": 102,
    "message": "The session doesn't exist"
}
DELETE /api/v1/chats/{chat_id}/sessions
Deletes sessions of a chat assistant by ID.
/api/v1/chats/{chat_id}/sessions'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"ids": list[string]curl --request DELETE \
     --url http://{address}/api/v1/chats/{chat_id}/sessions \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '
     {
          "ids": ["test_1", "test_2"]
     }'
chat_id: (Path parameter)"ids": (Body Parameter), list[string]Success:
{
    "code": 0
}
Failure:
{
    "code": 102,
    "message": "The chat doesn't own the session"
}
POST /api/v1/chats/{chat_id}/completions
:::tip NOTE
json
data:
{
"code": 0,
"data": true
}
:::/api/v1/chats/{chat_id}/completions'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'"question": string"stream": boolean"session_id": stringcurl --request POST \
     --url http://{address}/api/v1/chats/{chat_id}/completions \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data-binary '
     {
     }'
curl --request POST \
     --url http://{address}/api/v1/chats/{chat_id}/completions \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data-binary '
     {
          "question": "Who are you",
          "stream": true,
          "session_id":"9fa7691cb85c11ef9c5f0242ac120005"
     }'
chat_id: (Path parameter)"question": (Body Parameter), string, Required"stream": (Body Parameter), booleantrue: Enable streaming (default).false: Disable streaming."session_id": (Body Parameter)Success without session_id:
data:{
    "code": 0,
    "message": "",
    "data": {
        "answer": "Hi! I'm your assistant, what can I do for you?",
        "reference": {},
        "audio_binary": null,
        "id": null,
        "session_id": "b01eed84b85611efa0e90242ac120005"
    }
}
data:{
    "code": 0,
    "message": "",
    "data": true
}
Success with session_id:
data:{
    "code": 0,
    "data": {
        "answer": "I am an intelligent assistant designed to help answer questions by summarizing content from a",
        "reference": {},
        "audio_binary": null,
        "id": "a84c5dd4-97b4-4624-8c3b-974012c8000d",
        "session_id": "82b0ab2a9c1911ef9d870242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "I am an intelligent assistant designed to help answer questions by summarizing content from a knowledge base. My responses are based on the information available in the knowledge base and",
        "reference": {},
        "audio_binary": null,
        "id": "a84c5dd4-97b4-4624-8c3b-974012c8000d",
        "session_id": "82b0ab2a9c1911ef9d870242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "I am an intelligent assistant designed to help answer questions by summarizing content from a knowledge base. My responses are based on the information available in the knowledge base and any relevant chat history.",
        "reference": {},
        "audio_binary": null,
        "id": "a84c5dd4-97b4-4624-8c3b-974012c8000d",
        "session_id": "82b0ab2a9c1911ef9d870242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "I am an intelligent assistant designed to help answer questions by summarizing content from a knowledge base ##0$$. My responses are based on the information available in the knowledge base and any relevant chat history.",
        "reference": {
            "total": 1,
            "chunks": [
                {
                    "id": "faf26c791128f2d5e821f822671063bd",
                    "content": "xxxxxxxx",
                    "document_id": "dd58f58e888511ef89c90242ac120006",
                    "document_name": "1.txt",
                    "dataset_id": "8e83e57a884611ef9d760242ac120006",
                    "image_id": "",
                    "similarity": 0.7,
                    "vector_similarity": 0.0,
                    "term_similarity": 1.0,
                    "positions": [
                        ""
                    ]
                }
            ],
            "doc_aggs": [
                {
                    "doc_name": "1.txt",
                    "doc_id": "dd58f58e888511ef89c90242ac120006",
                    "count": 1
                }
            ]
        },
        "prompt": "xxxxxxxxxxx",
        "id": "a84c5dd4-97b4-4624-8c3b-974012c8000d",
        "session_id": "82b0ab2a9c1911ef9d870242ac120006"
    }
}
data:{
    "code": 0,
    "data": true
}
Failure:
{
    "code": 102,
    "message": "Please input your question."
}
POST /api/v1/agents/{agent_id}/sessions
Creates a session with an agent.
/api/v1/agents/{agent_id}/sessions'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'curl --request POST \
     --url http://{address}/api/v1/agents/{agent_id}/sessions \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '{
     }'
agent_id: (Path parameter)Success:
{
    "code": 0,
    "data": {
        "agent_id": "b4a39922b76611efaa1a0242ac120006",
        "dsl": {
            "answer": [],
            "components": {
                "Answer:GreenReadersDrum": {
                    "downstream": [],
                    "obj": {
                        "component_name": "Answer",
                        "inputs": [],
                        "output": null,
                        "params": {}
                    },
                    "upstream": []
                },
                "begin": {
                    "downstream": [],
                    "obj": {
                        "component_name": "Begin",
                        "inputs": [],
                        "output": {},
                        "params": {}
                    },
                    "upstream": []
                }
            },
            "embed_id": "",
            "graph": {
                "edges": [],
                "nodes": [
                    {
                        "data": {
                            "label": "Begin",
                            "name": "begin"
                        },
                        "dragging": false,
                        "height": 44,
                        "id": "begin",
                        "position": {
                            "x": 53.25688640427177,
                            "y": 198.37155679786412
                        },
                        "positionAbsolute": {
                            "x": 53.25688640427177,
                            "y": 198.37155679786412
                        },
                        "selected": false,
                        "sourcePosition": "left",
                        "targetPosition": "right",
                        "type": "beginNode",
                        "width": 200
                    },
                    {
                        "data": {
                            "form": {},
                            "label": "Answer",
                            "name": "dialog_0"
                        },
                        "dragging": false,
                        "height": 44,
                        "id": "Answer:GreenReadersDrum",
                        "position": {
                            "x": 360.43473114516974,
                            "y": 207.29298425089348
                        },
                        "positionAbsolute": {
                            "x": 360.43473114516974,
                            "y": 207.29298425089348
                        },
                        "selected": false,
                        "sourcePosition": "right",
                        "targetPosition": "left",
                        "type": "logicNode",
                        "width": 200
                    }
                ]
            },
            "history": [],
            "messages": [],
            "path": [
                [
                    "begin"
                ],
                []
            ],
            "reference": []
        },
        "id": "2581031eb7a311efb5200242ac120005",
        "message": [
            {
                "content": "Hi! I'm your smart assistant. What can I do for you?",
                "role": "assistant"
            }
        ],
        "source": "agent",
        "user_id": "69736c5e723611efb51b0242ac120007"
    }
}
Failure:
{
    "code": 102,
    "message": "Agent not found."
}
POST /api/v1/agents/{agent_id}/completions
:::tip NOTE
json
data:
{
"code": 0,
"data": true
}
:::/api/v1/agents/{agent_id}/completions'content-Type: application/json''Authorization: Bearer <YOUR_API_KEY>'Body:
"question": string"stream": boolean"session_id": stringother parameters: string
curl --request POST \
     --url http://{address}/api/v1/agents/{agent_id}/completions \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data-binary '
     {
     }'
curl --request POST \
     --url http://{address}/api/v1/agents/{agent_id}/completions \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data-binary '
     {
          "question": "Hello",
          "stream": true,
          "session_id": "cb2f385cb86211efa36e0242ac120005"
     }'
curl --request POST \
     --url http://{address}/api/v1/agents/{agent_id}/completions \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data-binary '
     {
          "lang":"English"
          "file":"How is the weather tomorrow?"
     }'
agent_id: (Path parameter), string"question": (Body Parameter), string, Required"stream": (Body Parameter), booleantrue: Enable streaming (default).false: Disable streaming."session_id": (Body Parameter)Other parameters: (Body Parameter)
The parameters in the begin component.
success without session_id provided and with no parameters in the begin component:
data:{
"code": 0,
"message": "",
"data": {
    "answer": "Hi! I'm your smart assistant. What can I do for you?",
    "reference": {},
    "id": "31e6091d-88d4-441b-ac65-eae1c055be7b",
    "session_id": "2987ad3eb85f11efb2a70242ac120005"
}
}
data:{
"code": 0,
"message": "",
"data": true
}
Success with session_id provided and with no parameters in the begin component:
data:{
    "code": 0,
    "message": "",
    "data": {
        "answer": "",
        "reference": [],
        "id": "7ed5c2e4-aa28-4397-bbed-59664a332aa0",
        "session_id": "ce1b4fa89c1811ef85720242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "Hello",
        "reference": [],
        "id": "7ed5c2e4-aa28-4397-bbed-59664a332aa0",
        "session_id": "ce1b4fa89c1811ef85720242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "Hello!",
        "reference": [],
        "id": "7ed5c2e4-aa28-4397-bbed-59664a332aa0",
        "session_id": "ce1b4fa89c1811ef85720242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "Hello! How",
        "reference": [],
        "id": "7ed5c2e4-aa28-4397-bbed-59664a332aa0",
        "session_id": "ce1b4fa89c1811ef85720242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "Hello! How can",
        "reference": [],
        "id": "7ed5c2e4-aa28-4397-bbed-59664a332aa0",
        "session_id": "ce1b4fa89c1811ef85720242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "Hello! How can I",
        "reference": [],
        "id": "7ed5c2e4-aa28-4397-bbed-59664a332aa0",
        "session_id": "ce1b4fa89c1811ef85720242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "Hello! How can I assist",
        "reference": [],
        "id": "7ed5c2e4-aa28-4397-bbed-59664a332aa0",
        "session_id": "ce1b4fa89c1811ef85720242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "Hello! How can I assist you",
        "reference": [],
        "id": "7ed5c2e4-aa28-4397-bbed-59664a332aa0",
        "session_id": "ce1b4fa89c1811ef85720242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "Hello! How can I assist you today",
        "reference": [],
        "id": "7ed5c2e4-aa28-4397-bbed-59664a332aa0",
        "session_id": "ce1b4fa89c1811ef85720242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "Hello! How can I assist you today?",
        "reference": [],
        "id": "7ed5c2e4-aa28-4397-bbed-59664a332aa0",
        "session_id": "ce1b4fa89c1811ef85720242ac120006"
    }
}
data:{
    "code": 0,
    "data": {
        "answer": "Hello! How can I assist you today?",
        "reference": [],
        "id": "7ed5c2e4-aa28-4397-bbed-59664a332aa0",
        "session_id": "ce1b4fa89c1811ef85720242ac120006"
    }
}
data:{
    "code": 0,
    "data": true
}
Success with parameters in the begin component:
data:{
    "code": 0,
    "message": "",
    "data": {
        "answer": "How",
        "reference": {},
        "id": "0379ac4c-b26b-4a44-8b77-99cebf313fdf",
        "session_id": "4399c7d0b86311efac5b0242ac120005"
    }
}
data:{
    "code": 0,
    "message": "",
    "data": {
        "answer": "How is",
        "reference": {},
        "id": "0379ac4c-b26b-4a44-8b77-99cebf313fdf",
        "session_id": "4399c7d0b86311efac5b0242ac120005"
    }
}
data:{
    "code": 0,
    "message": "",
    "data": {
        "answer": "How is the",
        "reference": {},
        "id": "0379ac4c-b26b-4a44-8b77-99cebf313fdf",
        "session_id": "4399c7d0b86311efac5b0242ac120005"
    }
}
data:{
    "code": 0,
    "message": "",
    "data": {
        "answer": "How is the weather",
        "reference": {},
        "id": "0379ac4c-b26b-4a44-8b77-99cebf313fdf",
        "session_id": "4399c7d0b86311efac5b0242ac120005"
    }
}
data:{
    "code": 0,
    "message": "",
    "data": {
        "answer": "How is the weather tomorrow",
        "reference": {},
        "id": "0379ac4c-b26b-4a44-8b77-99cebf313fdf",
        "session_id": "4399c7d0b86311efac5b0242ac120005"
    }
}
data:{
    "code": 0,
    "message": "",
    "data": {
        "answer": "How is the weather tomorrow?",
        "reference": {},
        "id": "0379ac4c-b26b-4a44-8b77-99cebf313fdf",
        "session_id": "4399c7d0b86311efac5b0242ac120005"
    }
}
data:{
    "code": 0,
    "message": "",
    "data": {
        "answer": "How is the weather tomorrow?",
        "reference": {},
        "id": "0379ac4c-b26b-4a44-8b77-99cebf313fdf",
        "session_id": "4399c7d0b86311efac5b0242ac120005"
    }
}
data:{
    "code": 0,
    "message": "",
    "data": true
}
Failure:
{
    "code": 102,
    "message": "`question` is required."
}
GET /api/v1/agents/{agent_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&id={session_id}
Lists sessions associated with a specified agent.
/api/v1/agents/{agent_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&id={session_id}'Authorization: Bearer <YOUR_API_KEY>'curl --request GET \
     --url http://{address}/api/v1/agents/{agent_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&id={session_id} \
     --header 'Authorization: Bearer <YOUR_API_KEY>'
agent_id: (Path parameter)page: (Filter parameter), integer1.page_size: (Filter parameter), integer30.orderby: (Filter parameter), stringcreate_time (default)update_timedesc: (Filter parameter), booleantrue.id: (Filter parameter), stringSuccess:
{
    "code": 0,
    "data": {
        "agent_id": "e9e2b9c2b2f911ef801d0242ac120006",
        "dsl": {
            "answer": [],
            "components": {
                "Answer:OrangeTermsBurn": {
                    "downstream": [],
                    "obj": {
                        "component_name": "Answer",
                        "params": {}
                    },
                    "upstream": []
                },
                "Generate:SocialYearsRemain": {
                    "downstream": [],
                    "obj": {
                        "component_name": "Generate",
                        "params": {
                            "cite": true,
                            "frequency_penalty": 0.7,
                            "llm_id": "gpt-4o___OpenAI-API@OpenAI-API-Compatible",
                            "max_tokens": 256,
                            "message_history_window_size": 12,
                            "parameters": [],
                            "presence_penalty": 0.4,
                            "prompt": "Please summarize the following paragraph. Pay attention to the numbers and do not make things up. The paragraph is as follows:\n{input}\nThis is what you need to summarize.",
                            "temperature": 0.1,
                            "top_p": 0.3
                        }
                    },
                    "upstream": []
                },
                "begin": {
                    "downstream": [],
                    "obj": {
                        "component_name": "Begin",
                        "params": {}
                    },
                    "upstream": []
                }
            },
            "graph": {
                "edges": [],
                "nodes": [
                    {
                        "data": {
                            "label": "Begin",
                            "name": "begin"
                        },
                        "height": 44,
                        "id": "begin",
                        "position": {
                            "x": 50,
                            "y": 200
                        },
                        "sourcePosition": "left",
                        "targetPosition": "right",
                        "type": "beginNode",
                        "width": 200
                    },
                    {
                        "data": {
                            "form": {
                                "cite": true,
                                "frequencyPenaltyEnabled": true,
                                "frequency_penalty": 0.7,
                                "llm_id": "gpt-4o___OpenAI-API@OpenAI-API-Compatible",
                                "maxTokensEnabled": true,
                                "max_tokens": 256,
                                "message_history_window_size": 12,
                                "parameters": [],
                                "presencePenaltyEnabled": true,
                                "presence_penalty": 0.4,
                                "prompt": "Please summarize the following paragraph. Pay attention to the numbers and do not make things up. The paragraph is as follows:\n{input}\nThis is what you need to summarize.",
                                "temperature": 0.1,
                                "temperatureEnabled": true,
                                "topPEnabled": true,
                                "top_p": 0.3
                            },
                            "label": "Generate",
                            "name": "Generate Answer_0"
                        },
                        "dragging": false,
                        "height": 105,
                        "id": "Generate:SocialYearsRemain",
                        "position": {
                            "x": 561.3457829707513,
                            "y": 178.7211182312641
                        },
                        "positionAbsolute": {
                            "x": 561.3457829707513,
                            "y": 178.7211182312641
                        },
                        "selected": true,
                        "sourcePosition": "right",
                        "targetPosition": "left",
                        "type": "generateNode",
                        "width": 200
                    },
                    {
                        "data": {
                            "form": {},
                            "label": "Answer",
                            "name": "Dialogue_0"
                        },
                        "height": 44,
                        "id": "Answer:OrangeTermsBurn",
                        "position": {
                            "x": 317.2368194777658,
                            "y": 218.30635555445093
                        },
                        "sourcePosition": "right",
                        "targetPosition": "left",
                        "type": "logicNode",
                        "width": 200
                    }
                ]
            },
            "history": [],
            "messages": [],
            "path": [],
            "reference": []
        },
        "id": "792dde22b2fa11ef97550242ac120006",
        "message": [
            {
                "content": "Hi! I'm your smart assistant. What can I do for you?",
                "role": "assistant"
            }
        ],
        "source": "agent",
        "user_id": ""
    }
}
Failure:
{
    "code": 102,
    "message": "You don't own the agent ccd2f856b12311ef94ca0242ac1200052."
}
GET /api/v1/agents?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={agent_name}&id={agent_id}
Lists agents.
/api/v1/agents?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={agent_name}&id={agent_id}'Authorization: Bearer <YOUR_API_KEY>'curl --request GET \
     --url http://{address}/api/v1/agents?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={agent_name}&id={agent_id} \
     --header 'Authorization: Bearer <YOUR_API_KEY>'
page: (Filter parameter), integer1.page_size: (Filter parameter), integer30.orderby: (Filter parameter), stringcreate_time (default)update_timedesc: (Filter parameter), booleantrue.id: (Filter parameter), stringname: (Filter parameter), stringSuccess:
{
    "code": 0,
    "data": [
        {
            "avatar": null,
            "canvas_type": null,
            "create_date": "Thu, 05 Dec 2024 19:10:36 GMT",
            "create_time": 1733397036424,
            "description": null,
            "dsl": {
                "answer": [],
                "components": {
                    "begin": {
                        "downstream": [],
                        "obj": {
                            "component_name": "Begin",
                            "params": {}
                        },
                        "upstream": []
                    }
                },
                "graph": {
                    "edges": [],
                    "nodes": [
                        {
                            "data": {
                                "label": "Begin",
                                "name": "begin"
                            },
                            "height": 44,
                            "id": "begin",
                            "position": {
                                "x": 50,
                                "y": 200
                            },
                            "sourcePosition": "left",
                            "targetPosition": "right",
                            "type": "beginNode",
                            "width": 200
                        }
                    ]
                },
                "history": [],
                "messages": [],
                "path": [],
                "reference": []
            },
            "id": "8d9ca0e2b2f911ef9ca20242ac120006",
            "title": "123465",
            "update_date": "Thu, 05 Dec 2024 19:10:56 GMT",
            "update_time": 1733397056801,
            "user_id": "69736c5e723611efb51b0242ac120007"
        }
    ]
}
Failure:
{
    "code": 102,
    "message": "The agent doesn't exist."
}