palbaseDocs

Palbase ai · API

POST/ai/chats/{chat_id}/voice/{voice_id}/commands

Tell a chat's voice

The server's alone (a member is answered 403 server_only), as itself or as the voice's member (as; another member 403 not_your_voice): a member's words would be the agent's own to every other member of the chat. Gives the chat's voice text: speak says it, know keeps it in mind, instruct changes how it behaves — speak with a delegation_id answers a request it handed over (ai.voice.delegated). A voice that has ended is 409 voice_closed.

Called by a signed-in user of your app, with their token and the publishable key; or your server, with the project's secret key.

Path

chat_idstring · requiredThe chat.
voice_idstring · requiredThe voice session.

Request body

asstring · optionalThe voice's member the server tells it as (the server's alone).
delegation_idstring · optionalThe delegated voice part this answers (speak).
interruptboolean · optionalspeak only: cut what the voice is saying and say the text at once.
textstring · optionalWhat it is given (16 KiB at most; required for speak, tell, know and instruct; omitted for activate and deactivate).
type"speak" | "tell" | "know" | "instruct" | "activate" | "deactivate" · requiredspeak (say this exactly and nothing else, once what the voice is saying ends; speaks in the order they came), tell (say it in your own words), know (keep it in mind), instruct (behave so), activate (open the live voice gate for a call-transport voice), or deactivate (return the call-transport live gate to sleep).
curl
curl -X POST "https://<your-ref>.palbase.studio/ai/chats/<chat_id>/voice/<voice_id>/commands" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"type":"speak"}'

Responses

202Given

400The request is malformed, or names what this module does not offer (the error names which)

401No valid credential

403A publishable key or a user's session: everything here is the project's server's, called with the secret key

404No such response, job or provider in this project

409The response's state refuses it

429The project's request rate, or the provider's for its connection, is used up — or the project holds as much as it may at once: 32 open streams at one of the module's servers (too_many_streams), 2 pictures being made (too_many_images), 512 MiB of pictures kept here for their day (image_storage_full), or the service — or the project's share of it — holds as much of its requests at once as it takes: their bodies, an embedding request's vectors, the pictures being made (busy). Retry-After says when to try again

503The model service or the database did not answer; retry shortly

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation CommandChatVoice of ai's contract.