prompt
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| PromptOptions acptui.protocol.prompt What the agent accepts in prompts. |
🛈 DocStrings¶
Turning prompt text into v2 content blocks: @file mentions and skills.
MAX_EMBED_BYTES
module-attribute
¶
Text files up to this size are embedded when the agent accepts embedded context.
MAX_IMAGE_BYTES
module-attribute
¶
Images up to this size are attached when the agent accepts images.
MENTION
module-attribute
¶
An @path mention; spaces in paths are escaped as \.
PromptOptions
dataclass
¶
What the agent accepts in prompts.
Source code in src/acptui/protocol/prompt.py
skills
class-attribute
instance-attribute
¶
Names of the session's skill commands (only used if the agent accepts skills).
build_prompt
¶
build_prompt(text: str, cwd: Path, options: PromptOptions) -> list[ContentBlock]
The content blocks for a prompt.
The text is sent as typed (slash commands are plain text in v2); a leading
/skill naming one of the session's skills becomes a skill block. Each
@file that exists inside cwd adds a resource block after the text.
Source code in src/acptui/protocol/prompt.py
file_block
¶
file_block(path: Path, options: PromptOptions) -> ContentBlock
The content block for a mentioned file.
Small text files are embedded if the agent accepts embedded context, images and audio are attached if it accepts them; everything else (and directories) is linked.
Source code in src/acptui/protocol/prompt.py
find_mentions
¶
The paths mentioned with @ in the text (unescaped, in order, unique).
Source code in src/acptui/protocol/prompt.py
guess_mime
¶
resolve_mention
¶
The file a mention refers to, if it exists inside cwd.