robosystems-client 0.1.15__py3-none-any.whl → 0.1.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of robosystems-client might be problematic. Click here for more details.
- robosystems_client/api/agent/auto_select_agent.py +264 -0
- robosystems_client/api/agent/batch_process_queries.py +279 -0
- robosystems_client/api/agent/execute_specific_agent.py +276 -0
- robosystems_client/api/agent/get_agent_metadata.py +256 -0
- robosystems_client/api/agent/list_agents.py +264 -0
- robosystems_client/api/agent/recommend_agent.py +273 -0
- robosystems_client/api/graph_credits/check_credit_balance.py +14 -10
- robosystems_client/models/__init__.py +35 -3
- robosystems_client/models/agent_list_response.py +74 -0
- robosystems_client/models/agent_list_response_agents.py +67 -0
- robosystems_client/models/{credits_summary_response_credits_by_addon_item.py → agent_list_response_agents_additional_property.py} +5 -5
- robosystems_client/models/agent_message.py +35 -1
- robosystems_client/models/agent_metadata_response.py +133 -0
- robosystems_client/models/agent_mode.py +11 -0
- robosystems_client/models/agent_recommendation.py +106 -0
- robosystems_client/models/agent_recommendation_request.py +108 -0
- robosystems_client/models/agent_recommendation_request_context_type_0.py +44 -0
- robosystems_client/models/agent_recommendation_response.py +82 -0
- robosystems_client/models/agent_request.py +110 -6
- robosystems_client/models/agent_response.py +161 -11
- robosystems_client/models/agent_response_error_details_type_0.py +44 -0
- robosystems_client/models/agent_response_tokens_used_type_0.py +44 -0
- robosystems_client/models/auth_response.py +20 -6
- robosystems_client/models/batch_agent_request.py +85 -0
- robosystems_client/models/batch_agent_response.py +90 -0
- robosystems_client/models/credit_summary.py +35 -9
- robosystems_client/models/credits_summary_response.py +47 -21
- robosystems_client/models/credits_summary_response_credits_by_addon_type_0_item.py +44 -0
- robosystems_client/models/custom_schema_definition.py +7 -14
- robosystems_client/models/custom_schema_definition_metadata.py +1 -6
- robosystems_client/models/database_health_response.py +11 -11
- robosystems_client/models/database_info_response.py +13 -14
- robosystems_client/models/error_response.py +4 -8
- robosystems_client/models/graph_metadata.py +4 -5
- robosystems_client/models/health_status.py +2 -2
- robosystems_client/models/repository_credits_response.py +43 -16
- robosystems_client/models/schema_export_response.py +5 -8
- robosystems_client/models/schema_validation_request.py +3 -5
- robosystems_client/models/schema_validation_response.py +5 -5
- robosystems_client/models/selection_criteria.py +122 -0
- robosystems_client/models/success_response.py +1 -1
- {robosystems_client-0.1.15.dist-info → robosystems_client-0.1.16.dist-info}/METADATA +1 -1
- {robosystems_client-0.1.15.dist-info → robosystems_client-0.1.16.dist-info}/RECORD +44 -25
- robosystems_client/api/agent/query_financial_agent.py +0 -423
- {robosystems_client-0.1.15.dist-info → robosystems_client-0.1.16.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.agent_recommendation_request_context_type_0 import (
|
|
11
|
+
AgentRecommendationRequestContextType0,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="AgentRecommendationRequest")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class AgentRecommendationRequest:
|
|
20
|
+
"""Request for agent recommendations.
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
query (str): Query to analyze
|
|
24
|
+
context (Union['AgentRecommendationRequestContextType0', None, Unset]): Additional context
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
query: str
|
|
28
|
+
context: Union["AgentRecommendationRequestContextType0", None, Unset] = UNSET
|
|
29
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
30
|
+
|
|
31
|
+
def to_dict(self) -> dict[str, Any]:
|
|
32
|
+
from ..models.agent_recommendation_request_context_type_0 import (
|
|
33
|
+
AgentRecommendationRequestContextType0,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
query = self.query
|
|
37
|
+
|
|
38
|
+
context: Union[None, Unset, dict[str, Any]]
|
|
39
|
+
if isinstance(self.context, Unset):
|
|
40
|
+
context = UNSET
|
|
41
|
+
elif isinstance(self.context, AgentRecommendationRequestContextType0):
|
|
42
|
+
context = self.context.to_dict()
|
|
43
|
+
else:
|
|
44
|
+
context = self.context
|
|
45
|
+
|
|
46
|
+
field_dict: dict[str, Any] = {}
|
|
47
|
+
field_dict.update(self.additional_properties)
|
|
48
|
+
field_dict.update(
|
|
49
|
+
{
|
|
50
|
+
"query": query,
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
if context is not UNSET:
|
|
54
|
+
field_dict["context"] = context
|
|
55
|
+
|
|
56
|
+
return field_dict
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
60
|
+
from ..models.agent_recommendation_request_context_type_0 import (
|
|
61
|
+
AgentRecommendationRequestContextType0,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
d = dict(src_dict)
|
|
65
|
+
query = d.pop("query")
|
|
66
|
+
|
|
67
|
+
def _parse_context(
|
|
68
|
+
data: object,
|
|
69
|
+
) -> Union["AgentRecommendationRequestContextType0", None, Unset]:
|
|
70
|
+
if data is None:
|
|
71
|
+
return data
|
|
72
|
+
if isinstance(data, Unset):
|
|
73
|
+
return data
|
|
74
|
+
try:
|
|
75
|
+
if not isinstance(data, dict):
|
|
76
|
+
raise TypeError()
|
|
77
|
+
context_type_0 = AgentRecommendationRequestContextType0.from_dict(data)
|
|
78
|
+
|
|
79
|
+
return context_type_0
|
|
80
|
+
except: # noqa: E722
|
|
81
|
+
pass
|
|
82
|
+
return cast(Union["AgentRecommendationRequestContextType0", None, Unset], data)
|
|
83
|
+
|
|
84
|
+
context = _parse_context(d.pop("context", UNSET))
|
|
85
|
+
|
|
86
|
+
agent_recommendation_request = cls(
|
|
87
|
+
query=query,
|
|
88
|
+
context=context,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
agent_recommendation_request.additional_properties = d
|
|
92
|
+
return agent_recommendation_request
|
|
93
|
+
|
|
94
|
+
@property
|
|
95
|
+
def additional_keys(self) -> list[str]:
|
|
96
|
+
return list(self.additional_properties.keys())
|
|
97
|
+
|
|
98
|
+
def __getitem__(self, key: str) -> Any:
|
|
99
|
+
return self.additional_properties[key]
|
|
100
|
+
|
|
101
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
102
|
+
self.additional_properties[key] = value
|
|
103
|
+
|
|
104
|
+
def __delitem__(self, key: str) -> None:
|
|
105
|
+
del self.additional_properties[key]
|
|
106
|
+
|
|
107
|
+
def __contains__(self, key: str) -> bool:
|
|
108
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T", bound="AgentRecommendationRequestContextType0")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class AgentRecommendationRequestContextType0:
|
|
12
|
+
""" """
|
|
13
|
+
|
|
14
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
15
|
+
|
|
16
|
+
def to_dict(self) -> dict[str, Any]:
|
|
17
|
+
field_dict: dict[str, Any] = {}
|
|
18
|
+
field_dict.update(self.additional_properties)
|
|
19
|
+
|
|
20
|
+
return field_dict
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
24
|
+
d = dict(src_dict)
|
|
25
|
+
agent_recommendation_request_context_type_0 = cls()
|
|
26
|
+
|
|
27
|
+
agent_recommendation_request_context_type_0.additional_properties = d
|
|
28
|
+
return agent_recommendation_request_context_type_0
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def additional_keys(self) -> list[str]:
|
|
32
|
+
return list(self.additional_properties.keys())
|
|
33
|
+
|
|
34
|
+
def __getitem__(self, key: str) -> Any:
|
|
35
|
+
return self.additional_properties[key]
|
|
36
|
+
|
|
37
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
38
|
+
self.additional_properties[key] = value
|
|
39
|
+
|
|
40
|
+
def __delitem__(self, key: str) -> None:
|
|
41
|
+
del self.additional_properties[key]
|
|
42
|
+
|
|
43
|
+
def __contains__(self, key: str) -> bool:
|
|
44
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from ..models.agent_recommendation import AgentRecommendation
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="AgentRecommendationResponse")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class AgentRecommendationResponse:
|
|
16
|
+
"""Response for agent recommendations.
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
recommendations (list['AgentRecommendation']): List of agent recommendations sorted by confidence
|
|
20
|
+
query (str): The analyzed query
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
recommendations: list["AgentRecommendation"]
|
|
24
|
+
query: str
|
|
25
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
26
|
+
|
|
27
|
+
def to_dict(self) -> dict[str, Any]:
|
|
28
|
+
recommendations = []
|
|
29
|
+
for recommendations_item_data in self.recommendations:
|
|
30
|
+
recommendations_item = recommendations_item_data.to_dict()
|
|
31
|
+
recommendations.append(recommendations_item)
|
|
32
|
+
|
|
33
|
+
query = self.query
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update(
|
|
38
|
+
{
|
|
39
|
+
"recommendations": recommendations,
|
|
40
|
+
"query": query,
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
return field_dict
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
48
|
+
from ..models.agent_recommendation import AgentRecommendation
|
|
49
|
+
|
|
50
|
+
d = dict(src_dict)
|
|
51
|
+
recommendations = []
|
|
52
|
+
_recommendations = d.pop("recommendations")
|
|
53
|
+
for recommendations_item_data in _recommendations:
|
|
54
|
+
recommendations_item = AgentRecommendation.from_dict(recommendations_item_data)
|
|
55
|
+
|
|
56
|
+
recommendations.append(recommendations_item)
|
|
57
|
+
|
|
58
|
+
query = d.pop("query")
|
|
59
|
+
|
|
60
|
+
agent_recommendation_response = cls(
|
|
61
|
+
recommendations=recommendations,
|
|
62
|
+
query=query,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
agent_recommendation_response.additional_properties = d
|
|
66
|
+
return agent_recommendation_response
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def additional_keys(self) -> list[str]:
|
|
70
|
+
return list(self.additional_properties.keys())
|
|
71
|
+
|
|
72
|
+
def __getitem__(self, key: str) -> Any:
|
|
73
|
+
return self.additional_properties[key]
|
|
74
|
+
|
|
75
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
76
|
+
self.additional_properties[key] = value
|
|
77
|
+
|
|
78
|
+
def __delitem__(self, key: str) -> None:
|
|
79
|
+
del self.additional_properties[key]
|
|
80
|
+
|
|
81
|
+
def __contains__(self, key: str) -> bool:
|
|
82
|
+
return key in self.additional_properties
|
|
@@ -4,11 +4,13 @@ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
|
4
4
|
from attrs import define as _attrs_define
|
|
5
5
|
from attrs import field as _attrs_field
|
|
6
6
|
|
|
7
|
+
from ..models.agent_mode import AgentMode
|
|
7
8
|
from ..types import UNSET, Unset
|
|
8
9
|
|
|
9
10
|
if TYPE_CHECKING:
|
|
10
11
|
from ..models.agent_message import AgentMessage
|
|
11
12
|
from ..models.agent_request_context_type_0 import AgentRequestContextType0
|
|
13
|
+
from ..models.selection_criteria import SelectionCriteria
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
T = TypeVar("T", bound="AgentRequest")
|
|
@@ -16,25 +18,36 @@ T = TypeVar("T", bound="AgentRequest")
|
|
|
16
18
|
|
|
17
19
|
@_attrs_define
|
|
18
20
|
class AgentRequest:
|
|
19
|
-
"""Request model for
|
|
21
|
+
"""Request model for agent interactions.
|
|
20
22
|
|
|
21
23
|
Attributes:
|
|
22
|
-
message (str):
|
|
24
|
+
message (str): The query or message to process
|
|
23
25
|
history (Union[Unset, list['AgentMessage']]): Conversation history
|
|
24
|
-
context (Union['AgentRequestContextType0', None, Unset]): Additional context for analysis (e.g.,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
context (Union['AgentRequestContextType0', None, Unset]): Additional context for analysis (e.g., enable_rag,
|
|
27
|
+
include_schema)
|
|
28
|
+
mode (Union[AgentMode, None, Unset]): Execution mode Default: AgentMode.STANDARD.
|
|
29
|
+
agent_type (Union[None, Unset, str]): Specific agent type to use (optional)
|
|
30
|
+
selection_criteria (Union['SelectionCriteria', None, Unset]): Criteria for agent selection
|
|
31
|
+
force_extended_analysis (Union[Unset, bool]): Force extended analysis mode with comprehensive research Default:
|
|
32
|
+
False.
|
|
33
|
+
enable_rag (Union[Unset, bool]): Enable RAG context enrichment Default: True.
|
|
34
|
+
stream (Union[Unset, bool]): Enable streaming response Default: False.
|
|
28
35
|
"""
|
|
29
36
|
|
|
30
37
|
message: str
|
|
31
38
|
history: Union[Unset, list["AgentMessage"]] = UNSET
|
|
32
39
|
context: Union["AgentRequestContextType0", None, Unset] = UNSET
|
|
40
|
+
mode: Union[AgentMode, None, Unset] = AgentMode.STANDARD
|
|
41
|
+
agent_type: Union[None, Unset, str] = UNSET
|
|
42
|
+
selection_criteria: Union["SelectionCriteria", None, Unset] = UNSET
|
|
33
43
|
force_extended_analysis: Union[Unset, bool] = False
|
|
44
|
+
enable_rag: Union[Unset, bool] = True
|
|
45
|
+
stream: Union[Unset, bool] = False
|
|
34
46
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
47
|
|
|
36
48
|
def to_dict(self) -> dict[str, Any]:
|
|
37
49
|
from ..models.agent_request_context_type_0 import AgentRequestContextType0
|
|
50
|
+
from ..models.selection_criteria import SelectionCriteria
|
|
38
51
|
|
|
39
52
|
message = self.message
|
|
40
53
|
|
|
@@ -53,8 +66,34 @@ class AgentRequest:
|
|
|
53
66
|
else:
|
|
54
67
|
context = self.context
|
|
55
68
|
|
|
69
|
+
mode: Union[None, Unset, str]
|
|
70
|
+
if isinstance(self.mode, Unset):
|
|
71
|
+
mode = UNSET
|
|
72
|
+
elif isinstance(self.mode, AgentMode):
|
|
73
|
+
mode = self.mode.value
|
|
74
|
+
else:
|
|
75
|
+
mode = self.mode
|
|
76
|
+
|
|
77
|
+
agent_type: Union[None, Unset, str]
|
|
78
|
+
if isinstance(self.agent_type, Unset):
|
|
79
|
+
agent_type = UNSET
|
|
80
|
+
else:
|
|
81
|
+
agent_type = self.agent_type
|
|
82
|
+
|
|
83
|
+
selection_criteria: Union[None, Unset, dict[str, Any]]
|
|
84
|
+
if isinstance(self.selection_criteria, Unset):
|
|
85
|
+
selection_criteria = UNSET
|
|
86
|
+
elif isinstance(self.selection_criteria, SelectionCriteria):
|
|
87
|
+
selection_criteria = self.selection_criteria.to_dict()
|
|
88
|
+
else:
|
|
89
|
+
selection_criteria = self.selection_criteria
|
|
90
|
+
|
|
56
91
|
force_extended_analysis = self.force_extended_analysis
|
|
57
92
|
|
|
93
|
+
enable_rag = self.enable_rag
|
|
94
|
+
|
|
95
|
+
stream = self.stream
|
|
96
|
+
|
|
58
97
|
field_dict: dict[str, Any] = {}
|
|
59
98
|
field_dict.update(self.additional_properties)
|
|
60
99
|
field_dict.update(
|
|
@@ -66,8 +105,18 @@ class AgentRequest:
|
|
|
66
105
|
field_dict["history"] = history
|
|
67
106
|
if context is not UNSET:
|
|
68
107
|
field_dict["context"] = context
|
|
108
|
+
if mode is not UNSET:
|
|
109
|
+
field_dict["mode"] = mode
|
|
110
|
+
if agent_type is not UNSET:
|
|
111
|
+
field_dict["agent_type"] = agent_type
|
|
112
|
+
if selection_criteria is not UNSET:
|
|
113
|
+
field_dict["selection_criteria"] = selection_criteria
|
|
69
114
|
if force_extended_analysis is not UNSET:
|
|
70
115
|
field_dict["force_extended_analysis"] = force_extended_analysis
|
|
116
|
+
if enable_rag is not UNSET:
|
|
117
|
+
field_dict["enable_rag"] = enable_rag
|
|
118
|
+
if stream is not UNSET:
|
|
119
|
+
field_dict["stream"] = stream
|
|
71
120
|
|
|
72
121
|
return field_dict
|
|
73
122
|
|
|
@@ -75,6 +124,7 @@ class AgentRequest:
|
|
|
75
124
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
76
125
|
from ..models.agent_message import AgentMessage
|
|
77
126
|
from ..models.agent_request_context_type_0 import AgentRequestContextType0
|
|
127
|
+
from ..models.selection_criteria import SelectionCriteria
|
|
78
128
|
|
|
79
129
|
d = dict(src_dict)
|
|
80
130
|
message = d.pop("message")
|
|
@@ -103,13 +153,67 @@ class AgentRequest:
|
|
|
103
153
|
|
|
104
154
|
context = _parse_context(d.pop("context", UNSET))
|
|
105
155
|
|
|
156
|
+
def _parse_mode(data: object) -> Union[AgentMode, None, Unset]:
|
|
157
|
+
if data is None:
|
|
158
|
+
return data
|
|
159
|
+
if isinstance(data, Unset):
|
|
160
|
+
return data
|
|
161
|
+
try:
|
|
162
|
+
if not isinstance(data, str):
|
|
163
|
+
raise TypeError()
|
|
164
|
+
mode_type_0 = AgentMode(data)
|
|
165
|
+
|
|
166
|
+
return mode_type_0
|
|
167
|
+
except: # noqa: E722
|
|
168
|
+
pass
|
|
169
|
+
return cast(Union[AgentMode, None, Unset], data)
|
|
170
|
+
|
|
171
|
+
mode = _parse_mode(d.pop("mode", UNSET))
|
|
172
|
+
|
|
173
|
+
def _parse_agent_type(data: object) -> Union[None, Unset, str]:
|
|
174
|
+
if data is None:
|
|
175
|
+
return data
|
|
176
|
+
if isinstance(data, Unset):
|
|
177
|
+
return data
|
|
178
|
+
return cast(Union[None, Unset, str], data)
|
|
179
|
+
|
|
180
|
+
agent_type = _parse_agent_type(d.pop("agent_type", UNSET))
|
|
181
|
+
|
|
182
|
+
def _parse_selection_criteria(
|
|
183
|
+
data: object,
|
|
184
|
+
) -> Union["SelectionCriteria", None, Unset]:
|
|
185
|
+
if data is None:
|
|
186
|
+
return data
|
|
187
|
+
if isinstance(data, Unset):
|
|
188
|
+
return data
|
|
189
|
+
try:
|
|
190
|
+
if not isinstance(data, dict):
|
|
191
|
+
raise TypeError()
|
|
192
|
+
selection_criteria_type_0 = SelectionCriteria.from_dict(data)
|
|
193
|
+
|
|
194
|
+
return selection_criteria_type_0
|
|
195
|
+
except: # noqa: E722
|
|
196
|
+
pass
|
|
197
|
+
return cast(Union["SelectionCriteria", None, Unset], data)
|
|
198
|
+
|
|
199
|
+
selection_criteria = _parse_selection_criteria(d.pop("selection_criteria", UNSET))
|
|
200
|
+
|
|
106
201
|
force_extended_analysis = d.pop("force_extended_analysis", UNSET)
|
|
107
202
|
|
|
203
|
+
enable_rag = d.pop("enable_rag", UNSET)
|
|
204
|
+
|
|
205
|
+
stream = d.pop("stream", UNSET)
|
|
206
|
+
|
|
108
207
|
agent_request = cls(
|
|
109
208
|
message=message,
|
|
110
209
|
history=history,
|
|
111
210
|
context=context,
|
|
211
|
+
mode=mode,
|
|
212
|
+
agent_type=agent_type,
|
|
213
|
+
selection_criteria=selection_criteria,
|
|
112
214
|
force_extended_analysis=force_extended_analysis,
|
|
215
|
+
enable_rag=enable_rag,
|
|
216
|
+
stream=stream,
|
|
113
217
|
)
|
|
114
218
|
|
|
115
219
|
agent_request.additional_properties = d
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import datetime
|
|
1
2
|
from collections.abc import Mapping
|
|
2
3
|
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
3
4
|
|
|
4
5
|
from attrs import define as _attrs_define
|
|
5
6
|
from attrs import field as _attrs_field
|
|
7
|
+
from dateutil.parser import isoparse
|
|
6
8
|
|
|
9
|
+
from ..models.agent_mode import AgentMode
|
|
7
10
|
from ..types import UNSET, Unset
|
|
8
11
|
|
|
9
12
|
if TYPE_CHECKING:
|
|
13
|
+
from ..models.agent_response_error_details_type_0 import (
|
|
14
|
+
AgentResponseErrorDetailsType0,
|
|
15
|
+
)
|
|
10
16
|
from ..models.agent_response_metadata_type_0 import AgentResponseMetadataType0
|
|
17
|
+
from ..models.agent_response_tokens_used_type_0 import AgentResponseTokensUsedType0
|
|
11
18
|
|
|
12
19
|
|
|
13
20
|
T = TypeVar("T", bound="AgentResponse")
|
|
@@ -15,26 +22,47 @@ T = TypeVar("T", bound="AgentResponse")
|
|
|
15
22
|
|
|
16
23
|
@_attrs_define
|
|
17
24
|
class AgentResponse:
|
|
18
|
-
"""Response model for
|
|
25
|
+
"""Response model for agent interactions.
|
|
19
26
|
|
|
20
27
|
Attributes:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
content (str): The agent's response content
|
|
29
|
+
agent_used (str): The agent type that handled the request
|
|
30
|
+
mode_used (AgentMode): Agent execution modes.
|
|
31
|
+
metadata (Union['AgentResponseMetadataType0', None, Unset]): Response metadata including routing info
|
|
32
|
+
tokens_used (Union['AgentResponseTokensUsedType0', None, Unset]): Token usage statistics
|
|
33
|
+
confidence_score (Union[None, Unset, float]): Confidence score of the response
|
|
34
|
+
operation_id (Union[None, Unset, str]): Operation ID for SSE monitoring
|
|
35
|
+
is_partial (Union[Unset, bool]): Whether this is a partial response Default: False.
|
|
36
|
+
error_details (Union['AgentResponseErrorDetailsType0', None, Unset]): Error details if any
|
|
37
|
+
execution_time (Union[None, Unset, float]): Execution time in seconds
|
|
38
|
+
timestamp (Union[Unset, datetime.datetime]): Response timestamp
|
|
26
39
|
"""
|
|
27
40
|
|
|
28
|
-
|
|
41
|
+
content: str
|
|
42
|
+
agent_used: str
|
|
43
|
+
mode_used: AgentMode
|
|
29
44
|
metadata: Union["AgentResponseMetadataType0", None, Unset] = UNSET
|
|
45
|
+
tokens_used: Union["AgentResponseTokensUsedType0", None, Unset] = UNSET
|
|
46
|
+
confidence_score: Union[None, Unset, float] = UNSET
|
|
30
47
|
operation_id: Union[None, Unset, str] = UNSET
|
|
31
48
|
is_partial: Union[Unset, bool] = False
|
|
49
|
+
error_details: Union["AgentResponseErrorDetailsType0", None, Unset] = UNSET
|
|
50
|
+
execution_time: Union[None, Unset, float] = UNSET
|
|
51
|
+
timestamp: Union[Unset, datetime.datetime] = UNSET
|
|
32
52
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
33
53
|
|
|
34
54
|
def to_dict(self) -> dict[str, Any]:
|
|
55
|
+
from ..models.agent_response_error_details_type_0 import (
|
|
56
|
+
AgentResponseErrorDetailsType0,
|
|
57
|
+
)
|
|
35
58
|
from ..models.agent_response_metadata_type_0 import AgentResponseMetadataType0
|
|
59
|
+
from ..models.agent_response_tokens_used_type_0 import AgentResponseTokensUsedType0
|
|
60
|
+
|
|
61
|
+
content = self.content
|
|
36
62
|
|
|
37
|
-
|
|
63
|
+
agent_used = self.agent_used
|
|
64
|
+
|
|
65
|
+
mode_used = self.mode_used.value
|
|
38
66
|
|
|
39
67
|
metadata: Union[None, Unset, dict[str, Any]]
|
|
40
68
|
if isinstance(self.metadata, Unset):
|
|
@@ -44,6 +72,20 @@ class AgentResponse:
|
|
|
44
72
|
else:
|
|
45
73
|
metadata = self.metadata
|
|
46
74
|
|
|
75
|
+
tokens_used: Union[None, Unset, dict[str, Any]]
|
|
76
|
+
if isinstance(self.tokens_used, Unset):
|
|
77
|
+
tokens_used = UNSET
|
|
78
|
+
elif isinstance(self.tokens_used, AgentResponseTokensUsedType0):
|
|
79
|
+
tokens_used = self.tokens_used.to_dict()
|
|
80
|
+
else:
|
|
81
|
+
tokens_used = self.tokens_used
|
|
82
|
+
|
|
83
|
+
confidence_score: Union[None, Unset, float]
|
|
84
|
+
if isinstance(self.confidence_score, Unset):
|
|
85
|
+
confidence_score = UNSET
|
|
86
|
+
else:
|
|
87
|
+
confidence_score = self.confidence_score
|
|
88
|
+
|
|
47
89
|
operation_id: Union[None, Unset, str]
|
|
48
90
|
if isinstance(self.operation_id, Unset):
|
|
49
91
|
operation_id = UNSET
|
|
@@ -52,28 +94,66 @@ class AgentResponse:
|
|
|
52
94
|
|
|
53
95
|
is_partial = self.is_partial
|
|
54
96
|
|
|
97
|
+
error_details: Union[None, Unset, dict[str, Any]]
|
|
98
|
+
if isinstance(self.error_details, Unset):
|
|
99
|
+
error_details = UNSET
|
|
100
|
+
elif isinstance(self.error_details, AgentResponseErrorDetailsType0):
|
|
101
|
+
error_details = self.error_details.to_dict()
|
|
102
|
+
else:
|
|
103
|
+
error_details = self.error_details
|
|
104
|
+
|
|
105
|
+
execution_time: Union[None, Unset, float]
|
|
106
|
+
if isinstance(self.execution_time, Unset):
|
|
107
|
+
execution_time = UNSET
|
|
108
|
+
else:
|
|
109
|
+
execution_time = self.execution_time
|
|
110
|
+
|
|
111
|
+
timestamp: Union[Unset, str] = UNSET
|
|
112
|
+
if not isinstance(self.timestamp, Unset):
|
|
113
|
+
timestamp = self.timestamp.isoformat()
|
|
114
|
+
|
|
55
115
|
field_dict: dict[str, Any] = {}
|
|
56
116
|
field_dict.update(self.additional_properties)
|
|
57
117
|
field_dict.update(
|
|
58
118
|
{
|
|
59
|
-
"
|
|
119
|
+
"content": content,
|
|
120
|
+
"agent_used": agent_used,
|
|
121
|
+
"mode_used": mode_used,
|
|
60
122
|
}
|
|
61
123
|
)
|
|
62
124
|
if metadata is not UNSET:
|
|
63
125
|
field_dict["metadata"] = metadata
|
|
126
|
+
if tokens_used is not UNSET:
|
|
127
|
+
field_dict["tokens_used"] = tokens_used
|
|
128
|
+
if confidence_score is not UNSET:
|
|
129
|
+
field_dict["confidence_score"] = confidence_score
|
|
64
130
|
if operation_id is not UNSET:
|
|
65
131
|
field_dict["operation_id"] = operation_id
|
|
66
132
|
if is_partial is not UNSET:
|
|
67
133
|
field_dict["is_partial"] = is_partial
|
|
134
|
+
if error_details is not UNSET:
|
|
135
|
+
field_dict["error_details"] = error_details
|
|
136
|
+
if execution_time is not UNSET:
|
|
137
|
+
field_dict["execution_time"] = execution_time
|
|
138
|
+
if timestamp is not UNSET:
|
|
139
|
+
field_dict["timestamp"] = timestamp
|
|
68
140
|
|
|
69
141
|
return field_dict
|
|
70
142
|
|
|
71
143
|
@classmethod
|
|
72
144
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
145
|
+
from ..models.agent_response_error_details_type_0 import (
|
|
146
|
+
AgentResponseErrorDetailsType0,
|
|
147
|
+
)
|
|
73
148
|
from ..models.agent_response_metadata_type_0 import AgentResponseMetadataType0
|
|
149
|
+
from ..models.agent_response_tokens_used_type_0 import AgentResponseTokensUsedType0
|
|
74
150
|
|
|
75
151
|
d = dict(src_dict)
|
|
76
|
-
|
|
152
|
+
content = d.pop("content")
|
|
153
|
+
|
|
154
|
+
agent_used = d.pop("agent_used")
|
|
155
|
+
|
|
156
|
+
mode_used = AgentMode(d.pop("mode_used"))
|
|
77
157
|
|
|
78
158
|
def _parse_metadata(
|
|
79
159
|
data: object,
|
|
@@ -94,6 +174,34 @@ class AgentResponse:
|
|
|
94
174
|
|
|
95
175
|
metadata = _parse_metadata(d.pop("metadata", UNSET))
|
|
96
176
|
|
|
177
|
+
def _parse_tokens_used(
|
|
178
|
+
data: object,
|
|
179
|
+
) -> Union["AgentResponseTokensUsedType0", None, Unset]:
|
|
180
|
+
if data is None:
|
|
181
|
+
return data
|
|
182
|
+
if isinstance(data, Unset):
|
|
183
|
+
return data
|
|
184
|
+
try:
|
|
185
|
+
if not isinstance(data, dict):
|
|
186
|
+
raise TypeError()
|
|
187
|
+
tokens_used_type_0 = AgentResponseTokensUsedType0.from_dict(data)
|
|
188
|
+
|
|
189
|
+
return tokens_used_type_0
|
|
190
|
+
except: # noqa: E722
|
|
191
|
+
pass
|
|
192
|
+
return cast(Union["AgentResponseTokensUsedType0", None, Unset], data)
|
|
193
|
+
|
|
194
|
+
tokens_used = _parse_tokens_used(d.pop("tokens_used", UNSET))
|
|
195
|
+
|
|
196
|
+
def _parse_confidence_score(data: object) -> Union[None, Unset, float]:
|
|
197
|
+
if data is None:
|
|
198
|
+
return data
|
|
199
|
+
if isinstance(data, Unset):
|
|
200
|
+
return data
|
|
201
|
+
return cast(Union[None, Unset, float], data)
|
|
202
|
+
|
|
203
|
+
confidence_score = _parse_confidence_score(d.pop("confidence_score", UNSET))
|
|
204
|
+
|
|
97
205
|
def _parse_operation_id(data: object) -> Union[None, Unset, str]:
|
|
98
206
|
if data is None:
|
|
99
207
|
return data
|
|
@@ -105,11 +213,53 @@ class AgentResponse:
|
|
|
105
213
|
|
|
106
214
|
is_partial = d.pop("is_partial", UNSET)
|
|
107
215
|
|
|
216
|
+
def _parse_error_details(
|
|
217
|
+
data: object,
|
|
218
|
+
) -> Union["AgentResponseErrorDetailsType0", None, Unset]:
|
|
219
|
+
if data is None:
|
|
220
|
+
return data
|
|
221
|
+
if isinstance(data, Unset):
|
|
222
|
+
return data
|
|
223
|
+
try:
|
|
224
|
+
if not isinstance(data, dict):
|
|
225
|
+
raise TypeError()
|
|
226
|
+
error_details_type_0 = AgentResponseErrorDetailsType0.from_dict(data)
|
|
227
|
+
|
|
228
|
+
return error_details_type_0
|
|
229
|
+
except: # noqa: E722
|
|
230
|
+
pass
|
|
231
|
+
return cast(Union["AgentResponseErrorDetailsType0", None, Unset], data)
|
|
232
|
+
|
|
233
|
+
error_details = _parse_error_details(d.pop("error_details", UNSET))
|
|
234
|
+
|
|
235
|
+
def _parse_execution_time(data: object) -> Union[None, Unset, float]:
|
|
236
|
+
if data is None:
|
|
237
|
+
return data
|
|
238
|
+
if isinstance(data, Unset):
|
|
239
|
+
return data
|
|
240
|
+
return cast(Union[None, Unset, float], data)
|
|
241
|
+
|
|
242
|
+
execution_time = _parse_execution_time(d.pop("execution_time", UNSET))
|
|
243
|
+
|
|
244
|
+
_timestamp = d.pop("timestamp", UNSET)
|
|
245
|
+
timestamp: Union[Unset, datetime.datetime]
|
|
246
|
+
if isinstance(_timestamp, Unset):
|
|
247
|
+
timestamp = UNSET
|
|
248
|
+
else:
|
|
249
|
+
timestamp = isoparse(_timestamp)
|
|
250
|
+
|
|
108
251
|
agent_response = cls(
|
|
109
|
-
|
|
252
|
+
content=content,
|
|
253
|
+
agent_used=agent_used,
|
|
254
|
+
mode_used=mode_used,
|
|
110
255
|
metadata=metadata,
|
|
256
|
+
tokens_used=tokens_used,
|
|
257
|
+
confidence_score=confidence_score,
|
|
111
258
|
operation_id=operation_id,
|
|
112
259
|
is_partial=is_partial,
|
|
260
|
+
error_details=error_details,
|
|
261
|
+
execution_time=execution_time,
|
|
262
|
+
timestamp=timestamp,
|
|
113
263
|
)
|
|
114
264
|
|
|
115
265
|
agent_response.additional_properties = d
|