agent

package
v0.0.0-...-f97c3c1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package agent implements 15 pre-designed agents used in TUMIX.

15 pre-designed agents used in TUMIX:

  • 1. w/o TTS (Base)
  • 2. CoT Agent (CoT)
  • 3. CoT-Code Agent (CoT code)
  • 4. Search Agent (S)
  • 5. Code Agent (C)
  • 6. Code Agent+ (C+)
  • 7. Dual-Tool Agent (CS gs)
  • 8. Dual-Tool Agent (CS llm)
  • 9. Dual-Tool Agent (CS com)
  • 10. Guided Agent (CSGgs)
  • 11. Guided Agent (CSGllm)
  • 12. Guided Agent (CSGcom)
  • 13. Guided Agent+ (CSG+gs)
  • 14. Guided Agent+ (CSG+llm)
  • 15. Guided Agent+ (CSG+com)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAutoAgents

func NewAutoAgents(llm model.LLM, genCfg *genai.GenerateContentConfig, n int) ([]agent.Agent, error)

NewAutoAgents creates n lightweight auto-designed agents.

They emulate the paper's LLM-designed variants by varying tool emphasis.

Each agent is given a specific focus: textual reasoning, code execution, or web search.

func NewBaseAgent

func NewBaseAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewBaseAgent creates a Base Agent that uses direct prompting to solve problems.

This agent is responsible for "1. w/o TTS (Base)".

func NewCoTAgent

func NewCoTAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewCoTAgent creates a CoT Agent that uses chain-of-thought reasoning to solve problems.

This agent is responsible for "2. CoT Agent (CoT)".

func NewCoTCodeAgent

func NewCoTCodeAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewCoTCodeAgent creates a CoT Code Agent that uses chain-of-thought reasoning and output code to solve problems.

This agent is responsible for "3. CoT-Code Agent (CoT code)".

func NewCodeAgent

func NewCodeAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewCodeAgent creates a Code Agent that uses code execution to solve problems.

This agent is responsible for "5. Code Agent (C)".

func NewCodePlusAgent

func NewCodePlusAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewCodePlusAgent creates a Code+ Agent that uses code execution with extra human-pre-designed priors to solve problems.

This agent is responsible for "6. Code Agent+ (C+)".

func NewDualToolComAgent

func NewDualToolComAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewDualToolComAgent creates a Dual-Tool Agent that uses both code execution and a combination of Google Search API and LLM search function to solve problems.

This agent is responsible for "9. Dual-Tool Agent (CS com)".

func NewDualToolGSAgent

func NewDualToolGSAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewDualToolGSAgent creates a Dual-Tool Agent that uses both code execution and Google Search API to solve problems.

This agent is responsible for "7. Dual-Tool Agent (CS gs)".

func NewDualToolLLMAgent

func NewDualToolLLMAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewDualToolLLMAgent creates a Dual-Tool Agent that uses both code execution and LLM search function to solve problems.

This agent is responsible for "8. Dual-Tool Agent (CS llm)".

func NewGuidedComAgent

func NewGuidedComAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewGuidedComAgent creates a Guided Agent that uses both code execution and a combination of Google Search API and LLM search function to solve problems.

This agent is responsible for "12. Guided Agent (CSGcom)".

func NewGuidedGSAgent

func NewGuidedGSAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewGuidedGSAgent creates a Guided Agent that uses both code execution and Google Search API to solve problems.

This agent is responsible for "10. Guided Agent (CSGgs)".

func NewGuidedLLMAgent

func NewGuidedLLMAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewGuidedLLMAgent creates a Guided Agent that uses both code execution and LLM search function to solve problems.

This agent is responsible for "11. Guided Agent (CSGllm)".

func NewGuidedPlusComAgent

func NewGuidedPlusComAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewGuidedPlusComAgent creates a Guided+ Agent that uses both code execution and combined search with extra priors.

This agent is responsible for "15. Guided Agent+ (CSG+com)".

func NewGuidedPlusGSAgent

func NewGuidedPlusGSAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewGuidedPlusGSAgent creates a Guided+ Agent that uses both code execution and Google Search API with extra priors.

This agent is responsible for "13. Guided Agent+ (CSG+gs)".

func NewGuidedPlusLLMAgent

func NewGuidedPlusLLMAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewGuidedPlusLLMAgent creates a Guided+ Agent that uses both code execution and LLM search with extra priors.

This agent is responsible for "14. Guided Agent+ (CSG+llm)".

func NewJudgeAgent

func NewJudgeAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewJudgeAgent creates a Judge Agent that evaluates candidate answers and decides whether to finalize or continue.

func NewRefinementAgent

func NewRefinementAgent(subAgents ...agent.Agent) (agent.Agent, error)

NewRefinementAgent creates a Refinement Agent that gathers candidate answers from sub-agents and judges the final answer.

func NewRoundAgent

func NewRoundAgent(subAgents ...agent.Agent) (agent.Agent, error)

NewRoundAgent creates a Round Agent that performs one TUMIX round: gathering candidates and judging.

func NewSearchAgent

func NewSearchAgent(llm model.LLM, genCfg *genai.GenerateContentConfig) (agent.Agent, error)

NewSearchAgent creates a Search Agent that uses web search to solve problems.

This agent is responsible for "4. Search Agent (S)".

func NewTumixAgent

func NewTumixAgent(candidates []agent.Agent, judge agent.Agent) (agent.Loader, error)

NewTumixAgent creates the TUMIX Agent that performs multi-agent test-time scaling with tool-use mixture.

func NewTumixAgentWithConfig

func NewTumixAgentWithConfig(cfg TumixConfig) (agent.Loader, error)

NewTumixAgentWithConfig creates an orchestrated TUMIX loader that propagates previous round answers and consults the judge for early stop.

func NewTumixAgentWithMaxRounds

func NewTumixAgentWithMaxRounds(candidates []agent.Agent, judge agent.Agent, maxRounds uint) (agent.Loader, error)

NewTumixAgentWithMaxRounds creates the TUMIX Agent with a configurable maximum number of iterations.

func Prompt

func Prompt() *dotprompt.Dotprompt

Types

type TumixConfig

type TumixConfig struct {
	Candidates []agent.Agent
	Judge      agent.Agent
	MaxRounds  uint
	MinRounds  uint
}

Directories

Path Synopsis
Package agenttest provides in-memory implementations of agent-related interfaces for testing.
Package agenttest provides in-memory implementations of agent-related interfaces for testing.

Jump to

Keyboard shortcuts

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