-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
61 lines (55 loc) · 2.11 KB
/
Copy pathutils.py
File metadata and controls
61 lines (55 loc) · 2.11 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from typing import Any, List
from common.agent_task_manager import AgentTaskManager
from common.types import AgentCapabilities, AgentCard, AgentSkill
def generate_agent_card(
agent_name: str,
agent_description: str,
agent_url: str,
agent_version: str,
can_stream: bool = False,
can_push_notifications: bool = False,
can_state_transition_history: bool = True,
authentication: str = None,
default_input_modes: List[str] = ["text"],
default_output_modes: List[str] = ["text"],
skills: List[AgentSkill] = None,
):
"""
Generates an agent card for the Echo Agent.
:param agent_name: The name of the agent.
:param agent_description: The description of the agent.
:param agent_url: The URL where the agent is hosted.
:param agent_version: The version of the agent.
:param can_stream: Whether the agent can stream responses.
:param can_push_notifications: Whether the agent can send push notifications.
:param can_state_transition_history: Whether the agent can maintain state transition history.
:param authentication: The authentication method for the agent.
:param default_input_modes: The default input modes for the agent.
:param default_output_modes: The default output modes for the agent.
:param skills: The skills of the agent.
:return: The agent card.
"""
return AgentCard(
name=agent_name,
description=agent_description,
url=agent_url,
version=agent_version,
capabilities=AgentCapabilities(
streaming=can_stream,
pushNotifications=can_push_notifications,
stateTransitionHistory=can_state_transition_history,
),
authentication=authentication,
defaultInputModes=default_input_modes,
defaultOutputModes=default_output_modes,
skills=skills,
)
def generate_agent_task_manager(
agent: Any,
):
"""
Generates an agent task manager for the Echo Agent.
:param agent: The agent instance.
:return: The agent task manager.
"""
return AgentTaskManager(agent)