mirror of
https://github.com/trycua/computer.git
synced 2026-01-05 12:59:58 -06:00
renamed agent2 to agent
This commit is contained in:
@@ -12,7 +12,7 @@ An agent can be thought of as a loop - it generates actions, executes them, and
|
||||
To run an agent loop simply do:
|
||||
|
||||
```python
|
||||
from agent2 import ComputerAgent
|
||||
from agent import ComputerAgent
|
||||
from computer import Computer
|
||||
|
||||
computer = Computer() # Connect to a c/ua container
|
||||
|
||||
@@ -10,7 +10,7 @@ Optimize agent costs with budget management and image retention callbacks.
|
||||
## Budget Manager Callbacks Example
|
||||
|
||||
```python
|
||||
from agent2.callbacks import BudgetManagerCallback
|
||||
from agent.callbacks import BudgetManagerCallback
|
||||
|
||||
agent = ComputerAgent(
|
||||
model="anthropic/claude-3-5-sonnet-20241022",
|
||||
@@ -47,7 +47,7 @@ agent = ComputerAgent(
|
||||
## Image Retention Callbacks Example
|
||||
|
||||
```python
|
||||
from agent2.callbacks import ImageRetentionCallback
|
||||
from agent.callbacks import ImageRetentionCallback
|
||||
|
||||
agent = ComputerAgent(
|
||||
model="anthropic/claude-3-5-sonnet-20241022",
|
||||
|
||||
@@ -10,7 +10,7 @@ Built-in logging callback and custom logger creation for agent monitoring.
|
||||
## Callbacks Example
|
||||
|
||||
```python
|
||||
from agent2.callbacks import LoggingCallback
|
||||
from agent.callbacks import LoggingCallback
|
||||
import logging
|
||||
|
||||
agent = ComputerAgent(
|
||||
@@ -40,7 +40,7 @@ agent = ComputerAgent(
|
||||
Create custom loggers by extending AsyncCallbackHandler:
|
||||
|
||||
```python
|
||||
from agent2.callbacks.base import AsyncCallbackHandler
|
||||
from agent.callbacks.base import AsyncCallbackHandler
|
||||
import logging
|
||||
|
||||
class CustomLogger(AsyncCallbackHandler):
|
||||
|
||||
@@ -10,7 +10,7 @@ The TrajectorySaverCallback records complete agent conversations including messa
|
||||
## Callbacks Example
|
||||
|
||||
```python
|
||||
from agent2.callbacks import TrajectorySaverCallback
|
||||
from agent.callbacks import TrajectorySaverCallback
|
||||
|
||||
agent = ComputerAgent(
|
||||
model="anthropic/claude-3-5-sonnet-20241022",
|
||||
|
||||
@@ -20,7 +20,7 @@ def read_file(location: str) -> str:
|
||||
You can then register this as a tool for your agent:
|
||||
|
||||
```python
|
||||
from agent2 import ComputerAgent
|
||||
from agent import ComputerAgent
|
||||
from computer import Computer
|
||||
|
||||
computer = Computer(...)
|
||||
|
||||
@@ -12,7 +12,7 @@ The Agent library provides the ComputerAgent class and tools for building AI age
|
||||
### Basic Usage
|
||||
|
||||
```python
|
||||
from agent2 import ComputerAgent
|
||||
from agent import ComputerAgent
|
||||
from computer import Computer
|
||||
|
||||
computer = Computer() # Connect to a c/ua container
|
||||
@@ -66,9 +66,9 @@ The `ComputerAgent` constructor provides a wide range of options for customizing
|
||||
**Example with advanced options:**
|
||||
|
||||
```python
|
||||
from agent2 import ComputerAgent
|
||||
from agent import ComputerAgent
|
||||
from computer import Computer
|
||||
from agent2.callbacks import ImageRetentionCallback
|
||||
from agent.callbacks import ImageRetentionCallback
|
||||
|
||||
agent = ComputerAgent(
|
||||
model="anthropic/claude-3-5-sonnet-20241022",
|
||||
@@ -113,7 +113,7 @@ See [Agent Loops](../../agent-sdk/agent-loops) for supported models and details.
|
||||
You can add preprocessing and postprocessing hooks using callbacks, or write your own by subclassing `AsyncCallbackHandler`:
|
||||
|
||||
```python
|
||||
from agent2.callbacks import ImageRetentionCallback, PIIAnonymizationCallback
|
||||
from agent.callbacks import ImageRetentionCallback, PIIAnonymizationCallback
|
||||
|
||||
agent = ComputerAgent(
|
||||
model="anthropic/claude-3-5-sonnet-20241022",
|
||||
|
||||
Reference in New Issue
Block a user