fixedresponses

package
v0.7.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package fixedresponses maps exact demo prompts to fixed assistant turns embedded at build time. When demo mode is enabled, matching prompts return embedded thinking, tool calls, and dashboards instead of calling the LLM. Other prompts use the configured model. See showcase.go for the catalog.

Index

Constants

View Source
const (
	// ShowcasePromptOperations is a fixed demo request for an operational
	// MCP that exposes services, events, and logs.
	ShowcasePromptOperations = "Show me what's happening across the " +
		"production platform right now."
	// ShowcasePromptSales is a fixed demo request for a sales MCP.
	ShowcasePromptSales = "Where are we losing deals in the sales pipeline?"
	// ShowcasePromptCustomers is a fixed demo request for a customer-data
	// MCP that exposes accounts, activity, and support events.
	ShowcasePromptCustomers = "Which customers are at risk and who should " +
		"the team contact first?"

	//nolint:lll // Exact demo prompt matched verbatim.
	ShowcasePromptInfrastructure = "How is the platform infrastructure holding up under load right now?"
	//nolint:lll // Exact demo prompt matched verbatim.
	ShowcasePromptExperiment = "How did the new onboarding experiment perform against control?"
	//nolint:lll // Exact demo prompt matched verbatim.
	ShowcasePromptFinance = "Where is our cloud spend going this quarter and are we on budget?"
	//nolint:lll // Exact demo prompt matched verbatim.
	ShowcasePromptReliability = "Walk me through the active incident and its blast radius."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string

Kind tags what a resolved demo response streams: canned answer text, or a scripted agentic turn (thinking + tool-call blocks).

const (
	KindText  Kind = "text"
	KindTools Kind = "tools"
)

type Response

type Response struct {
	Kind           Kind
	Text           string
	Steps          []Step
	Persist        bool
	InitialDelay   time.Duration
	TextChunkDelay time.Duration
}

Response is a resolved demo command: canned Text (KindText) streamed as-is, or a scripted Steps sequence (KindTools) streamed as thinking/text/tool SSE blocks so the tool-card + interleaving UI is exercised without an LLM or a live MCP server. Persist makes a canned response a durable chat turn.

func GetShowcase

func GetShowcase(text string) (Response, bool)

GetShowcase resolves a deterministic, durable showcase reply for an exact catalog match. All other text remains a normal chat turn.

func (Response) AnswerText

func (r Response) AnswerText() string

AnswerText returns the concatenated answer-text steps — what gets persisted as the assistant message (thinking + tool plumbing are ephemeral, matching a real turn where only the final text is stored).

type Step

type Step struct {
	Kind        StepKind
	DelayBefore time.Duration
	// Text is the block body for StepThinking and StepText.
	Text string
	// Tool is the call for StepTool.
	Tool *ToolStep
}

Step is one ordered block in a scripted demo turn: a thinking block, an answer text block, or a tool call (with its result). Rendered in order so the demo shows text → tool → text → tool interleaving, not clumped blocks.

type StepKind

type StepKind string

StepKind tags one scripted step in a KindTools demo.

const (
	StepThinking StepKind = "thinking"
	StepText     StepKind = "text"
	StepTool     StepKind = "tool"
)

type ToolStep

type ToolStep struct {
	ToolUseID   string
	Name        string
	ArgsJSON    string
	ResultText  string
	IsError     bool
	ResultDelay time.Duration
}

ToolStep is one canned tool call: the streamed args, result, and result timing mirroring a real tool_use + tool_result exchange.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL