agents

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Code generated by script/gen_models.go. DO NOT EDIT. To regenerate: go run agents/script/gen_models.go Source: https://models.dev/api.json

Index

Constants

This section is empty.

Variables

View Source
var (
	DeepseekBaseURL       = "https://api.deepseek.com/v1"
	OpenAIBaseURL         = "https://api.openai.com/v1"
	AliBailianIntlBaseURL = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
	AliBailianCnBaseURL   = "https://dashscope.aliyuncs.com/compatible-mode/v1"
	OpenRouterBaseURL     = "https://openrouter.ai/api/v1"
)
View Source
var ModelContextWindow = map[string]int{}/* 2624 elements not displayed */

ModelContextWindow maps model IDs to their context window size in tokens. Used to auto-detect MaxTokens when not explicitly configured.

Functions

func LookupModelContextWindow added in v0.0.23

func LookupModelContextWindow(rail flow.Rail, modelName string, enableFetch bool) (int, bool)

LookupModelContextWindow returns the context window size for a model. First checks the build-time generated map (ModelContextWindow), then the process-level in-memory cache. If not found and enableFetch is true, fetches from models.dev and populates the cache.

func NewExecutiveSummaryWriterOps

func NewExecutiveSummaryWriterOps(g *graph.GenericOps) *executiveSummaryWriterOps

func RetryChatModel

RetryChatModel wraps c with a default retry count of 5.

func WithBaseURL added in v0.0.11

func WithBaseURL(url string) func(o *openAiModelConfig)

func WithMaxToken

func WithMaxToken(n int) func(o *openAiModelConfig)

func WithRetry

func WithRetry(n int) func(o *openAiModelConfig)

func WithStreamingToolCall added in v0.0.15

func WithStreamingToolCall() func(o *openAiModelConfig)

WithStreamingToolCall forces Generate() to use Stream()+collect internally. Use this when the model endpoint rejects non-streaming tool calls (e.g. some Alibaba DashScope endpoints that validate "function.arguments" strictly and return HTTP 400 in non-streaming mode).

func WithTemperature

func WithTemperature(n float32) func(o *openAiModelConfig)

Types

type DeepResearchClarifier added in v0.0.4

type DeepResearchClarifier struct {
	// contains filtered or unexported fields
}

func NewDeepResearchClarifier added in v0.0.4

func NewDeepResearchClarifier(rail flow.Rail, chatModel model.ToolCallingChatModel, ops *DeepResearchClarifierOps) (*DeepResearchClarifier, error)

func (*DeepResearchClarifier) Execute added in v0.0.4

type DeepResearchClarifierInput added in v0.0.4

type DeepResearchClarifierInput struct {
	Now          string `json:"now"`
	Conversation string `json:"conversation"`
	Memory       string `json:"memory"`
}

type DeepResearchClarifierOps added in v0.0.4

type DeepResearchClarifierOps struct {

	// Injected variables: ${language}
	SystemMessagePrompt string

	// Injected variables: ${now} ${conversation}, ${memory}
	UserMessagePrompt string
	// contains filtered or unexported fields
}

func NewDeepResearchClarifierOps added in v0.0.4

func NewDeepResearchClarifierOps(g *graph.GenericOps) *DeepResearchClarifierOps

type DeepResearchClarifierOutput added in v0.0.4

type DeepResearchClarifierOutput struct {
	Title       string `json:"title"`
	Description string `json:"description"`
}

type ExecutiveSummaryWriter

type ExecutiveSummaryWriter struct {
	// contains filtered or unexported fields
}

func NewExecutiveSummaryWriter

func NewExecutiveSummaryWriter(rail flow.Rail, chatModel model.ToolCallingChatModel, ops *executiveSummaryWriterOps) (*ExecutiveSummaryWriter, error)

func (*ExecutiveSummaryWriter) Execute

type ExecutiveSummaryWriterInput

type ExecutiveSummaryWriterInput struct {
	Report  string `json:"report"`
	Context string `json:"context"`
}

type ExecutiveSummaryWriterOutput

type ExecutiveSummaryWriterOutput struct {
	Summary string `json:"summary"`
}

type ExtractFieldSpec added in v0.0.6

type ExtractFieldSpec struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Example     string `json:"example"`
}

type ExtractFieldSpecs added in v0.0.6

type ExtractFieldSpecs []ExtractFieldSpec

type Material added in v0.0.6

type Material struct {
	Content string `json:"content"`
	Source  string `json:"source"`
}

type MaterialExtract added in v0.0.6

type MaterialExtract struct {
	// contains filtered or unexported fields
}

func NewMaterialExtract added in v0.0.6

func NewMaterialExtract(rail flow.Rail, chatModel model.ToolCallingChatModel, ops *MaterialExtractOps) (*MaterialExtract, error)

func (*MaterialExtract) Execute added in v0.0.6

Execute.

If there are lots of fields, use MaterialExtract.ParallelExecute instead.

func (*MaterialExtract) ParallelExecute added in v0.0.9

func (b *MaterialExtract) ParallelExecute(rail flow.Rail, input MaterialExtractInput, batchSize int, pool async.AsyncPool) (MaterialExtractOutput, error)

type MaterialExtractInput added in v0.0.6

type MaterialExtractInput struct {
	Context   string             `json:"context"`
	Materials []Material         `json:"materials"`
	Fields    []ExtractFieldSpec `json:"fields"`
	// contains filtered or unexported fields
}

type MaterialExtractOps added in v0.0.6

type MaterialExtractOps struct {

	// Injected variables: ${context}, ${language}, ${now}
	SystemMessagePrompt string

	// Injected variables: ${materials}, ${fields}, ${extractedInfo}
	UserMessagePrompt string

	TimeZoneHourOffset float64
	// contains filtered or unexported fields
}

func NewMaterialExtractOps added in v0.0.6

func NewMaterialExtractOps(g *graph.GenericOps) *MaterialExtractOps

type MaterialExtractOutput added in v0.0.6

type MaterialExtractOutput struct {
	ExtractedInfo map[string]string `json:"extractedInfo"`
}

type MemorySummarizer added in v0.0.5

type MemorySummarizer struct {
	// contains filtered or unexported fields
}

func NewMemorySummarizer added in v0.0.5

func NewMemorySummarizer(rail flow.Rail, chatModel model.ToolCallingChatModel, ops *MemorySummarizerOps) (*MemorySummarizer, error)

func (*MemorySummarizer) Execute added in v0.0.5

type MemorySummarizerInput added in v0.0.5

type MemorySummarizerInput struct {
	LongTermMemory     string `json:"longTermMemory"`
	RecentConversation string `json:"recentConversation"`
}

type MemorySummarizerOps added in v0.0.5

type MemorySummarizerOps struct {

	// Injected variables: ${language}
	SystemMessagePrompt string

	// Injected variables: ${context}, ${report}
	UserMessagePrompt string
	// contains filtered or unexported fields
}

func NewMemorySummarizerOps added in v0.0.5

func NewMemorySummarizerOps(g *graph.GenericOps) *MemorySummarizerOps

type MemorySummarizerOutput added in v0.0.5

type MemorySummarizerOutput struct {
	Summary string `json:"summary"`
}

type ModelNamer added in v0.0.23

type ModelNamer interface {
	ModelName() string
}

ModelNamer is implemented by chat models that expose their underlying model name.

type OpenAIChatModel added in v0.0.23

type OpenAIChatModel struct {
	// contains filtered or unexported fields
}

OpenAIChatModel is the public concrete type returned by NewOpenAIChatModel. It wraps the internal layered model (retry → contentFix → optionally streamingTool) and exposes the model name via ModelName().

func NewOpenAIChatModel

func NewOpenAIChatModel(modelName, apiKey string, ops ...func(o *openAiModelConfig)) (*OpenAIChatModel, error)

NewOpenAIChatModel creates a new OpenAI-compatible chat model.

Example:

model, err := NewOpenAIChatModel("qwen3-max", apiKey,
    WithTemperature(0.3),
    WithMaxToken(32768),
    WithRetry(3),
)

func (*OpenAIChatModel) Generate added in v0.0.23

func (m *OpenAIChatModel) Generate(ctx context.Context, input []*schema.Message, opts ...model.Option) (*schema.Message, error)

func (*OpenAIChatModel) ModelName added in v0.0.23

func (m *OpenAIChatModel) ModelName() string

func (*OpenAIChatModel) Stream added in v0.0.23

func (m *OpenAIChatModel) Stream(ctx context.Context, input []*schema.Message, opts ...model.Option) (*schema.StreamReader[*schema.Message], error)

func (*OpenAIChatModel) WithTools added in v0.0.23

func (m *OpenAIChatModel) WithTools(tools []*schema.ToolInfo) (model.ToolCallingChatModel, error)

type OpenAIChatModelOpt added in v0.0.26

type OpenAIChatModelOpt = func(o *openAiModelConfig)

OpenAIChatModelOpt is a functional option for NewOpenAIChatModel.

type Rule added in v0.0.6

type Rule struct {
	Name    string `json:"name"`
	Content string `json:"content"`
}

type RuleMatcher added in v0.0.6

type RuleMatcher struct {
	// contains filtered or unexported fields
}

func NewRuleMatcher added in v0.0.6

func NewRuleMatcher(rail flow.Rail, chatModel model.ToolCallingChatModel, ops *RuleMatcherOps) (*RuleMatcher, error)

func (*RuleMatcher) Execute added in v0.0.6

func (b *RuleMatcher) Execute(rail flow.Rail, input RuleMatcherInput) (RuleMatcherOutput, error)

Execute.

If there are lots of rules, use RuleMatcher.ParallelExecute instead.

func (*RuleMatcher) ParallelExecute added in v0.0.9

func (b *RuleMatcher) ParallelExecute(rail flow.Rail, input RuleMatcherInput, batchSize int, pool async.AsyncPool) (RuleMatcherOutput, error)

type RuleMatcherInput added in v0.0.6

type RuleMatcherInput struct {
	// Additional instruction about the task
	//
	// How should LLM make decision on whether the target matches the given rule or not.
	TaskInstruction string `json:"taskInstruction"`

	// context about the target
	//
	// e.g., if we are running a background check for a company, the context will be the information about the company.
	Context string `json:"context"`

	// Rules
	Rules []Rule `json:"Rules"`
	// contains filtered or unexported fields
}

type RuleMatcherOps added in v0.0.6

type RuleMatcherOps struct {

	// Injected variables: ${taskInstruction}, ${language}, ${now}
	SystemMessagePrompt string

	// Injected variables: ${rule}, ${context}
	UserMessagePrompt string

	TimeZoneHourOffset float64
	// contains filtered or unexported fields
}

func NewRuleMatcherOps added in v0.0.6

func NewRuleMatcherOps(g *graph.GenericOps) *RuleMatcherOps

type RuleMatcherOutput added in v0.0.6

type RuleMatcherOutput struct {
	Rules []RuleResult `json:"rules"`
}

type RuleResult added in v0.0.6

type RuleResult struct {
	Matched bool   `json:"matched"`
	Name    string `json:"name"`
	Reason  string `json:"reason"`
}

Jump to

Keyboard shortcuts

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