dialogue

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDialogueSystemPrompt = `` /* 1798-byte string literal not displayed */

DefaultDialogueSystemPrompt is the default system prompt template used by ToolBasedDialogueGenerator. The template may contain a single "%s" placeholder for the language.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailbackDialogueGenerator

type FailbackDialogueGenerator[T any] struct {
	// contains filtered or unexported fields
}

func NewFailbackDialogueGenerator

func NewFailbackDialogueGenerator[T any](generators ...Generator[T]) *FailbackDialogueGenerator[T]

func (*FailbackDialogueGenerator[T]) GenerateDialogue

func (g *FailbackDialogueGenerator[T]) GenerateDialogue(ctx context.Context, req *types.ToolRequest[T]) (string, error)

func (*FailbackDialogueGenerator[T]) GenerateDialogueStream

func (g *FailbackDialogueGenerator[T]) GenerateDialogueStream(ctx context.Context, req *types.ToolRequest[T]) (*schema.StreamReader[string], error)

type Generator

type Generator[T any] interface {
	GenerateDialogue(ctx context.Context, req *types.ToolRequest[T]) (string, error)
	GenerateDialogueStream(ctx context.Context, req *types.ToolRequest[T]) (*schema.StreamReader[string], error)
}

type GeneratorOption added in v0.0.2

type GeneratorOption[T any] func(*dialogueGeneratorOptions[T])

func WithDialoguePromptBuilder added in v0.0.3

func WithDialoguePromptBuilder[T any](promptBuilder PromptBuilder[T]) GeneratorOption[T]

func WithDialogueSystemPromptTemplate added in v0.0.2

func WithDialogueSystemPromptTemplate[T any](systemPromptTemplate string) GeneratorOption[T]

type LocalDialogueGenerator

type LocalDialogueGenerator[T any] struct {
	MergeAllUnvalidatedFields bool
}

func (*LocalDialogueGenerator[T]) GenerateDialogue

func (g *LocalDialogueGenerator[T]) GenerateDialogue(ctx context.Context, req *types.ToolRequest[T]) (string, error)

func (*LocalDialogueGenerator[T]) GenerateDialogueStream

func (g *LocalDialogueGenerator[T]) GenerateDialogueStream(ctx context.Context, req *types.ToolRequest[T]) (*schema.StreamReader[string], error)

type PromptBuilder added in v0.0.3

type PromptBuilder[T any] func(systemPrompt string) func(ctx context.Context, req *types.ToolRequest[T]) ([]*schema.Message, error)

type ToolBasedDialogueGenerator

type ToolBasedDialogueGenerator[T any] struct {
	// contains filtered or unexported fields
}

func NewToolBasedDialogueGenerator

func NewToolBasedDialogueGenerator[T any](chatModel model.ToolCallingChatModel, opts ...GeneratorOption[T]) *ToolBasedDialogueGenerator[T]

func (*ToolBasedDialogueGenerator[T]) GenerateDialogue

func (g *ToolBasedDialogueGenerator[T]) GenerateDialogue(ctx context.Context, req *types.ToolRequest[T]) (string, error)

func (*ToolBasedDialogueGenerator[T]) GenerateDialogueStream

func (g *ToolBasedDialogueGenerator[T]) GenerateDialogueStream(ctx context.Context, req *types.ToolRequest[T]) (*schema.StreamReader[string], error)

Jump to

Keyboard shortcuts

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