structured

package
v0.0.0-...-99d71fe Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StructuredAgent

type StructuredAgent[O any] struct {
	Name               string
	SystemInstructions string
	ModelID            string

	Messages []*ai.Message

	Config models.ModelConfig
	// contains filtered or unexported fields
}

func NewStructuredAgent

func NewStructuredAgent[O any](
	ctx context.Context,
	structuredAgentConfig agents.AgentConfig,
	modelConfig models.ModelConfig,
	opts ...StructuredAgentOption[O],
) (*StructuredAgent[O], error)

NewStructuredAgent creates a new StructuredAgent that generates structured data of type O.

func (*StructuredAgent[O]) GenerateStructuredData

func (structuredAgent *StructuredAgent[O]) GenerateStructuredData(text string) (*O, error)

GenerateStructuredData generates structured data of type O based on the input text.

func (*StructuredAgent[O]) Kind

func (agent *StructuredAgent[O]) Kind() agents.AgentKind

Kind returns the kind of the agent.

type StructuredAgentOption

type StructuredAgentOption[O any] func(*StructuredAgent[O])

StructuredAgentOption defines a functional option for configuring StructuredAgent

func WithLogLevel

func WithLogLevel[O any](level logger.LogLevel) StructuredAgentOption[O]

WithLogLevel sets the log level for the agent

func WithLogger

func WithLogger[O any](log logger.Logger) StructuredAgentOption[O]

WithLogger sets a custom logger for the agent

func WithVerbose

func WithVerbose[O any](verbose bool) StructuredAgentOption[O]

WithVerbose enables verbose logging (INFO level) with agent name prefix