dialogue

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultDialogueSystemPromptTemplate = `` /* 675-byte string literal not displayed */

DefaultDialogueSystemPromptTemplate 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 func(*dialogueGeneratorOptions)

func WithDialogueLang added in v0.0.2

func WithDialogueLang(lang string) GeneratorOption

WithDialogueLang sets the language used by the default system prompt template.

func WithDialogueSystemPrompt added in v0.0.2

func WithDialogueSystemPrompt(systemPrompt string) GeneratorOption

WithDialogueSystemPrompt overrides the system prompt used by ToolBasedDialogueGenerator.

func WithDialogueSystemPromptTemplate added in v0.0.2

func WithDialogueSystemPromptTemplate(systemPromptTemplate string) GeneratorOption

WithDialogueSystemPromptTemplate overrides the system prompt template used by ToolBasedDialogueGenerator. If the template contains "%s", it will be formatted with the language.

type LocalDialogueGenerator

type LocalDialogueGenerator[T any] struct{}

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 ToolBasedDialogueGenerator

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

func NewToolBasedDialogueGenerator

func NewToolBasedDialogueGenerator[T any](chatModel model.ToolCallingChatModel, opts ...GeneratorOption) *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