diff --git a/sdk/arch/agent-server.mdx b/sdk/arch/agent-server.mdx index 12259896..775a6e12 100644 --- a/sdk/arch/agent-server.mdx +++ b/sdk/arch/agent-server.mdx @@ -123,6 +123,27 @@ conversation.close() If the server was started without `OH_SESSION_API_KEYS_0`, remove the `api_key=...` argument. +## Customize Conversation Title Generation + +When creating a conversation through `POST /api/conversations`, set +`prompt` to replace the default user prompt used for automatic +title generation. The value can contain these placeholders: + +- `{conversation_content}` - The first user message, truncated to 1,000 characters. +- `{max_length}` - The maximum generated title length. + +```json +{ + "autotitle": true, + "prompt": "Create a title under {max_length} characters for: {conversation_content}" +} +``` + +If `{conversation_content}` is not present, the Agent Server appends the first +user message to the custom prompt. Empty or omitted values keep the default +title-generation behavior. Prompts can contain up to 2,000 characters and are +stored with the conversation in `meta.json`. + ## Expose It Safely If another service runs on the same machine, keep the server bound to `127.0.0.1` and let that service connect locally.