UNPKG

@promptbook/remote-server

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

63 lines (62 loc) 2.33 kB
import type { ChatPromptResult } from '../../execution/PromptResult'; import type { Prompt } from '../../types/Prompt'; import type { string_markdown } from '../../types/string_markdown'; import type { string_date_iso8601 } from '../../types/string_token'; import type { chococake } from '../../utils/organization/really_any'; /** * Handles progress emission, verbose logging, and final result assembly. * * @private helper of `OpenAiAssistantExecutionTools` */ export declare class OpenAiAssistantExecutionToolsProgressReporter { private readonly options; /** * Creates one reporter instance. */ constructor(options: { readonly isVerbose: boolean; }); /** * Logs one assistant chat call when verbose output is enabled. */ logAssistantChatCall(prompt: Prompt): void; /** * Logs one assistant request payload when verbose output is enabled. */ logVerboseAssistantRequest(label: string, rawRequest: unknown): void; /** * Emits one assistant progress chunk with shared timing and prompt metadata. */ emitAssistantProgress(options: { readonly start: string_date_iso8601; readonly rawPromptContent: string; readonly onProgress: (chunk: ChatPromptResult) => void; readonly content?: string; readonly rawRequest?: chococake; readonly rawResponse?: chococake; readonly toolCalls?: ChatPromptResult['toolCalls']; }): void; /** * Creates the final assistant prompt result with uncertain usage plus measured duration. */ createAssistantPromptResult(options: { readonly content: string_markdown; readonly start: string_date_iso8601; readonly complete: string_date_iso8601; readonly rawPromptContent: string; readonly rawRequest: chococake; readonly rawResponse: chococake; readonly toolCalls?: ChatPromptResult['toolCalls']; }): ChatPromptResult; /** * Wraps the final assistant prompt result in the standard exported JSON envelope. */ exportAssistantPromptResult(options: { readonly result: ChatPromptResult; readonly isWithTools: boolean; }): ChatPromptResult; /** * Computes the usage payload for assistant responses. */ private createAssistantUsage; }