-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathagent_builder.py
More file actions
37 lines (34 loc) · 951 Bytes
/
agent_builder.py
File metadata and controls
37 lines (34 loc) · 951 Bytes
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
from typing import Optional
from agno.agent import Agent
from agno.models.ollama import Ollama
from agno.memory import Memory
from agno.storage.sqlite import SqliteStorage
def build_local_agent(
*,
name: str,
description: str,
role: str,
temperature: float = 0.2,
memory: Optional[Memory] = None,
storage: Optional[SqliteStorage] = None,
enable_agentic_memory: bool = False,
**extra_agent_kwargs,
) -> Agent:
"""Return an Agent backed by a *local* llama3.1:8b Ollama model."""
model = Ollama(
id="qwen3:8b",
options={"temperature": temperature},
)
return Agent(
name=name,
description=description,
role=role,
model=model,
markdown=True,
memory=memory,
enable_agentic_memory=enable_agentic_memory,
storage=storage,
add_history_to_messages=True,
num_history_runs=3,
**extra_agent_kwargs,
)