FeaturesMessages
Attachments
The current state of attaching files to a message
Attaching files to a message is not available yet. A message body is a single UTF-8 text string of up to 32,768 bytes.
The only required field of sessions.messages.send (POST /v1/sessions/{id}/messages) is the text message. There is no field to carry a file. If the length is exceeded, the response is 413.
import { isApiError } from "@werft-ai/sdk";
try {
await werft.sessions.messages.send(sessionId, { message: "a".repeat(32_769) });
} catch (error) {
if (isApiError(error)) console.log(error.status, error.code);
else throw error;
}413 PAYLOAD_TOO_LARGECommit the files the agent needs to read to the repository the session uses, and point to them by path in the message. A session that starts with a repository clones it when it starts. An agent session that starts without one can read the files only after the agent attaches that repository.
Next steps
- Request: send the commit a session made to the repository