-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagent.py
28 lines (23 loc) · 1.07 KB
/
agent.py
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
from magentic import Agent, prompt
from tools import ImageCaptioning, WebSearch, GoogleSheets
class ResearchAgent(Agent):
def __init__(self, name: str, description: str):
super().__init__(name=name, description=description)
self.tools = {
"image_caption": ImageCaptioning(),
"web_search": WebSearch(),
"sheets": GoogleSheets()
}
@prompt("Analiziraj sliko in identificiraj objekte ter dejavnike tveganja")
async def process_image(self, image):
"""Obdelava slike z uporabo magentic-one promptov"""
return await self.tools["image_caption"].analyze(image)
class UnderwritingAgent(Agent):
def __init__(self, name: str, description: str):
super().__init__(name=name, description=description)
@prompt("Oceni tveganje in določi ustrezno kritje")
async def assess_risk(self, data):
"""Ocena tveganja z uporabo magentic-one promptov"""
# Implementacija ocene tveganja
pass
# Podobno implementirajte še SalesAgent in DelegationAgent