Versions in this module Expand all Collapse all v0 v0.0.8 Jun 20, 2025 Changes in this version + const ExtractedThinkingContextKey + const PromptTokensContextKey + const ResponseTokensContextKey + const ThinkingModeContextKey + const TotalTokensContextKey + func CombineFragments(fragments []PromptFragment) string + func MockLLM(ctx Context, prompt string, userQuery string) string + type Context = *orderedmap.OrderedMap[string, interface{}] + func CloneContext(ctx Context) Context + type Middleware interface + Description func() string + ID func() string + Name func() string + Parse func(ctx Context, response string) (Context, string) + Prompt func(ctx Context, fragments []PromptFragment) (Context, []PromptFragment) + type MiddlewarePipeline struct + func NewMiddlewarePipeline() *MiddlewarePipeline + func (p *MiddlewarePipeline) ExecuteParsePhase(context Context, llmResponse string) (Context, string) + func (p *MiddlewarePipeline) ExecutePromptPhase(initialContext Context, initialFragments []PromptFragment) (Context, []PromptFragment, string) + func (p *MiddlewarePipeline) Middlewares() []Middleware + func (p *MiddlewarePipeline) Use(middleware Middleware) *MiddlewarePipeline + type PromptFragment struct + Content string + Metadata PromptFragmentMetadata + func SortFragments(fragments []PromptFragment) []PromptFragment + type PromptFragmentMetadata struct + ID string + Position string + Priority int + Tags []string + Type string + type SystemInstructionMiddleware struct + Instructions string + func NewSystemInstructionMiddleware(instructions string) *SystemInstructionMiddleware + func (m *SystemInstructionMiddleware) Description() string + func (m *SystemInstructionMiddleware) ID() string + func (m *SystemInstructionMiddleware) Name() string + func (m *SystemInstructionMiddleware) Parse(ctx Context, response string) (Context, string) + func (m *SystemInstructionMiddleware) Prompt(ctx Context, fragments []PromptFragment) (Context, []PromptFragment) + type ThinkingModeMiddleware struct + func NewThinkingModeMiddleware() *ThinkingModeMiddleware + func (m *ThinkingModeMiddleware) Description() string + func (m *ThinkingModeMiddleware) ID() string + func (m *ThinkingModeMiddleware) Name() string + func (m *ThinkingModeMiddleware) Parse(ctx Context, response string) (Context, string) + func (m *ThinkingModeMiddleware) Prompt(ctx Context, fragments []PromptFragment) (Context, []PromptFragment) + type TokenCounterMiddleware struct + func NewTokenCounterMiddleware() *TokenCounterMiddleware + func (m *TokenCounterMiddleware) Description() string + func (m *TokenCounterMiddleware) ID() string + func (m *TokenCounterMiddleware) Name() string + func (m *TokenCounterMiddleware) Parse(ctx Context, response string) (Context, string) + func (m *TokenCounterMiddleware) Prompt(ctx Context, fragments []PromptFragment) (Context, []PromptFragment)