smolagents

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package smolagents provides a Go implementation of an AI agent framework.

This library offers a comprehensive framework for building AI agents with advanced reasoning capabilities, leveraging Go's type system and conventions.

The library provides: - Multi-step AI agents using the ReAct framework - Tool calling agents for function-based interactions - Code execution agents with sandboxed Go interpreter - Comprehensive tool ecosystem - Memory management for conversation history - Model abstractions for different LLM backends - Built-in monitoring and logging

Index

Constants

View Source
const Version = "1.18.0"

Variables

View Source
var (
	// Agent constructors
	NewBaseMultiStepAgent        = agents.NewBaseMultiStepAgent
	NewReactCodeAgent            = agents.NewReactCodeAgent
	DefaultReactCodeAgentOptions = agents.DefaultReactCodeAgentOptions
	CreateAgent                  = agents.CreateAgent
	DefaultAgentConfig           = agents.DefaultAgentConfig

	// Model constructors
	NewInferenceClientModel    = models.NewInferenceClientModel
	NewOpenAIServerModel       = models.NewOpenAIServerModel
	NewAzureOpenAIServerModel  = models.NewAzureOpenAIServerModel
	NewLiteLLMModel            = models.NewLiteLLMModel
	NewAmazonBedrockModel      = models.NewAmazonBedrockModel
	NewTransformersModel       = models.NewTransformersModelImpl
	CreateModel                = models.CreateModel
	AutoDetectModelType        = models.AutoDetectModelType
	ValidateModelConfiguration = models.ValidateModelConfiguration
	GetModelInfo               = models.GetModelInfo

	// Structured generation constructors
	NewSchemaValidator       = models.NewSchemaValidator
	NewStructuredGenerator   = models.NewStructuredGenerator
	CreateJSONSchema         = models.CreateJSONSchema
	CreateToolCallSchema     = models.CreateToolCallSchema
	CreateFunctionCallSchema = models.CreateFunctionCallSchema
	ParseStructuredOutput    = models.ParseStructuredOutput
	GenerateStructuredPrompt = models.GenerateStructuredPrompt

	// Multimodal constructors
	NewMultimodalSupport = models.NewMultimodalSupport
	LoadImage            = models.LoadImage
	LoadImageURL         = models.LoadImageURL
	LoadAudio            = models.LoadAudio
	LoadVideo            = models.LoadVideo
	CreateText           = models.CreateText
	CreateMessage        = models.CreateMessage
)

Constructor functions

Functions

This section is empty.

Types

type ActionStep

type ActionStep = memory.ActionStep

Memory system

type AgentAudio

type AgentAudio = agent_types.AgentAudio

Agent types

type AgentConfig

type AgentConfig = agents.AgentConfig

Core agent interfaces and types

type AgentError

type AgentError = utils.AgentError

Error types

type AgentExecutionError

type AgentExecutionError = utils.AgentExecutionError

Error types

type AgentGenerationError

type AgentGenerationError = utils.AgentGenerationError

Error types

type AgentImage

type AgentImage = agent_types.AgentImage

Agent types

type AgentLogger

type AgentLogger = monitoring.AgentLogger

Monitoring and logging

type AgentMaxStepsError

type AgentMaxStepsError = utils.AgentMaxStepsError

Error types

type AgentMemory

type AgentMemory = memory.AgentMemory

Memory system

type AgentParsingError

type AgentParsingError = utils.AgentParsingError

Error types

type AgentText

type AgentText = agent_types.AgentText

Agent types

type AgentToolCallError

type AgentToolCallError = utils.AgentToolCallError

Error types

type AgentToolExecutionError

type AgentToolExecutionError = utils.AgentToolExecutionError

Error types

type AgentType

type AgentType = agent_types.AgentType

Agent types

type AmazonBedrockModel

type AmazonBedrockModel = models.AmazonBedrockModel

Model system

type AudioData

type AudioData = models.AudioData

Model system

type AzureOpenAIServerModel

type AzureOpenAIServerModel = models.AzureOpenAIServerModel

Model system

type BaseMultiStepAgent

type BaseMultiStepAgent = agents.BaseMultiStepAgent

Core agent interfaces and types

type BaseTool

type BaseTool = tools.BaseTool

Tool system

type ChatMessage

type ChatMessage = models.ChatMessage

Model system

type ChatMessageStreamDelta

type ChatMessageStreamDelta = models.ChatMessageStreamDelta

Model system

type ChatMessageToolCall

type ChatMessageToolCall = models.ChatMessageToolCall

Model system

type FinalAnswerStep

type FinalAnswerStep = memory.FinalAnswerStep

Memory system

type FinalOutput

type FinalOutput = agents.FinalOutput

Core agent interfaces and types

type GenerateOptions

type GenerateOptions = models.GenerateOptions

Model system

type ImageURL

type ImageURL = models.ImageURL

Model system

type InferenceClientModel

type InferenceClientModel = models.InferenceClientModel

Model system

type JSONSchema

type JSONSchema = models.JSONSchema

Model system

type LiteLLMModel

type LiteLLMModel = models.LiteLLMModel

Model system

type LogLevel

type LogLevel = monitoring.LogLevel

Monitoring and logging

type MediaContent

type MediaContent = models.MediaContent

Model system

type MediaType

type MediaType = models.MediaType

Multimodal types

type MemoryStep

type MemoryStep = memory.MemoryStep

Memory system

type Message

type Message = memory.Message

Memory system

type MessageRole

type MessageRole = models.MessageRole

Model system

type Model

type Model = models.Model

Model system

type ModelType

type ModelType = models.ModelType

Model system

type Monitor

type Monitor = monitoring.Monitor

Monitoring and logging

type MultiStepAgent

type MultiStepAgent = agents.MultiStepAgent

Core agent interfaces and types

type MultimodalMessage

type MultimodalMessage = models.MultimodalMessage

Model system

type MultimodalSupport

type MultimodalSupport = models.MultimodalSupport

Model system

type OpenAIServerModel

type OpenAIServerModel = models.OpenAIServerModel

Model system

type PlanningStep

type PlanningStep = memory.PlanningStep

Memory system

type PromptTemplates

type PromptTemplates = agents.PromptTemplates

Core agent interfaces and types

type ReactCodeAgent

type ReactCodeAgent = agents.ReactCodeAgent

Core agent interfaces and types

type ReactCodeAgentOptions

type ReactCodeAgentOptions = agents.ReactCodeAgentOptions

Core agent interfaces and types

type ResponseFormat

type ResponseFormat = models.ResponseFormat

Structured generation types

type RunOptions

type RunOptions = agents.RunOptions

Core agent interfaces and types

type RunResult

type RunResult = agents.RunResult

Core agent interfaces and types

type SchemaValidator

type SchemaValidator = models.SchemaValidator

Model system

type StepCallback

type StepCallback = agents.StepCallback

Core agent interfaces and types

type StreamStepResult

type StreamStepResult = agents.StreamStepResult

Core agent interfaces and types

type StructuredGenerator

type StructuredGenerator = models.StructuredGenerator

Model system

type StructuredOutput

type StructuredOutput = models.StructuredOutput

Model system

type SystemPromptStep

type SystemPromptStep = memory.SystemPromptStep

Memory system

type TaskStep

type TaskStep = memory.TaskStep

Memory system

type Timing

type Timing = monitoring.Timing

Monitoring and logging

type TokenUsage

type TokenUsage = monitoring.TokenUsage

Monitoring and logging

type Tool

type Tool = tools.Tool

Tool system

type ToolCall

type ToolCall = memory.ToolCall

Memory system

type ToolCollection

type ToolCollection = tools.ToolCollection

Tool system

type ToolInput

type ToolInput = tools.ToolInput

Tool system

type TransformersModel

type TransformersModel = models.TransformersModel

Model system

type VideoData

type VideoData = models.VideoData

Model system

Directories

Path Synopsis
Package agent_types provides types that can be returned by agents.
Package agent_types provides types that can be returned by agents.
Package agents provides the core agent implementations for smolagents.
Package agents provides the core agent implementations for smolagents.
Package default_tools provides built-in tools for smolagents.
Package default_tools provides built-in tools for smolagents.
Package display provides beautiful CLI output formatting for smolagents
Package display provides beautiful CLI output formatting for smolagents
Package executors provides code execution capabilities for smolagents.
Package executors provides code execution capabilities for smolagents.
Package memory provides memory management for agent conversations and execution history.
Package memory provides memory management for agent conversations and execution history.
Package models - AmazonBedrockModel implementation
Package models - AmazonBedrockModel implementation
Package monitoring provides logging and monitoring capabilities for agent execution.
Package monitoring provides logging and monitoring capabilities for agent execution.
Package tools - ToolCollection and Pipeline functionality
Package tools - ToolCollection and Pipeline functionality
Package utils provides utility functions and error types for the smolagents library.
Package utils provides utility functions and error types for the smolagents library.

Jump to

Keyboard shortcuts

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