-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent_config.py
More file actions
46 lines (37 loc) · 1.55 KB
/
agent_config.py
File metadata and controls
46 lines (37 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
Configuration classes for Sentience agents.
"""
from dataclasses import dataclass
@dataclass
class AgentConfig:
"""
Configuration for Sentience Agent execution.
This dataclass provides centralized configuration for agent behavior,
including snapshot limits, retry logic, verification, and screenshot capture.
Attributes:
snapshot_limit: Maximum elements to include in LLM context (default: 50)
temperature: LLM temperature 0.0-1.0 for response generation (default: 0.0)
max_retries: Number of retries on action failure (default: 1)
verify: Whether to run verification step after actions (default: True)
capture_screenshots: Whether to capture screenshots during execution (default: True)
screenshot_format: Screenshot format 'png' or 'jpeg' (default: 'jpeg')
screenshot_quality: JPEG quality 1-100, ignored for PNG (default: 80)
Example:
>>> from sentience import AgentConfig, SentienceAgent
>>> config = AgentConfig(
... snapshot_limit=100,
... max_retries=2,
... verify=True
... )
>>> agent = SentienceAgent(browser, llm, config=config)
"""
snapshot_limit: int = 50
temperature: float = 0.0
max_retries: int = 1
verify: bool = True
# Screenshot options
capture_screenshots: bool = True
screenshot_format: str = "jpeg" # "png" or "jpeg"
screenshot_quality: int = 80 # 1-100 (for JPEG only)
# Visual overlay options
show_overlay: bool = False # Show green bbox overlay in browser