Skip to main content

Interface: PromptEngineResult

Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:222

Comprehensive result object returned by prompt construction, containing the formatted prompt, metadata, issues encountered, and optimization information. PromptEngineResult

Properties

cacheKey?

optional cacheKey: string

Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:264

An optional cache key if the result was retrieved from or stored in a cache.


estimatedTokenCount?

optional estimatedTokenCount: number

Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:231

Estimated token count of the constructed prompt before precise provider counting.


formattedToolSchemas?

optional formattedToolSchemas: any[]

Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:229

Formatted tool schemas compatible with the target model's API, if tools are used. The structure of any[] depends on ModelTargetInfo.toolSupport.format.


issues?

optional issues: object[]

Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:235

Any issues (errors, warnings, info) encountered during prompt construction.

code

code: string

component?

optional component: string

details?

optional details: unknown

message

message: string

suggestion?

optional suggestion: string

type

type: "error" | "warning" | "info"


metadata

metadata: object

Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:254

Performance metrics and metadata related to the prompt construction process.

Index Signature

[key: string]: unknown

constructionTimeMs

constructionTimeMs: number

historyMessagesIncluded

historyMessagesIncluded: number

ragContextTokensUsed?

optional ragContextTokensUsed: number

selectedContextualElementIds

selectedContextualElementIds: string[]

templateUsed

templateUsed: string

totalSystemPromptsApplied

totalSystemPromptsApplied: number


modificationDetails?

optional modificationDetails: object

Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:246

Details about modifications made during construction (e.g., which components were truncated).

addedContextualElementIds?

optional addedContextualElementIds: string[]

originalEstimatedTokenCount?

optional originalEstimatedTokenCount: number

removedComponents?

optional removedComponents: string[]

summarizedComponents?

optional summarizedComponents: string[]

truncatedComponents?

optional truncatedComponents: string[]


prompt

prompt: FormattedPrompt

Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:224

The final formatted prompt ready for LLM consumption.


tokenCount?

optional tokenCount: number

Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:233

Precise token count, if available from a tokenizer or after construction.


wasTruncatedOrSummarized

wasTruncatedOrSummarized: boolean

Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:244

Indicates if content was truncated or summarized to fit token limits.