2025.34 Public API / SDK Changes

2 min read

Public API

New Endpoints

tech DELETE Delete a Chat - API to delete a chat.

Example

curl --location --request DELETE 'https://gateway.oleole.unique.app/public/chat/space/chat/chat_se62mrxrt4k0rksimr1ojzmv' \
--header 'x-api-version: 2023-12-06' \
--header 'x-user-id: <your-user-id>' \
--header 'x-company-id: <your-company-id>' \
--header 'Authorization: Bearer <your-api-key>' \
--header 'x-app-id: <your-app-id>' \

tech POST Stream to the chat using the Responses API the Responses API - SStreams the answer to the chat frontend using the Responses API.

Example

curl --location 'https://gateway.oleole.unique.app/public/chat/integrated/chat/stream-responses' \
--header 'x-api-version: 2023-12-06' \
--header 'x-user-id: <your-user-id>' \
--header 'x-company-id: <your-company-id>' \
--header 'Authorization: Bearer <your-api-key>' \
--header 'x-app-id: <your-app-id>' \
--header 'Content-Type: application/json' \
--data '{
    "chatId": "chat_vcrctshcn0wj5qxfqafwr83h",
    "model": "AZURE_o3_2025_0416",
        "assistantMessageId": "msg_k27vdzd6dpc3ys846za3s2i9",
        "userMessageId": "msg_g0yub3u2g7ab0azpcukmeg4x",
        "input": ""Tell me about the curious case of neural text degeneration"",
        "reasoning": {
            "effort": "medium",         
            "summary": "detailed"
        }
}'

SDK

tech Chat Against a File - The script creates a chat and uploads the file to it. It then keeps polling the ingestionState field of the message, waiting for it to reach FINISHED, signaling the upload is complete. Once the file uploads successfully, the script sends the text, continues polling for completion, and finally retrieves the response message.

You must provide the following parameters:

  • assistantId: The assistant to be used for the chat.

  • path_to_file: The local path of the file to be uploaded.

  • displayed_filename: The name of the file to be displayed.

  • mime_type: The mime type of the ifle to be uploaded.

  • text: The text to be sent to the chat for chatting against the file.

Optional parameters:

  • poll_interval: The number of seconds to wait between polling attempts (default: 1 second).

  • max_wait: The maximum number of seconds to wait for the message to complete (default: 60 seconds).

Example of chatting against a PDF (the usage can be extended to any supported file type)

py
latest_message = await unique_sdk.utils.chat_in_space.chat_against_file(
    user_id=user_id,
    company_id=company_id,
    assistant_id="assistant_hjcdga64bkcjnhu4",
    path_to_file="/files/hello.pdf",
    displayed_filename="hello.pdf"
    mime_type="application/pdf"
    text="Give me a bullet point summary of the file.",
)

tech Delete Chat - Delete a space chat by id. If the chat does not exist, the function will return an error.

Example

py
unique_sdk.Space.delete_chat(
    user_id=user_id,
    company_id=company_id,
    chat_id="chat_dejfhe729br398",
)

tech Stream Using Responses API - Streams the answer to the chat frontend using the Responses API.

Example

py
unique_sdk.Integrated.responses_stream(
    user_id=userId,
    company_id=companyId,
    model="AZURE_o3_2025_0416",
    assistantMessageId=assistantMessageId,
    userMessageId=userMessageId,
    input="Tell me about the curious case of neural text degeneration",
    chatId=chatId,
)

tech Get Paginated Folders - Get paginated folders info based on parentId. If the parentId is not defined, the root folders will be returned.

py
unique_sdk.Folder.get_infos(
    user_id=user_id,
    company_id=company_id,
    take=10,                                    #optional
    skip=5,                                     #optional
    parentId="scope_s18seqpnltf35niydg77xgyp"   #optional
)

tech Get Paginated Contents - Get contents by using either a parent id or a metadata filter in UniqueQL language. If both are defined, the function will throw an error.

If you want to learn more about UniqueQL, you can find out more about it in the UniqueQL section.

Example of metadata filter defined in UniqueQL:

py
    metadataFilter: {
        "or": [
            {
                "and": [
                    {
                        "operator": "contains",
                        "path": [
                            "folderIdPath"
                        ],
                        "value": "uniquepathid://test_id"
                    },
                    {
                        "operator": "contains",
                        "path": [
                            "title"
                        ],
                        "value": "ai"
                    }
                ]
            }
        ]
    },

Pagination is also enabled for this functionality, and the default number of returned results is 50 with no entries skipped. Use the following parameters to get the desired page:

  • skip

  • take

Here is an example of retrieving the first 3 content infos that are in the scope_abcdibgznc4bkdcx120zm5d scope and have the value ai in the title.

py
content_info_result = unique_sdk.Content.get_infos(
    user_id=user_id,
    company_id=company_id,
    metadataFilter={
        "or": [
            {
                "and": [
                    {
                        "operator": "contains",
                        "path": [
                            "folderIdPath"
                        ],
                        "value": "scope_abcdibgznc4bkdcx120zm5d"
                    },
                    {
                        "operator": "contains",
                        "path": [
                            "title"
                        ],
                        "value": "ai"
                    }
                ]
            }
        ]
    },
    skip=0,
    take=3,
)

Here is an example of retrieving the contents based on a parentId.

py
content_info_result = unique_sdk.Content.get_infos(
    user_id=user_id,
    company_id=company_id,
    parentId="scope_ahefgj389srjbfejkkk98u"
)

Author

Last updated