forked from themanojdesai/python-a2a
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
65 lines (57 loc) · 1.31 KB
/
Copy path__init__.py
File metadata and controls
65 lines (57 loc) · 1.31 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
62
63
64
65
"""
Models for the A2A protocol.
"""
# Import base models first (they have no dependencies)
from .base import BaseModel
# Import content types which most other models depend on
from .content import (
ContentType,
TextContent,
FunctionParameter,
FunctionCallContent,
FunctionResponseContent,
ErrorContent,
Metadata
)
# Import core communication models
from .message import Message, MessageRole
from .conversation import Conversation
# Import newer models with defensive imports
try:
from .agent import AgentCard, AgentSkill
except ImportError:
# These may not be available yet
pass
try:
from .task import Task, TaskStatus, TaskState
except ImportError:
# These may not be available yet
pass
# Make everything available at the models level
__all__ = [
'BaseModel',
'Message',
'MessageRole',
'Conversation',
'ContentType',
'TextContent',
'FunctionParameter',
'FunctionCallContent',
'FunctionResponseContent',
'ErrorContent',
'Metadata',
]
# Conditionally add newer models to __all__ if they're available
try:
AgentCard
AgentSkill
__all__.extend(['AgentCard', 'AgentSkill'])
except NameError:
pass
try:
Task
TaskStatus
TaskState
__all__.extend(['Task', 'TaskStatus', 'TaskState'])
except NameError:
pass