Skip to documentation
SLOP

tiny.acp.PromptResult

Reference tiny.acp PromptResult

Defined in protocol.

The caller gets the reply with the reason the agent stopped and whether the reply was cut short because Client.promptDetailed and Client.promptDetailedContent return one of these results.

API (4)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callsprotocolPromptResult
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/acp/src/protocol.zig:553

zig
/// The caller gets the reply with the reason the agent stopped and whether the reply was cut short/// because `Client.promptDetailed` and `Client.promptDetailedContent` return one of these results./// The result holds the reply text, the stop reason, and an optional overflow record. The result/// owns the reply and the stop reason, and `deinit` frees them.pub const PromptResult = struct {    /// The reply: the text of the agent's message chunks, joined in arrival order, within the reply    /// limits. The result owns this slice.    response: []u8,    /// The `stopReason` string from the prompt's response, such as `end_turn` or `cancelled`. The    /// result owns this slice.    stop_reason: []u8,    /// The overflow record set when the reply reached a limit, and null otherwise.    overflow: ?Overflow = null,    /// Frees the reply and the stop reason with the given allocator and leaves the value undefined    /// once the caller is done with a prompt result. The call takes the client's allocator.    pub fn deinit(self: *PromptResult, allocator: Allocator) void {        if (self.response.len != 0) allocator.free(self.response);        if (self.stop_reason.len != 0) allocator.free(self.stop_reason);        self.* = undefined;    }};

Source: lib/acp/src/root.zig:82

zig
pub const PromptResult = protocol.PromptResult;

Audit

Definitions2
Public names4
Members3
Version26.7.0
Revisiondaab053ee433