flows

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConfigured = errors.New("AI flow is not configured")

Functions

This section is empty.

Types

type AgentInput

type AgentInput struct {
	Utterance         string `json:"utterance"`
	Locale            string `json:"locale,omitempty"`
	Selection         string `json:"selection,omitempty"`
	LastTranscription string `json:"lastTranscription,omitempty"`
	SystemPrompt      string `json:"systemPrompt,omitempty"`
}

AgentInput is the input for the agent flow.

type AgentOutput

type AgentOutput struct {
	Text   string `json:"text"`
	Action string `json:"action"` // "paste", "display", "silent"
}

AgentOutput is the output of the agent flow.

type AssistInput

type AssistInput struct {
	Utterance string `json:"utterance"`           // The user's spoken text
	Locale    string `json:"locale,omitempty"`    // "de", "en", etc.
	Selection string `json:"selection,omitempty"` // Text currently selected in the active window
	Context   string `json:"context,omitempty"`   // Additional context (last transcription, active app, etc.)
}

AssistInput is the input for the assist flow.

type AssistOutput

type AssistOutput struct {
	Text      string `json:"text"`      // Full LLM response text (always present)
	SpeakText string `json:"speakText"` // TTS-optimized text (shorter, more natural than Text)
	Action    string `json:"action"`    // "respond", "execute", "silent"
	Locale    string `json:"locale"`    // Response language
}

AssistOutput is the Assist flow output (before TTS synthesis).

type Flow added in v0.70.2

type Flow[Input, Output any] struct {
	// contains filtered or unexported fields
}

Flow is SpeechKit's small typed execution wrapper. It replaces the prior framework-specific flow type while preserving the public Run boundary used by Assist, summaries, and the Voice Agent.

func DefineAgentFlow

func DefineAgentFlow(models []appai.Model) *Flow[AgentInput, AgentOutput]

DefineAgentFlow creates the agent flow.

func DefineAgentFlowWithGenerator added in v0.67.0

func DefineAgentFlowWithGenerator(generator generation.Generator) *Flow[AgentInput, AgentOutput]

func DefineAssistFlow

func DefineAssistFlow(models []appai.Model) *Flow[AssistInput, AssistOutput]

DefineAssistFlow creates the assist flow for single-turn voice interactions. Optimized for speed: uses assist models, short responses, low temperature.

func DefineAssistFlowWithGenerator added in v0.67.0

func DefineAssistFlowWithGenerator(generator generation.Generator) *Flow[AssistInput, AssistOutput]

func DefineMeetingNotesFlow added in v0.59.0

func DefineMeetingNotesFlow(models []appai.Model) *Flow[MeetingNotesInput, MeetingNotesOutput]

DefineMeetingNotesFlow registers the meeting-notes flow.

It merges the transcript, the user's own notes and a template into structured notes where every bullet cites the transcript it came from. Models are tried in order; the first that produces usable output wins.

func DefineMeetingNotesFlowWithGenerator added in v0.67.0

func DefineMeetingNotesFlowWithGenerator(generator generation.Generator) *Flow[MeetingNotesInput, MeetingNotesOutput]

func DefineSummarizeFlow

func DefineSummarizeFlow(models []appai.Model) *Flow[SummarizeInput, string]

DefineSummarizeFlow creates the summarize flow. Models are tried in order; first successful response wins.

func DefineSummarizeFlowWithGenerator added in v0.67.0

func DefineSummarizeFlowWithGenerator(generator generation.Generator) *Flow[SummarizeInput, string]

func New added in v0.70.2

func New[Input, Output any](run func(context.Context, Input) (Output, error)) *Flow[Input, Output]

func (*Flow[Input, Output]) Run added in v0.70.2

func (f *Flow[Input, Output]) Run(ctx context.Context, input Input) (Output, error)

type MeetingNotesInput added in v0.59.0

type MeetingNotesInput struct {
	Title    string           `json:"title,omitempty"`
	Locale   string           `json:"locale,omitempty"`
	Template meeting.Template `json:"template"`
	// Anchors are the notes the user typed during the meeting. They say what
	// mattered to the person who was there; the transcript supplies the context
	// around them.
	Anchors []meeting.Anchor `json:"anchors,omitempty"`
	// Transcript is what was said, already deduplicated and ordered.
	Transcript []meeting.TranscriptLine `json:"transcript"`
	// ContextWindowTokens is what the model can hold. Zero means "assume a
	// large one" and take the single-pass route.
	ContextWindowTokens int `json:"contextWindowTokens,omitempty"`
	// ModelID pins every call of the run to one model. Empty lets the
	// generator fall through its models per call.
	ModelID string `json:"modelId,omitempty"`
}

MeetingNotesInput is one meeting to write up.

type MeetingNotesOutput added in v0.59.0

type MeetingNotesOutput struct {
	Document meeting.NotesDocument `json:"document"`
	// Structured is false when no model returned parseable structure and the
	// notes are prose only. Callers surface that rather than pretending the
	// bullets carry provenance.
	Structured bool `json:"structured"`
	// Passes counts the model calls it took, so a slow local run is explicable.
	Passes   int    `json:"passes"`
	Provider string `json:"provider,omitempty"`
	Model    string `json:"model,omitempty"`
}

MeetingNotesOutput is the finished write-up, plus how it was produced.

type SummarizeInput

type SummarizeInput struct {
	Text        string `json:"text"`
	Instruction string `json:"instruction,omitempty"`
	Locale      string `json:"locale,omitempty"`
}

SummarizeInput is the input for the summarize flow.

Jump to

Keyboard shortcuts

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