phenoml 0.0.18__py3-none-any.whl → 0.0.20__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.
- phenoml/agent/__init__.py +4 -0
- phenoml/agent/client.py +27 -52
- phenoml/agent/raw_client.py +23 -44
- phenoml/agent/types/__init__.py +4 -0
- phenoml/agent/types/agent_create_request.py +0 -5
- phenoml/agent/types/agent_get_chat_messages_request_role.py +5 -0
- phenoml/agent/types/chat_message_template.py +7 -2
- phenoml/agent/types/chat_message_template_role.py +5 -0
- phenoml/core/client_wrapper.py +2 -2
- phenoml/fhir_provider/__init__.py +8 -2
- phenoml/fhir_provider/client.py +66 -21
- phenoml/fhir_provider/raw_client.py +70 -47
- phenoml/fhir_provider/types/__init__.py +8 -2
- phenoml/fhir_provider/types/fhir_provider_auth_config.py +12 -0
- phenoml/fhir_provider/types/fhir_provider_list_response.py +14 -2
- phenoml/fhir_provider/types/fhir_provider_list_response_fhir_providers_item.py +8 -0
- phenoml/fhir_provider/types/fhir_provider_response.py +9 -2
- phenoml/fhir_provider/types/fhir_provider_response_data.py +8 -0
- phenoml/fhir_provider/types/fhir_provider_sandbox_info.py +46 -0
- phenoml/fhir_provider/types/provider.py +3 -1
- phenoml/fhir_provider/types/service_account_metadata.py +41 -0
- phenoml/lang2fhir/__init__.py +2 -0
- phenoml/lang2fhir/client.py +34 -4
- phenoml/lang2fhir/raw_client.py +34 -4
- phenoml/lang2fhir/types/__init__.py +2 -0
- phenoml/lang2fhir/types/search_response.py +7 -4
- phenoml/lang2fhir/types/search_response_resource_type.py +39 -0
- {phenoml-0.0.18.dist-info → phenoml-0.0.20.dist-info}/METADATA +1 -1
- {phenoml-0.0.18.dist-info → phenoml-0.0.20.dist-info}/RECORD +31 -25
- phenoml/fhir_provider/types/fhir_provider_set_active_auth_config_response.py +0 -22
- {phenoml-0.0.18.dist-info → phenoml-0.0.20.dist-info}/LICENSE +0 -0
- {phenoml-0.0.18.dist-info → phenoml-0.0.20.dist-info}/WHEEL +0 -0
phenoml/agent/__init__.py
CHANGED
|
@@ -8,6 +8,7 @@ from .types import (
|
|
|
8
8
|
AgentCreateRequestProvider,
|
|
9
9
|
AgentDeleteResponse,
|
|
10
10
|
AgentGetChatMessagesRequestOrder,
|
|
11
|
+
AgentGetChatMessagesRequestRole,
|
|
11
12
|
AgentGetChatMessagesResponse,
|
|
12
13
|
AgentListResponse,
|
|
13
14
|
AgentPromptsResponse,
|
|
@@ -15,6 +16,7 @@ from .types import (
|
|
|
15
16
|
AgentTemplate,
|
|
16
17
|
AgentTemplateProvider,
|
|
17
18
|
ChatMessageTemplate,
|
|
19
|
+
ChatMessageTemplateRole,
|
|
18
20
|
ChatSessionTemplate,
|
|
19
21
|
JsonPatch,
|
|
20
22
|
JsonPatchOperation,
|
|
@@ -32,6 +34,7 @@ __all__ = [
|
|
|
32
34
|
"AgentCreateRequestProvider",
|
|
33
35
|
"AgentDeleteResponse",
|
|
34
36
|
"AgentGetChatMessagesRequestOrder",
|
|
37
|
+
"AgentGetChatMessagesRequestRole",
|
|
35
38
|
"AgentGetChatMessagesResponse",
|
|
36
39
|
"AgentListResponse",
|
|
37
40
|
"AgentPromptsResponse",
|
|
@@ -40,6 +43,7 @@ __all__ = [
|
|
|
40
43
|
"AgentTemplateProvider",
|
|
41
44
|
"BadRequestError",
|
|
42
45
|
"ChatMessageTemplate",
|
|
46
|
+
"ChatMessageTemplateRole",
|
|
43
47
|
"ChatSessionTemplate",
|
|
44
48
|
"ForbiddenError",
|
|
45
49
|
"InternalServerError",
|
phenoml/agent/client.py
CHANGED
|
@@ -10,6 +10,7 @@ from .types.agent_chat_response import AgentChatResponse
|
|
|
10
10
|
from .types.agent_create_request_provider import AgentCreateRequestProvider
|
|
11
11
|
from .types.agent_delete_response import AgentDeleteResponse
|
|
12
12
|
from .types.agent_get_chat_messages_request_order import AgentGetChatMessagesRequestOrder
|
|
13
|
+
from .types.agent_get_chat_messages_request_role import AgentGetChatMessagesRequestRole
|
|
13
14
|
from .types.agent_get_chat_messages_response import AgentGetChatMessagesResponse
|
|
14
15
|
from .types.agent_list_response import AgentListResponse
|
|
15
16
|
from .types.agent_response import AgentResponse
|
|
@@ -40,7 +41,6 @@ class AgentClient:
|
|
|
40
41
|
*,
|
|
41
42
|
name: str,
|
|
42
43
|
prompts: typing.Sequence[str],
|
|
43
|
-
is_active: bool,
|
|
44
44
|
description: typing.Optional[str] = OMIT,
|
|
45
45
|
tools: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
46
46
|
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
@@ -58,9 +58,6 @@ class AgentClient:
|
|
|
58
58
|
prompts : typing.Sequence[str]
|
|
59
59
|
Array of prompt IDs to use for this agent
|
|
60
60
|
|
|
61
|
-
is_active : bool
|
|
62
|
-
Whether the agent is active
|
|
63
|
-
|
|
64
61
|
description : typing.Optional[str]
|
|
65
62
|
Agent description
|
|
66
63
|
|
|
@@ -91,13 +88,11 @@ class AgentClient:
|
|
|
91
88
|
client.agent.create(
|
|
92
89
|
name="name",
|
|
93
90
|
prompts=["prompt_123", "prompt_456"],
|
|
94
|
-
is_active=True,
|
|
95
91
|
)
|
|
96
92
|
"""
|
|
97
93
|
_response = self._raw_client.create(
|
|
98
94
|
name=name,
|
|
99
95
|
prompts=prompts,
|
|
100
|
-
is_active=is_active,
|
|
101
96
|
description=description,
|
|
102
97
|
tools=tools,
|
|
103
98
|
tags=tags,
|
|
@@ -107,20 +102,13 @@ class AgentClient:
|
|
|
107
102
|
return _response.data
|
|
108
103
|
|
|
109
104
|
def list(
|
|
110
|
-
self,
|
|
111
|
-
*,
|
|
112
|
-
is_active: typing.Optional[bool] = None,
|
|
113
|
-
tags: typing.Optional[str] = None,
|
|
114
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
105
|
+
self, *, tags: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
|
|
115
106
|
) -> AgentListResponse:
|
|
116
107
|
"""
|
|
117
108
|
Retrieves a list of PhenoAgents belonging to the authenticated user
|
|
118
109
|
|
|
119
110
|
Parameters
|
|
120
111
|
----------
|
|
121
|
-
is_active : typing.Optional[bool]
|
|
122
|
-
Filter by active status
|
|
123
|
-
|
|
124
112
|
tags : typing.Optional[str]
|
|
125
113
|
Filter by tags
|
|
126
114
|
|
|
@@ -140,11 +128,10 @@ class AgentClient:
|
|
|
140
128
|
token="YOUR_TOKEN",
|
|
141
129
|
)
|
|
142
130
|
client.agent.list(
|
|
143
|
-
is_active=True,
|
|
144
131
|
tags="tags",
|
|
145
132
|
)
|
|
146
133
|
"""
|
|
147
|
-
_response = self._raw_client.list(
|
|
134
|
+
_response = self._raw_client.list(tags=tags, request_options=request_options)
|
|
148
135
|
return _response.data
|
|
149
136
|
|
|
150
137
|
def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AgentResponse:
|
|
@@ -184,7 +171,6 @@ class AgentClient:
|
|
|
184
171
|
*,
|
|
185
172
|
name: str,
|
|
186
173
|
prompts: typing.Sequence[str],
|
|
187
|
-
is_active: bool,
|
|
188
174
|
description: typing.Optional[str] = OMIT,
|
|
189
175
|
tools: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
190
176
|
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
@@ -205,9 +191,6 @@ class AgentClient:
|
|
|
205
191
|
prompts : typing.Sequence[str]
|
|
206
192
|
Array of prompt IDs to use for this agent
|
|
207
193
|
|
|
208
|
-
is_active : bool
|
|
209
|
-
Whether the agent is active
|
|
210
|
-
|
|
211
194
|
description : typing.Optional[str]
|
|
212
195
|
Agent description
|
|
213
196
|
|
|
@@ -239,14 +222,12 @@ class AgentClient:
|
|
|
239
222
|
id="id",
|
|
240
223
|
name="name",
|
|
241
224
|
prompts=["prompt_123", "prompt_456"],
|
|
242
|
-
is_active=True,
|
|
243
225
|
)
|
|
244
226
|
"""
|
|
245
227
|
_response = self._raw_client.update(
|
|
246
228
|
id,
|
|
247
229
|
name=name,
|
|
248
230
|
prompts=prompts,
|
|
249
|
-
is_active=is_active,
|
|
250
231
|
description=description,
|
|
251
232
|
tools=tools,
|
|
252
233
|
tags=tags,
|
|
@@ -412,7 +393,7 @@ class AgentClient:
|
|
|
412
393
|
*,
|
|
413
394
|
chat_session_id: str,
|
|
414
395
|
num_messages: typing.Optional[int] = None,
|
|
415
|
-
role: typing.Optional[
|
|
396
|
+
role: typing.Optional[AgentGetChatMessagesRequestRole] = None,
|
|
416
397
|
order: typing.Optional[AgentGetChatMessagesRequestOrder] = None,
|
|
417
398
|
request_options: typing.Optional[RequestOptions] = None,
|
|
418
399
|
) -> AgentGetChatMessagesResponse:
|
|
@@ -427,8 +408,15 @@ class AgentClient:
|
|
|
427
408
|
num_messages : typing.Optional[int]
|
|
428
409
|
Number of messages to return
|
|
429
410
|
|
|
430
|
-
role : typing.Optional[
|
|
431
|
-
Filter by
|
|
411
|
+
role : typing.Optional[AgentGetChatMessagesRequestRole]
|
|
412
|
+
Filter by one or more message roles. Multiple roles can be specified as a comma-separated string.
|
|
413
|
+
If not specified, messages with all roles are returned.
|
|
414
|
+
|
|
415
|
+
**Available roles:**
|
|
416
|
+
- `user` - Messages from the user
|
|
417
|
+
- `assistant` - Text responses from the AI assistant
|
|
418
|
+
- `model` - Function/tool call requests from the model
|
|
419
|
+
- `function` - Function/tool call results
|
|
432
420
|
|
|
433
421
|
order : typing.Optional[AgentGetChatMessagesRequestOrder]
|
|
434
422
|
Order of messages
|
|
@@ -451,7 +439,7 @@ class AgentClient:
|
|
|
451
439
|
client.agent.get_chat_messages(
|
|
452
440
|
chat_session_id="chat_session_id",
|
|
453
441
|
num_messages=1,
|
|
454
|
-
role="
|
|
442
|
+
role="user",
|
|
455
443
|
order="asc",
|
|
456
444
|
)
|
|
457
445
|
"""
|
|
@@ -486,7 +474,6 @@ class AsyncAgentClient:
|
|
|
486
474
|
*,
|
|
487
475
|
name: str,
|
|
488
476
|
prompts: typing.Sequence[str],
|
|
489
|
-
is_active: bool,
|
|
490
477
|
description: typing.Optional[str] = OMIT,
|
|
491
478
|
tools: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
492
479
|
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
@@ -504,9 +491,6 @@ class AsyncAgentClient:
|
|
|
504
491
|
prompts : typing.Sequence[str]
|
|
505
492
|
Array of prompt IDs to use for this agent
|
|
506
493
|
|
|
507
|
-
is_active : bool
|
|
508
|
-
Whether the agent is active
|
|
509
|
-
|
|
510
494
|
description : typing.Optional[str]
|
|
511
495
|
Agent description
|
|
512
496
|
|
|
@@ -542,7 +526,6 @@ class AsyncAgentClient:
|
|
|
542
526
|
await client.agent.create(
|
|
543
527
|
name="name",
|
|
544
528
|
prompts=["prompt_123", "prompt_456"],
|
|
545
|
-
is_active=True,
|
|
546
529
|
)
|
|
547
530
|
|
|
548
531
|
|
|
@@ -551,7 +534,6 @@ class AsyncAgentClient:
|
|
|
551
534
|
_response = await self._raw_client.create(
|
|
552
535
|
name=name,
|
|
553
536
|
prompts=prompts,
|
|
554
|
-
is_active=is_active,
|
|
555
537
|
description=description,
|
|
556
538
|
tools=tools,
|
|
557
539
|
tags=tags,
|
|
@@ -561,20 +543,13 @@ class AsyncAgentClient:
|
|
|
561
543
|
return _response.data
|
|
562
544
|
|
|
563
545
|
async def list(
|
|
564
|
-
self,
|
|
565
|
-
*,
|
|
566
|
-
is_active: typing.Optional[bool] = None,
|
|
567
|
-
tags: typing.Optional[str] = None,
|
|
568
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
546
|
+
self, *, tags: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
|
|
569
547
|
) -> AgentListResponse:
|
|
570
548
|
"""
|
|
571
549
|
Retrieves a list of PhenoAgents belonging to the authenticated user
|
|
572
550
|
|
|
573
551
|
Parameters
|
|
574
552
|
----------
|
|
575
|
-
is_active : typing.Optional[bool]
|
|
576
|
-
Filter by active status
|
|
577
|
-
|
|
578
553
|
tags : typing.Optional[str]
|
|
579
554
|
Filter by tags
|
|
580
555
|
|
|
@@ -599,14 +574,13 @@ class AsyncAgentClient:
|
|
|
599
574
|
|
|
600
575
|
async def main() -> None:
|
|
601
576
|
await client.agent.list(
|
|
602
|
-
is_active=True,
|
|
603
577
|
tags="tags",
|
|
604
578
|
)
|
|
605
579
|
|
|
606
580
|
|
|
607
581
|
asyncio.run(main())
|
|
608
582
|
"""
|
|
609
|
-
_response = await self._raw_client.list(
|
|
583
|
+
_response = await self._raw_client.list(tags=tags, request_options=request_options)
|
|
610
584
|
return _response.data
|
|
611
585
|
|
|
612
586
|
async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AgentResponse:
|
|
@@ -654,7 +628,6 @@ class AsyncAgentClient:
|
|
|
654
628
|
*,
|
|
655
629
|
name: str,
|
|
656
630
|
prompts: typing.Sequence[str],
|
|
657
|
-
is_active: bool,
|
|
658
631
|
description: typing.Optional[str] = OMIT,
|
|
659
632
|
tools: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
660
633
|
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
@@ -675,9 +648,6 @@ class AsyncAgentClient:
|
|
|
675
648
|
prompts : typing.Sequence[str]
|
|
676
649
|
Array of prompt IDs to use for this agent
|
|
677
650
|
|
|
678
|
-
is_active : bool
|
|
679
|
-
Whether the agent is active
|
|
680
|
-
|
|
681
651
|
description : typing.Optional[str]
|
|
682
652
|
Agent description
|
|
683
653
|
|
|
@@ -714,7 +684,6 @@ class AsyncAgentClient:
|
|
|
714
684
|
id="id",
|
|
715
685
|
name="name",
|
|
716
686
|
prompts=["prompt_123", "prompt_456"],
|
|
717
|
-
is_active=True,
|
|
718
687
|
)
|
|
719
688
|
|
|
720
689
|
|
|
@@ -724,7 +693,6 @@ class AsyncAgentClient:
|
|
|
724
693
|
id,
|
|
725
694
|
name=name,
|
|
726
695
|
prompts=prompts,
|
|
727
|
-
is_active=is_active,
|
|
728
696
|
description=description,
|
|
729
697
|
tools=tools,
|
|
730
698
|
tags=tags,
|
|
@@ -914,7 +882,7 @@ class AsyncAgentClient:
|
|
|
914
882
|
*,
|
|
915
883
|
chat_session_id: str,
|
|
916
884
|
num_messages: typing.Optional[int] = None,
|
|
917
|
-
role: typing.Optional[
|
|
885
|
+
role: typing.Optional[AgentGetChatMessagesRequestRole] = None,
|
|
918
886
|
order: typing.Optional[AgentGetChatMessagesRequestOrder] = None,
|
|
919
887
|
request_options: typing.Optional[RequestOptions] = None,
|
|
920
888
|
) -> AgentGetChatMessagesResponse:
|
|
@@ -929,8 +897,15 @@ class AsyncAgentClient:
|
|
|
929
897
|
num_messages : typing.Optional[int]
|
|
930
898
|
Number of messages to return
|
|
931
899
|
|
|
932
|
-
role : typing.Optional[
|
|
933
|
-
Filter by
|
|
900
|
+
role : typing.Optional[AgentGetChatMessagesRequestRole]
|
|
901
|
+
Filter by one or more message roles. Multiple roles can be specified as a comma-separated string.
|
|
902
|
+
If not specified, messages with all roles are returned.
|
|
903
|
+
|
|
904
|
+
**Available roles:**
|
|
905
|
+
- `user` - Messages from the user
|
|
906
|
+
- `assistant` - Text responses from the AI assistant
|
|
907
|
+
- `model` - Function/tool call requests from the model
|
|
908
|
+
- `function` - Function/tool call results
|
|
934
909
|
|
|
935
910
|
order : typing.Optional[AgentGetChatMessagesRequestOrder]
|
|
936
911
|
Order of messages
|
|
@@ -958,7 +933,7 @@ class AsyncAgentClient:
|
|
|
958
933
|
await client.agent.get_chat_messages(
|
|
959
934
|
chat_session_id="chat_session_id",
|
|
960
935
|
num_messages=1,
|
|
961
|
-
role="
|
|
936
|
+
role="user",
|
|
962
937
|
order="asc",
|
|
963
938
|
)
|
|
964
939
|
|
phenoml/agent/raw_client.py
CHANGED
|
@@ -19,6 +19,7 @@ from .types.agent_chat_response import AgentChatResponse
|
|
|
19
19
|
from .types.agent_create_request_provider import AgentCreateRequestProvider
|
|
20
20
|
from .types.agent_delete_response import AgentDeleteResponse
|
|
21
21
|
from .types.agent_get_chat_messages_request_order import AgentGetChatMessagesRequestOrder
|
|
22
|
+
from .types.agent_get_chat_messages_request_role import AgentGetChatMessagesRequestRole
|
|
22
23
|
from .types.agent_get_chat_messages_response import AgentGetChatMessagesResponse
|
|
23
24
|
from .types.agent_list_response import AgentListResponse
|
|
24
25
|
from .types.agent_response import AgentResponse
|
|
@@ -37,7 +38,6 @@ class RawAgentClient:
|
|
|
37
38
|
*,
|
|
38
39
|
name: str,
|
|
39
40
|
prompts: typing.Sequence[str],
|
|
40
|
-
is_active: bool,
|
|
41
41
|
description: typing.Optional[str] = OMIT,
|
|
42
42
|
tools: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
43
43
|
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
@@ -55,9 +55,6 @@ class RawAgentClient:
|
|
|
55
55
|
prompts : typing.Sequence[str]
|
|
56
56
|
Array of prompt IDs to use for this agent
|
|
57
57
|
|
|
58
|
-
is_active : bool
|
|
59
|
-
Whether the agent is active
|
|
60
|
-
|
|
61
58
|
description : typing.Optional[str]
|
|
62
59
|
Agent description
|
|
63
60
|
|
|
@@ -86,7 +83,6 @@ class RawAgentClient:
|
|
|
86
83
|
"description": description,
|
|
87
84
|
"prompts": prompts,
|
|
88
85
|
"tools": tools,
|
|
89
|
-
"is_active": is_active,
|
|
90
86
|
"tags": tags,
|
|
91
87
|
"provider": convert_and_respect_annotation_metadata(
|
|
92
88
|
object_=provider, annotation=AgentCreateRequestProvider, direction="write"
|
|
@@ -158,20 +154,13 @@ class RawAgentClient:
|
|
|
158
154
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
159
155
|
|
|
160
156
|
def list(
|
|
161
|
-
self,
|
|
162
|
-
*,
|
|
163
|
-
is_active: typing.Optional[bool] = None,
|
|
164
|
-
tags: typing.Optional[str] = None,
|
|
165
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
157
|
+
self, *, tags: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
|
|
166
158
|
) -> HttpResponse[AgentListResponse]:
|
|
167
159
|
"""
|
|
168
160
|
Retrieves a list of PhenoAgents belonging to the authenticated user
|
|
169
161
|
|
|
170
162
|
Parameters
|
|
171
163
|
----------
|
|
172
|
-
is_active : typing.Optional[bool]
|
|
173
|
-
Filter by active status
|
|
174
|
-
|
|
175
164
|
tags : typing.Optional[str]
|
|
176
165
|
Filter by tags
|
|
177
166
|
|
|
@@ -187,7 +176,6 @@ class RawAgentClient:
|
|
|
187
176
|
"agent/list",
|
|
188
177
|
method="GET",
|
|
189
178
|
params={
|
|
190
|
-
"is_active": is_active,
|
|
191
179
|
"tags": tags,
|
|
192
180
|
},
|
|
193
181
|
request_options=request_options,
|
|
@@ -327,7 +315,6 @@ class RawAgentClient:
|
|
|
327
315
|
*,
|
|
328
316
|
name: str,
|
|
329
317
|
prompts: typing.Sequence[str],
|
|
330
|
-
is_active: bool,
|
|
331
318
|
description: typing.Optional[str] = OMIT,
|
|
332
319
|
tools: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
333
320
|
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
@@ -348,9 +335,6 @@ class RawAgentClient:
|
|
|
348
335
|
prompts : typing.Sequence[str]
|
|
349
336
|
Array of prompt IDs to use for this agent
|
|
350
337
|
|
|
351
|
-
is_active : bool
|
|
352
|
-
Whether the agent is active
|
|
353
|
-
|
|
354
338
|
description : typing.Optional[str]
|
|
355
339
|
Agent description
|
|
356
340
|
|
|
@@ -379,7 +363,6 @@ class RawAgentClient:
|
|
|
379
363
|
"description": description,
|
|
380
364
|
"prompts": prompts,
|
|
381
365
|
"tools": tools,
|
|
382
|
-
"is_active": is_active,
|
|
383
366
|
"tags": tags,
|
|
384
367
|
"provider": convert_and_respect_annotation_metadata(
|
|
385
368
|
object_=provider, annotation=AgentCreateRequestProvider, direction="write"
|
|
@@ -770,7 +753,7 @@ class RawAgentClient:
|
|
|
770
753
|
*,
|
|
771
754
|
chat_session_id: str,
|
|
772
755
|
num_messages: typing.Optional[int] = None,
|
|
773
|
-
role: typing.Optional[
|
|
756
|
+
role: typing.Optional[AgentGetChatMessagesRequestRole] = None,
|
|
774
757
|
order: typing.Optional[AgentGetChatMessagesRequestOrder] = None,
|
|
775
758
|
request_options: typing.Optional[RequestOptions] = None,
|
|
776
759
|
) -> HttpResponse[AgentGetChatMessagesResponse]:
|
|
@@ -785,8 +768,15 @@ class RawAgentClient:
|
|
|
785
768
|
num_messages : typing.Optional[int]
|
|
786
769
|
Number of messages to return
|
|
787
770
|
|
|
788
|
-
role : typing.Optional[
|
|
789
|
-
Filter by
|
|
771
|
+
role : typing.Optional[AgentGetChatMessagesRequestRole]
|
|
772
|
+
Filter by one or more message roles. Multiple roles can be specified as a comma-separated string.
|
|
773
|
+
If not specified, messages with all roles are returned.
|
|
774
|
+
|
|
775
|
+
**Available roles:**
|
|
776
|
+
- `user` - Messages from the user
|
|
777
|
+
- `assistant` - Text responses from the AI assistant
|
|
778
|
+
- `model` - Function/tool call requests from the model
|
|
779
|
+
- `function` - Function/tool call results
|
|
790
780
|
|
|
791
781
|
order : typing.Optional[AgentGetChatMessagesRequestOrder]
|
|
792
782
|
Order of messages
|
|
@@ -868,7 +858,6 @@ class AsyncRawAgentClient:
|
|
|
868
858
|
*,
|
|
869
859
|
name: str,
|
|
870
860
|
prompts: typing.Sequence[str],
|
|
871
|
-
is_active: bool,
|
|
872
861
|
description: typing.Optional[str] = OMIT,
|
|
873
862
|
tools: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
874
863
|
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
@@ -886,9 +875,6 @@ class AsyncRawAgentClient:
|
|
|
886
875
|
prompts : typing.Sequence[str]
|
|
887
876
|
Array of prompt IDs to use for this agent
|
|
888
877
|
|
|
889
|
-
is_active : bool
|
|
890
|
-
Whether the agent is active
|
|
891
|
-
|
|
892
878
|
description : typing.Optional[str]
|
|
893
879
|
Agent description
|
|
894
880
|
|
|
@@ -917,7 +903,6 @@ class AsyncRawAgentClient:
|
|
|
917
903
|
"description": description,
|
|
918
904
|
"prompts": prompts,
|
|
919
905
|
"tools": tools,
|
|
920
|
-
"is_active": is_active,
|
|
921
906
|
"tags": tags,
|
|
922
907
|
"provider": convert_and_respect_annotation_metadata(
|
|
923
908
|
object_=provider, annotation=AgentCreateRequestProvider, direction="write"
|
|
@@ -989,20 +974,13 @@ class AsyncRawAgentClient:
|
|
|
989
974
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
990
975
|
|
|
991
976
|
async def list(
|
|
992
|
-
self,
|
|
993
|
-
*,
|
|
994
|
-
is_active: typing.Optional[bool] = None,
|
|
995
|
-
tags: typing.Optional[str] = None,
|
|
996
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
977
|
+
self, *, tags: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
|
|
997
978
|
) -> AsyncHttpResponse[AgentListResponse]:
|
|
998
979
|
"""
|
|
999
980
|
Retrieves a list of PhenoAgents belonging to the authenticated user
|
|
1000
981
|
|
|
1001
982
|
Parameters
|
|
1002
983
|
----------
|
|
1003
|
-
is_active : typing.Optional[bool]
|
|
1004
|
-
Filter by active status
|
|
1005
|
-
|
|
1006
984
|
tags : typing.Optional[str]
|
|
1007
985
|
Filter by tags
|
|
1008
986
|
|
|
@@ -1018,7 +996,6 @@ class AsyncRawAgentClient:
|
|
|
1018
996
|
"agent/list",
|
|
1019
997
|
method="GET",
|
|
1020
998
|
params={
|
|
1021
|
-
"is_active": is_active,
|
|
1022
999
|
"tags": tags,
|
|
1023
1000
|
},
|
|
1024
1001
|
request_options=request_options,
|
|
@@ -1160,7 +1137,6 @@ class AsyncRawAgentClient:
|
|
|
1160
1137
|
*,
|
|
1161
1138
|
name: str,
|
|
1162
1139
|
prompts: typing.Sequence[str],
|
|
1163
|
-
is_active: bool,
|
|
1164
1140
|
description: typing.Optional[str] = OMIT,
|
|
1165
1141
|
tools: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
1166
1142
|
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
@@ -1181,9 +1157,6 @@ class AsyncRawAgentClient:
|
|
|
1181
1157
|
prompts : typing.Sequence[str]
|
|
1182
1158
|
Array of prompt IDs to use for this agent
|
|
1183
1159
|
|
|
1184
|
-
is_active : bool
|
|
1185
|
-
Whether the agent is active
|
|
1186
|
-
|
|
1187
1160
|
description : typing.Optional[str]
|
|
1188
1161
|
Agent description
|
|
1189
1162
|
|
|
@@ -1212,7 +1185,6 @@ class AsyncRawAgentClient:
|
|
|
1212
1185
|
"description": description,
|
|
1213
1186
|
"prompts": prompts,
|
|
1214
1187
|
"tools": tools,
|
|
1215
|
-
"is_active": is_active,
|
|
1216
1188
|
"tags": tags,
|
|
1217
1189
|
"provider": convert_and_respect_annotation_metadata(
|
|
1218
1190
|
object_=provider, annotation=AgentCreateRequestProvider, direction="write"
|
|
@@ -1603,7 +1575,7 @@ class AsyncRawAgentClient:
|
|
|
1603
1575
|
*,
|
|
1604
1576
|
chat_session_id: str,
|
|
1605
1577
|
num_messages: typing.Optional[int] = None,
|
|
1606
|
-
role: typing.Optional[
|
|
1578
|
+
role: typing.Optional[AgentGetChatMessagesRequestRole] = None,
|
|
1607
1579
|
order: typing.Optional[AgentGetChatMessagesRequestOrder] = None,
|
|
1608
1580
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1609
1581
|
) -> AsyncHttpResponse[AgentGetChatMessagesResponse]:
|
|
@@ -1618,8 +1590,15 @@ class AsyncRawAgentClient:
|
|
|
1618
1590
|
num_messages : typing.Optional[int]
|
|
1619
1591
|
Number of messages to return
|
|
1620
1592
|
|
|
1621
|
-
role : typing.Optional[
|
|
1622
|
-
Filter by
|
|
1593
|
+
role : typing.Optional[AgentGetChatMessagesRequestRole]
|
|
1594
|
+
Filter by one or more message roles. Multiple roles can be specified as a comma-separated string.
|
|
1595
|
+
If not specified, messages with all roles are returned.
|
|
1596
|
+
|
|
1597
|
+
**Available roles:**
|
|
1598
|
+
- `user` - Messages from the user
|
|
1599
|
+
- `assistant` - Text responses from the AI assistant
|
|
1600
|
+
- `model` - Function/tool call requests from the model
|
|
1601
|
+
- `function` - Function/tool call results
|
|
1623
1602
|
|
|
1624
1603
|
order : typing.Optional[AgentGetChatMessagesRequestOrder]
|
|
1625
1604
|
Order of messages
|
phenoml/agent/types/__init__.py
CHANGED
|
@@ -7,6 +7,7 @@ from .agent_create_request import AgentCreateRequest
|
|
|
7
7
|
from .agent_create_request_provider import AgentCreateRequestProvider
|
|
8
8
|
from .agent_delete_response import AgentDeleteResponse
|
|
9
9
|
from .agent_get_chat_messages_request_order import AgentGetChatMessagesRequestOrder
|
|
10
|
+
from .agent_get_chat_messages_request_role import AgentGetChatMessagesRequestRole
|
|
10
11
|
from .agent_get_chat_messages_response import AgentGetChatMessagesResponse
|
|
11
12
|
from .agent_list_response import AgentListResponse
|
|
12
13
|
from .agent_prompts_response import AgentPromptsResponse
|
|
@@ -14,6 +15,7 @@ from .agent_response import AgentResponse
|
|
|
14
15
|
from .agent_template import AgentTemplate
|
|
15
16
|
from .agent_template_provider import AgentTemplateProvider
|
|
16
17
|
from .chat_message_template import ChatMessageTemplate
|
|
18
|
+
from .chat_message_template_role import ChatMessageTemplateRole
|
|
17
19
|
from .chat_session_template import ChatSessionTemplate
|
|
18
20
|
from .json_patch import JsonPatch
|
|
19
21
|
from .json_patch_operation import JsonPatchOperation
|
|
@@ -27,6 +29,7 @@ __all__ = [
|
|
|
27
29
|
"AgentCreateRequestProvider",
|
|
28
30
|
"AgentDeleteResponse",
|
|
29
31
|
"AgentGetChatMessagesRequestOrder",
|
|
32
|
+
"AgentGetChatMessagesRequestRole",
|
|
30
33
|
"AgentGetChatMessagesResponse",
|
|
31
34
|
"AgentListResponse",
|
|
32
35
|
"AgentPromptsResponse",
|
|
@@ -34,6 +37,7 @@ __all__ = [
|
|
|
34
37
|
"AgentTemplate",
|
|
35
38
|
"AgentTemplateProvider",
|
|
36
39
|
"ChatMessageTemplate",
|
|
40
|
+
"ChatMessageTemplateRole",
|
|
37
41
|
"ChatSessionTemplate",
|
|
38
42
|
"JsonPatch",
|
|
39
43
|
"JsonPatchOperation",
|
|
@@ -28,11 +28,6 @@ class AgentCreateRequest(UniversalBaseModel):
|
|
|
28
28
|
Array of MCP server tool IDs to use for this agent
|
|
29
29
|
"""
|
|
30
30
|
|
|
31
|
-
is_active: bool = pydantic.Field()
|
|
32
|
-
"""
|
|
33
|
-
Whether the agent is active
|
|
34
|
-
"""
|
|
35
|
-
|
|
36
31
|
tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
|
|
37
32
|
"""
|
|
38
33
|
Tags for categorizing the agent
|
|
@@ -4,6 +4,7 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .chat_message_template_role import ChatMessageTemplateRole
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class ChatMessageTemplate(UniversalBaseModel):
|
|
@@ -17,9 +18,13 @@ class ChatMessageTemplate(UniversalBaseModel):
|
|
|
17
18
|
Chat session ID
|
|
18
19
|
"""
|
|
19
20
|
|
|
20
|
-
role: typing.Optional[
|
|
21
|
+
role: typing.Optional[ChatMessageTemplateRole] = pydantic.Field(default=None)
|
|
21
22
|
"""
|
|
22
|
-
Message role
|
|
23
|
+
Message role indicating the source/type of the message:
|
|
24
|
+
- `user` - Messages from the user
|
|
25
|
+
- `assistant` - Text responses from the AI assistant
|
|
26
|
+
- `model` - Function/tool call requests to the model
|
|
27
|
+
- `function` - Function/tool call results
|
|
23
28
|
"""
|
|
24
29
|
|
|
25
30
|
content: typing.Optional[str] = pydantic.Field(default=None)
|
phenoml/core/client_wrapper.py
CHANGED
|
@@ -22,10 +22,10 @@ class BaseClientWrapper:
|
|
|
22
22
|
|
|
23
23
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
24
24
|
headers: typing.Dict[str, str] = {
|
|
25
|
-
"User-Agent": "phenoml/
|
|
25
|
+
"User-Agent": "phenoml/0.0.20",
|
|
26
26
|
"X-Fern-Language": "Python",
|
|
27
27
|
"X-Fern-SDK-Name": "phenoml",
|
|
28
|
-
"X-Fern-SDK-Version": "
|
|
28
|
+
"X-Fern-SDK-Version": "0.0.20",
|
|
29
29
|
**(self.get_custom_headers() or {}),
|
|
30
30
|
}
|
|
31
31
|
headers["Authorization"] = f"Bearer {self._get_token()}"
|
|
@@ -7,9 +7,11 @@ from .types import (
|
|
|
7
7
|
FhirProviderAuthConfig,
|
|
8
8
|
FhirProviderDeleteResponse,
|
|
9
9
|
FhirProviderListResponse,
|
|
10
|
+
FhirProviderListResponseFhirProvidersItem,
|
|
10
11
|
FhirProviderRemoveAuthConfigResponse,
|
|
11
12
|
FhirProviderResponse,
|
|
12
|
-
|
|
13
|
+
FhirProviderResponseData,
|
|
14
|
+
FhirProviderSandboxInfo,
|
|
13
15
|
FhirProviderTemplate,
|
|
14
16
|
FhirQueryResponse,
|
|
15
17
|
FhirQueryResponseData,
|
|
@@ -17,6 +19,7 @@ from .types import (
|
|
|
17
19
|
Provider,
|
|
18
20
|
Role,
|
|
19
21
|
ServiceAccountKey,
|
|
22
|
+
ServiceAccountMetadata,
|
|
20
23
|
SmartConfiguration,
|
|
21
24
|
)
|
|
22
25
|
from .errors import BadRequestError, ForbiddenError, InternalServerError, NotFoundError, UnauthorizedError
|
|
@@ -27,9 +30,11 @@ __all__ = [
|
|
|
27
30
|
"FhirProviderAuthConfig",
|
|
28
31
|
"FhirProviderDeleteResponse",
|
|
29
32
|
"FhirProviderListResponse",
|
|
33
|
+
"FhirProviderListResponseFhirProvidersItem",
|
|
30
34
|
"FhirProviderRemoveAuthConfigResponse",
|
|
31
35
|
"FhirProviderResponse",
|
|
32
|
-
"
|
|
36
|
+
"FhirProviderResponseData",
|
|
37
|
+
"FhirProviderSandboxInfo",
|
|
33
38
|
"FhirProviderTemplate",
|
|
34
39
|
"FhirQueryResponse",
|
|
35
40
|
"FhirQueryResponseData",
|
|
@@ -40,6 +45,7 @@ __all__ = [
|
|
|
40
45
|
"Provider",
|
|
41
46
|
"Role",
|
|
42
47
|
"ServiceAccountKey",
|
|
48
|
+
"ServiceAccountMetadata",
|
|
43
49
|
"SmartConfiguration",
|
|
44
50
|
"UnauthorizedError",
|
|
45
51
|
]
|