palbaseDocs

Palbase ai · API

GET/ai/chats/{chat_id}/parts

The chat's past

The chat's past as its stream told it, a page at a time from its newest end back: the members' messages, the turns, the answers as text at their offsets, the tools and the subagents, the goal's and the voice's words — each page in the order it was told, each part under the id the channel told it under as it happened (part_id) and at the time it happened (at: when the journal took it, as the channel told it — a call's end minus its start is how long it ran), so an app holding the channel's parts and a page of these keeps each once: a numbered part by its id, an answer's text by its offset (the channel cuts an answer's text otherwise), while a message or a turn the channel told again late carries no id there, and a page tells it under its number. A page reads limit of the chat's events before the cursor, or before the oldest part the app holds of the chat's channel (before: that part's id), so the first page does not read again the day the channel told; with neither, from its newest end. Given both, the call is refused (400). A page read by turns (turns=n) ends where the chat's n-th turn before the cursor (or the newest end) opens — a goal's turn at the goal's turn_started, any other at its start, the messages that began it right after — so turns=1 is the last turn whole, and its cursor's turns=1 the turn before; a page that would read more than 5000 of the chat's events ends there, its turns saying how many it opened, its cursor going on. The page that reaches the chat's start begins with where a fork began. A voice's end is under the id its channel told it (vclosed:<voice>); a voice the engine lost, its end said by no journal, has it right after its last part. Reading a page records nothing. A call's answer is by its end, as the stream shows it. Read by the chat's members and the project's server.

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.

Query

limitinteger · optionalHow many of the chat's events the page reads (1 to 1000; 300). Not with turns.
turnsinteger · optionalHow many of the chat's turns the page reads back to (1 to 20): it ends where the last of them opens. Not with limit.
cursorstring · optionalA next_cursor: the page before it. Not with before.
beforeinteger (int64) · optionalThe id of the oldest part the app holds of the chat's channel (a part's id: its journal sequence): the first page is the parts told before it. Not with cursor.
curl
curl -X GET "https://<your-ref>.palbase.studio/ai/chats/<chat_id>/parts" \
  -H "apikey: $PALBASE_SECRET_KEY"

Responses

200A page of the chat's past

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

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 ListChatParts of ai's contract.