Update agents.py
Browse files
agents.py
CHANGED
|
@@ -18,5 +18,39 @@ _llm=LLM(
|
|
| 18 |
)
|
| 19 |
|
| 20 |
def main_agent():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
|
|
|
|
|
|
| 18 |
)
|
| 19 |
|
| 20 |
def main_agent():
|
| 21 |
+
# Create an agent with all available parameters
|
| 22 |
+
agent = Agent(
|
| 23 |
+
role="Senior Data Scientist",
|
| 24 |
+
goal="Analyze and interpret complex datasets to provide actionable insights",
|
| 25 |
+
backstory="With over 10 years of experience in data science and machine learning, ",
|
| 26 |
+
llm="gpt-4", # Default: OPENAI_MODEL_NAME or "gpt-4"
|
| 27 |
+
function_calling_llm=None, # Optional: Separate LLM for tool calling
|
| 28 |
+
verbose=False, # Default: False
|
| 29 |
+
allow_delegation=False, # Default: False
|
| 30 |
+
max_iter=20, # Default: 20 iterations
|
| 31 |
+
max_rpm=None, # Optional: Rate limit for API calls
|
| 32 |
+
max_execution_time=None, # Optional: Maximum execution time in seconds
|
| 33 |
+
max_retry_limit=2, # Default: 2 retries on error
|
| 34 |
+
allow_code_execution=False, # Default: False
|
| 35 |
+
code_execution_mode="safe", # Default: "safe" (options: "safe", "unsafe")
|
| 36 |
+
respect_context_window=True, # Default: True
|
| 37 |
+
use_system_prompt=True, # Default: True
|
| 38 |
+
multimodal=False, # Default: False
|
| 39 |
+
inject_date=False, # Default: False
|
| 40 |
+
date_format="%Y-%m-%d", # Default: ISO format
|
| 41 |
+
reasoning=False, # Default: False
|
| 42 |
+
max_reasoning_attempts=None, # Default: None
|
| 43 |
+
tools=[SerperDevTool()], # Optional: List of tools
|
| 44 |
+
knowledge_sources=None, # Optional: List of knowledge sources
|
| 45 |
+
embedder=None, # Optional: Custom embedder configuration
|
| 46 |
+
system_template=None, # Optional: Custom system prompt template
|
| 47 |
+
prompt_template=None, # Optional: Custom prompt template
|
| 48 |
+
response_template=None, # Optional: Custom response template
|
| 49 |
+
step_callback=None, # Optional: Callback function for monitoring
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
|
| 54 |
|
| 55 |
|
| 56 |
+
|