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?
optionalcacheKey: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?
optionalestimatedTokenCount:number
Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:231
Estimated token count of the constructed prompt before precise provider counting.
formattedToolSchemas?
optionalformattedToolSchemas: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?
optionalissues:object[]
Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:235
Any issues (errors, warnings, info) encountered during prompt construction.
code
code:
string
component?
optionalcomponent:string
details?
optionaldetails:unknown
message
message:
string
suggestion?
optionalsuggestion: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?
optionalragContextTokensUsed:number
selectedContextualElementIds
selectedContextualElementIds:
string[]
templateUsed
templateUsed:
string
totalSystemPromptsApplied
totalSystemPromptsApplied:
number
modificationDetails?
optionalmodificationDetails:object
Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:246
Details about modifications made during construction (e.g., which components were truncated).
addedContextualElementIds?
optionaladdedContextualElementIds:string[]
originalEstimatedTokenCount?
optionaloriginalEstimatedTokenCount:number
removedComponents?
optionalremovedComponents:string[]
summarizedComponents?
optionalsummarizedComponents:string[]
truncatedComponents?
optionaltruncatedComponents:string[]
prompt
prompt:
FormattedPrompt
Defined in: packages/agentos/src/core/llm/IPromptEngine.ts:224
The final formatted prompt ready for LLM consumption.
tokenCount?
optionaltokenCount: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.