PulseAI-OpenAPI
  1. App
PulseAI-OpenAPI
  • App
    • README
    • Send Chat Message
      POST
    • File Upload
      POST
    • Stop Generate
      POST
    • Message Feedback
      POST
    • Next Suggested Questions
      GET
    • Get Conversation History Messages
      GET
    • Get Conversations
      GET
    • Delete Conversation
      DELETE
    • Conversation Rename
      POST
    • Speech to Text
      POST
    • Text to Audio
      POST
    • Text to Audio V2
      POST
    • Get Application Information
      GET
    • Get Application Parameters
      GET
    • Get Application Meta Information
      GET
    • Create Chat
      POST
  • Dataset
    • README
    • Create a Document from Text
      POST
    • Create a Document from a File
      POST
    • Create an Empty Knowledge Base
      POST
    • Get Knowledge Base List
      GET
    • Delete a Knowledge Base
      DELETE
    • Update a Document with Text
      POST
    • Update a Document with a File
      POST
    • Get Document Embedding Status (Progress)
      GET
    • Delete a Document
      DELETE
    • Get the Document List of a Knowledge Base
      GET
    • Add Chunks to a Document
      POST
    • Get Chunks from a Document
      GET
    • Update a Chunk in a Document
      POST
    • Delete a Chunk in a Document
      DELETE
    • Retrieve Chunks from a Knowledge Base
      POST
  • Tenant
    • README
    • Get a List of Tenant Space Charactar
    • Figure txt2img
    • Get a List of Tenant Space Plot
    • Get a List of Tenant Space Audio
  • OpenAPI
    GET
  1. App

Send Chat Message

POST
https://api-platform.digitpulse.ai/v1/chat-messages
Last modified:2025-01-13 06:40:08
Send a request to the chat application.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params

Body Params application/json

Example
{
    "inputs": {},
    "query": "What are the specs of the iPhone 13 Pro Max?",
    "response_mode": "streaming",
    "conversation_id": "",
    "user": "abc-123",
    "files": [
        {
            "type": "image",
            "transfer_method": "remote_url",
            "url": "https://platform.digitpulse.ai/logo/logo.png"
        }
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api-platform.digitpulse.ai/v1/chat-messages' \
--header 'X-Timestamp: 1739933362' \
--header 'X-Signature: 1739933362' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "inputs": {},
    "query": "What are the specs of the iPhone 13 Pro Max?",
    "response_mode": "streaming",
    "conversation_id": "",
    "user": "abc-123",
    "files": [
        {
            "type": "image",
            "transfer_method": "remote_url",
            "url": "https://platform.digitpulse.ai/logo/logo.png"
        }
    ]
}'

Responses

🟢200Blocking Mode
application/json
When response_mode is blocking, return a CompletionResponse object. When response_mode is streaming, return a ChunkCompletionResponse stream.

Errors

404, Conversation does not exists
400, invalid_param, abnormal parameter input
400, app_unavailable, App configuration unavailable
400, provider_not_initialize, no available model credential configuration
400, provider_quota_exceeded, model invocation quota insufficient
400, model_currently_not_support, current model unavailable
400, completion_request_error, text generation failed
500, internal server error
Body

Example
{
    "event": "message",
    "message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
    "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
    "mode": "chat",
    "answer": "iPhone 13 Pro Max specs are listed here:...",
    "metadata": {
        "usage": {
            "prompt_tokens": 1033,
            "prompt_unit_price": "0.001",
            "prompt_price_unit": "0.001",
            "prompt_price": "0.0010330",
            "completion_tokens": 128,
            "completion_unit_price": "0.002",
            "completion_price_unit": "0.001",
            "completion_price": "0.0002560",
            "total_tokens": 1161,
            "total_price": "0.0012890",
            "currency": "USD",
            "latency": 0.7682376249867957
        },
        "retriever_resources": [
            {
                "position": 1,
                "dataset_id": "101b4c97-fc2e-463c-90b1-5261a4cdcafb",
                "dataset_name": "iPhone",
                "document_id": "8dd1ad74-0b5f-4175-b735-7d98bbbb4e00",
                "document_name": "iPhone List",
                "segment_id": "ed599c7f-2766-4294-9d1d-e5235a61270a",
                "score": 0.98457545,
                "content": "\"Model\",\"Release Date\",\"Display Size\",\"Resolution\",\"Processor\",\"RAM\",\"Storage\",\"Camera\",\"Battery\",\"Operating System\"\n\"iPhone 13 Pro Max\",\"September 24, 2021\",\"6.7 inch\",\"1284 x 2778\",\"Hexa-core (2x3.23 GHz Avalanche + 4x1.82 GHz Blizzard)\",\"6 GB\",\"128, 256, 512 GB, 1TB\",\"12 MP\",\"4352 mAh\",\"iOS 15\""
            }
        ]
    },
    "created_at": 1705407629
}
🟢200Streaming Mode ( Basic Assistant )
Modified at 2025-01-13 06:40:08
Previous
README
Next
File Upload
Built with