flows

package
v0.61.13 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefineAgentFlow

func DefineAgentFlow(g *genkit.Genkit, models []ai.Model, tools ...ai.ToolRef) *core.Flow[AgentInput, AgentOutput, struct{}]

DefineAgentFlow creates and registers the agent Genkit flow. The agent can use tools and reason over multiple steps.

func DefineAssistFlow

func DefineAssistFlow(g *genkit.Genkit, models []ai.Model) *core.Flow[AssistInput, AssistOutput, struct{}]

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

func DefineClipboardReadTool

func DefineClipboardReadTool(g *genkit.Genkit, readFn func() (string, error)) ai.ToolRef

DefineClipboardReadTool creates a tool that reads the current clipboard content. The actual clipboard access is injected via the provided function to keep the tool testable.

func DefineClipboardWriteTool

func DefineClipboardWriteTool(g *genkit.Genkit, writeFn func(string) error) ai.ToolRef

DefineClipboardWriteTool creates a tool that writes text to the clipboard. The actual clipboard access is injected via the provided function.

func DefineMeetingNotesFlow added in v0.59.0

func DefineMeetingNotesFlow(g *genkit.Genkit, models []ai.Model) *core.Flow[MeetingNotesInput, MeetingNotesOutput, struct{}]

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 DefineSummarizeFlow

func DefineSummarizeFlow(g *genkit.Genkit, models []ai.Model) *core.Flow[SummarizeInput, string, struct{}]

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

func DefineSummarizeTool

func DefineSummarizeTool(g *genkit.Genkit, summarizeFlow *core.Flow[SummarizeInput, string, struct{}]) ai.ToolRef

DefineSummarizeTool creates a tool that the agent can use to summarize text. It delegates to the summarize flow, avoiding logic duplication.

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 Genkit flow output (before TTS synthesis).

type ClipboardReadInput

type ClipboardReadInput struct {
}

ClipboardReadInput is the input schema for clipboard read tool.

type ClipboardWriteInput

type ClipboardWriteInput struct {
	Text string `json:"text" jsonschema_description:"Text to write to clipboard"`
}

ClipboardWriteInput is the input schema for clipboard write tool.

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"`
}

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"`
}

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.

type SummarizeToolInput

type SummarizeToolInput struct {
	Text        string `json:"text" jsonschema_description:"Text to summarize"`
	Instruction string `json:"instruction,omitempty" jsonschema_description:"Optional instruction for how to summarize"`
}

SummarizeToolInput is the input schema for the summarize tool (used by the agent).

Jump to

Keyboard shortcuts

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