Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/browser-use/agent-sdk
/ types & classes
Types & classes
64 in github.com/browser-use/agent-sdk
⨍
Functions
249
◇
Types & classes
64
↳
Endpoints
2
↓ 21 callers
Class
UserMessage
bu_agent_sdk/llm/messages.py:213
↓ 16 callers
Class
ToolMessage
Message containing tool execution result. This is used to send tool results back to the model after it has made a tool call. - OpenAI: Serialized a
bu_agent_sdk/llm/messages.py:337
↓ 15 callers
Class
AssistantMessage
bu_agent_sdk/llm/messages.py:274
↓ 11 callers
Class
Depends
Dependency injection marker, similar to FastAPI's Depends. The dependency callable will be invoked when the tool is called, and its return value
bu_agent_sdk/tools/depends.py:29
↓ 11 callers
Class
Function
bu_agent_sdk/llm/messages.py:158
↓ 10 callers
Class
ToolCall
bu_agent_sdk/llm/messages.py:178
↓ 8 callers
Class
ModelProviderError
Exception raised when a model provider returns an error.
bu_agent_sdk/llm/exceptions.py:5
↓ 6 callers
Class
SystemMessage
bu_agent_sdk/llm/messages.py:246
↓ 6 callers
Class
ToolDefinition
Definition of a tool that can be called by the model. This is a provider-agnostic representation that gets serialized appropriately for each
bu_agent_sdk/llm/base.py:16
↓ 3 callers
Class
ChatGoogle
A wrapper around Google's Gemini chat model using the genai client. This class provides tool calling support for Google Gemini models.
bu_agent_sdk/llm/google/chat.py:44
↓ 3 callers
Class
ChatInvokeCompletion
Response from a chat model invocation. For tool calling workflows: - If the model wants to call tools, `tool_calls` will be populated an
bu_agent_sdk/llm/views.py:30
↓ 3 callers
Class
ChatInvokeUsage
Usage information for a chat model invocation.
bu_agent_sdk/llm/views.py:6
↓ 3 callers
Class
ChatOpenAI
A wrapper around AsyncOpenAI that implements the BaseChatModel protocol. This class provides tool calling support for OpenAI models. Ex
bu_agent_sdk/llm/openai/chat.py:25
↓ 3 callers
Class
CompactionResult
Result of a compaction operation. Attributes: compacted: Whether compaction was performed. original_tokens: Token count b
bu_agent_sdk/agent/compaction/models.py:70
↓ 3 callers
Class
FinalResponseEvent
Emitted when the agent produces its final response.
bu_agent_sdk/agent/events.py:103
↓ 3 callers
Class
TextEvent
Emitted when the assistant produces text content.
bu_agent_sdk/agent/events.py:28
↓ 2 callers
Class
Agent
Simple agentic loop that manages tool calling and message history. The agent will: 1. Send the task to the LLM with available tools
bu_agent_sdk/agent/service.py:99
↓ 2 callers
Class
ModelPricing
Pricing information for a model
bu_agent_sdk/tokens/views.py:53
↓ 2 callers
Class
ModelRateLimitError
Exception raised when a model provider returns a rate limit error.
bu_agent_sdk/llm/exceptions.py:20
↓ 2 callers
Class
ToolResultEvent
Emitted when a tool returns a result.
bu_agent_sdk/agent/events.py:77
↓ 2 callers
Class
UsageSummary
Summary of token usage and costs
bu_agent_sdk/tokens/views.py:97
↓ 1 callers
Class
CachedPricingData
Cached pricing data with timestamp
bu_agent_sdk/tokens/views.py:68
↓ 1 callers
Class
CompactionConfig
Configuration for the compaction service. The compaction service monitors token usage and automatically summarizes conversation history when
bu_agent_sdk/agent/compaction/models.py:49
↓ 1 callers
Class
CompactionService
Service for managing conversation context through compaction. The service monitors token usage after each LLM response and triggers compactio
bu_agent_sdk/agent/compaction/service.py:38
↓ 1 callers
Class
Database
Simulated database with some user data.
bu_agent_sdk/examples/dependency_injection.py:23
↓ 1 callers
Class
HiddenUserMessageEvent
Emitted when the agent injects a hidden user message (ex: incomplete todos prompt). Hidden messages are saved to history and sent to the LLM but not
bu_agent_sdk/agent/events.py:181
↓ 1 callers
Class
ImageURL
bu_agent_sdk/llm/messages.py:126
↓ 1 callers
Class
ModelUsageStats
Usage statistics for a single model
bu_agent_sdk/tokens/views.py:75
↓ 1 callers
Class
ModelUsageTokens
Usage tokens for a single model
bu_agent_sdk/tokens/views.py:87
↓ 1 callers
Class
SecurityError
Raised when a path escapes the sandbox.
bu_agent_sdk/examples/claude_code.py:31
↓ 1 callers
Class
StepCompleteEvent
Emitted when a step completes.
bu_agent_sdk/agent/events.py:163
↓ 1 callers
Class
StepStartEvent
Emitted when the agent starts a logical step (tool execution group).
bu_agent_sdk/agent/events.py:146
↓ 1 callers
Class
TestSerializerToolCalls
Test serializer handles tool calls correctly.
bu_agent_sdk/llm/google/tests/test_agent_mode.py:58
↓ 1 callers
Class
ThinkingEvent
Emitted when the model produces thinking/reasoning content.
bu_agent_sdk/agent/events.py:40
↓ 1 callers
Class
TokenCost
Service for tracking token usage and calculating costs
bu_agent_sdk/tokens/service.py:40
↓ 1 callers
Class
TokenCostCalculated
Token cost
bu_agent_sdk/tokens/views.py:19
↓ 1 callers
Class
TokenUsage
Token usage tracking for compaction decisions. Attributes: input_tokens: Number of input tokens. output_tokens: Number of
bu_agent_sdk/agent/compaction/models.py:87
↓ 1 callers
Class
TokenUsageEntry
Single token usage entry
bu_agent_sdk/tokens/views.py:11
↓ 1 callers
Class
Tool
Wrapper class for a tool function with its metadata and definition. This class is created by the @tool decorator and provides: - Automat
bu_agent_sdk/tools/decorator.py:155
↓ 1 callers
Class
ToolCallEvent
Emitted when the assistant calls a tool.
bu_agent_sdk/agent/events.py:52
Class
AnthropicMessageSerializer
Serializer for converting between custom message types and Anthropic message param types.
bu_agent_sdk/llm/anthropic/serializer.py:35
Class
BaseChatModel
Protocol defining the interface for chat models. All LLM implementations (OpenAI, Anthropic, Google, etc.) must implement this protocol.
bu_agent_sdk/llm/base.py:55
Class
ChatAnthropic
A wrapper around Anthropic's chat model.
bu_agent_sdk/llm/anthropic/chat.py:38
Class
ChatOpenAILike
A class for to interact with any provider using the OpenAI API schema. Args: model (str): The name of the OpenAI model to use.
bu_agent_sdk/llm/openai/like.py:7
Class
ContentPartDocumentParam
Document content block for PDFs.
bu_agent_sdk/llm/messages.py:112
Class
ContentPartImageParam
bu_agent_sdk/llm/messages.py:147
Class
ContentPartRedactedThinkingParam
Redacted thinking content block. Used when thinking content has been redacted by the model (Anthropic). Must be preserved in conversation history.
bu_agent_sdk/llm/messages.py:74
Class
ContentPartRefusalParam
bu_agent_sdk/llm/messages.py:40
Class
ContentPartTextParam
bu_agent_sdk/llm/messages.py:29
Class
ContentPartThinkingParam
Thinking content block for extended thinking / reasoning models. Used by: - Anthropic Claude models with extended thinking enabled - Can be includ
bu_agent_sdk/llm/messages.py:51
Class
DeveloperMessage
Developer-provided instructions for reasoning models. With OpenAI o1 models and newer, `developer` messages replace the previous `system` messages.
bu_agent_sdk/llm/messages.py:407
Class
DocumentSource
Source for a document attachment (base64 encoded).
bu_agent_sdk/llm/messages.py:97
Class
GoogleMessageSerializer
Serializer for converting messages to Google Gemini format.
bu_agent_sdk/llm/google/serializer.py:16
Class
MessageCompleteEvent
Emitted when a message is complete.
bu_agent_sdk/agent/events.py:131
Class
MessageStartEvent
Emitted when a new message starts (user or assistant).
bu_agent_sdk/agent/events.py:117
Class
ModelError
bu_agent_sdk/llm/exceptions.py:1
Class
OpenAIMessageSerializer
Serializer for converting between custom message types and OpenAI message param types.
bu_agent_sdk/llm/openai/serializer.py:33
Class
SandboxContext
Sandboxed filesystem context. All file operations are restricted to root_dir.
bu_agent_sdk/examples/claude_code.py:38
Class
SchemaOptimizer
bu_agent_sdk/llm/schema.py:16
Class
TaskComplete
Exception raised when a task is completed via the done tool. This provides explicit task completion signaling instead of relying on the absen
bu_agent_sdk/agent/service.py:40
Class
TestGeminiAgentModeIntegration
Integration tests that actually call Gemini API.
bu_agent_sdk/llm/google/tests/test_agent_mode.py:297
Class
_MessageBase
Base class for all message types
bu_agent_sdk/llm/messages.py:203
Class
mark
bu_agent_sdk/llm/google/tests/test_agent_mode.py:37
Class
pytest
bu_agent_sdk/llm/google/tests/test_agent_mode.py:32