Public API / SDK Changes — Unique AI Documentation

Public API / SDK Changes

1 min read

SDK

tech Chat In Space - Chat within a space using an assistant. You must provide an assistantId (e.g. assistant_hjcdga64bkklcjnhu4) and the message text to initiate the conversation.

You can send the message in an existing chat by specifying a chat_id (e.g. chat_dh37sjdcn38klhs), or omit the chat_id to automatically create a new chat session. Check the optional parameters list for more configs.

The script sends a prompt asynchronously and continuously polls for completion, which is determined when the stoppedStreamingAt field of the message becomes non-null.

Optional parameters:

Example

latest_message = unique_sdk.utils.send_message_and_wait_for_completion(
        user_id=user_id,
        company_id=company_id,
        assistant_id=assistant_id,
        text="Tell me a short story.",
        chat_id=chat_id, # Optional - if no chat id is specified, a new chat will be created
        tool_choices=["WebSearch"],
        scope_rules={
            "or": [
                {
                    "operator": "in",
                    "path": [
                        "contentId"
                    ],
                    "value": [
                        "cont_u888z7cazxxm4lugfdjq7pks"
                    ]
                }
            ]
        },
    )

Check out Unique SDK on PyPI: https://pypi.org/project/unique_sdk/ .

| Author | |