@@ -63,6 +63,7 @@ def create(
63
63
include_retrieval_content_text : bool | NotGiven = NOT_GIVEN ,
64
64
retrievals_only : bool | NotGiven = NOT_GIVEN ,
65
65
conversation_id : str | NotGiven = NOT_GIVEN ,
66
+ documents_filters : query_create_params .DocumentsFilters | NotGiven = NOT_GIVEN ,
66
67
llm_model_id : str | NotGiven = NOT_GIVEN ,
67
68
stream : bool | NotGiven = NOT_GIVEN ,
68
69
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -97,6 +98,41 @@ def create(
97
98
provided, all messages in the `messages` list prior to the latest user-sent
98
99
query will be ignored.
99
100
101
+ documents_filters: Defines an Optional custom metadata filter, which can be a list of filters or
102
+ nested filters. The expected input is a nested JSON object that can represent a
103
+ single filter or a composite (logical) combination of filters.
104
+
105
+ Unnested Example:
106
+
107
+ ```json
108
+ {
109
+ "operator": "AND",
110
+ "filters": [{ "field": "status", "operator": "equals", "value": "active" }]
111
+ }
112
+ ```
113
+
114
+ Nested example:
115
+
116
+ ```json
117
+ {
118
+ "operator": "AND",
119
+ "filters": [
120
+ { "field": "status", "operator": "equals", "value": "active" },
121
+ {
122
+ "operator": "OR",
123
+ "filters": [
124
+ {
125
+ "field": "category",
126
+ "operator": "containsany",
127
+ "value": ["policy", "HR"]
128
+ },
129
+ { "field": "tags", "operator": "exists" }
130
+ ]
131
+ }
132
+ ]
133
+ }
134
+ ```
135
+
100
136
llm_model_id: Model ID of the specific fine-tuned or aligned LLM model to use. Defaults to
101
137
base model if not specified.
102
138
@@ -118,6 +154,7 @@ def create(
118
154
{
119
155
"messages" : messages ,
120
156
"conversation_id" : conversation_id ,
157
+ "documents_filters" : documents_filters ,
121
158
"llm_model_id" : llm_model_id ,
122
159
"stream" : stream ,
123
160
},
@@ -210,10 +247,12 @@ def metrics(
210
247
self ,
211
248
agent_id : str ,
212
249
* ,
250
+ conversation_ids : List [str ] | NotGiven = NOT_GIVEN ,
213
251
created_after : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
214
252
created_before : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
215
253
limit : int | NotGiven = NOT_GIVEN ,
216
254
offset : int | NotGiven = NOT_GIVEN ,
255
+ user_emails : List [str ] | NotGiven = NOT_GIVEN ,
217
256
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
218
257
# The extra values given here take precedence over values defined on the client or passed to this method.
219
258
extra_headers : Headers | None = None ,
@@ -229,6 +268,8 @@ def metrics(
229
268
Args:
230
269
agent_id: Agent ID of the agent to get metrics for
231
270
271
+ conversation_ids: Filter messages by conversation ids.
272
+
232
273
created_after: Filters messages that are created after the specified timestamp.
233
274
234
275
created_before: Filters messages that are created before specified timestamp.
@@ -237,6 +278,8 @@ def metrics(
237
278
238
279
offset: Offset for pagination.
239
280
281
+ user_emails: Filter messages by users.
282
+
240
283
extra_headers: Send extra headers
241
284
242
285
extra_query: Add additional query parameters to the request
@@ -256,10 +299,12 @@ def metrics(
256
299
timeout = timeout ,
257
300
query = maybe_transform (
258
301
{
302
+ "conversation_ids" : conversation_ids ,
259
303
"created_after" : created_after ,
260
304
"created_before" : created_before ,
261
305
"limit" : limit ,
262
306
"offset" : offset ,
307
+ "user_emails" : user_emails ,
263
308
},
264
309
query_metrics_params .QueryMetricsParams ,
265
310
),
@@ -346,6 +391,7 @@ async def create(
346
391
include_retrieval_content_text : bool | NotGiven = NOT_GIVEN ,
347
392
retrievals_only : bool | NotGiven = NOT_GIVEN ,
348
393
conversation_id : str | NotGiven = NOT_GIVEN ,
394
+ documents_filters : query_create_params .DocumentsFilters | NotGiven = NOT_GIVEN ,
349
395
llm_model_id : str | NotGiven = NOT_GIVEN ,
350
396
stream : bool | NotGiven = NOT_GIVEN ,
351
397
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -380,6 +426,41 @@ async def create(
380
426
provided, all messages in the `messages` list prior to the latest user-sent
381
427
query will be ignored.
382
428
429
+ documents_filters: Defines an Optional custom metadata filter, which can be a list of filters or
430
+ nested filters. The expected input is a nested JSON object that can represent a
431
+ single filter or a composite (logical) combination of filters.
432
+
433
+ Unnested Example:
434
+
435
+ ```json
436
+ {
437
+ "operator": "AND",
438
+ "filters": [{ "field": "status", "operator": "equals", "value": "active" }]
439
+ }
440
+ ```
441
+
442
+ Nested example:
443
+
444
+ ```json
445
+ {
446
+ "operator": "AND",
447
+ "filters": [
448
+ { "field": "status", "operator": "equals", "value": "active" },
449
+ {
450
+ "operator": "OR",
451
+ "filters": [
452
+ {
453
+ "field": "category",
454
+ "operator": "containsany",
455
+ "value": ["policy", "HR"]
456
+ },
457
+ { "field": "tags", "operator": "exists" }
458
+ ]
459
+ }
460
+ ]
461
+ }
462
+ ```
463
+
383
464
llm_model_id: Model ID of the specific fine-tuned or aligned LLM model to use. Defaults to
384
465
base model if not specified.
385
466
@@ -401,6 +482,7 @@ async def create(
401
482
{
402
483
"messages" : messages ,
403
484
"conversation_id" : conversation_id ,
485
+ "documents_filters" : documents_filters ,
404
486
"llm_model_id" : llm_model_id ,
405
487
"stream" : stream ,
406
488
},
@@ -493,10 +575,12 @@ async def metrics(
493
575
self ,
494
576
agent_id : str ,
495
577
* ,
578
+ conversation_ids : List [str ] | NotGiven = NOT_GIVEN ,
496
579
created_after : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
497
580
created_before : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
498
581
limit : int | NotGiven = NOT_GIVEN ,
499
582
offset : int | NotGiven = NOT_GIVEN ,
583
+ user_emails : List [str ] | NotGiven = NOT_GIVEN ,
500
584
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
501
585
# The extra values given here take precedence over values defined on the client or passed to this method.
502
586
extra_headers : Headers | None = None ,
@@ -512,6 +596,8 @@ async def metrics(
512
596
Args:
513
597
agent_id: Agent ID of the agent to get metrics for
514
598
599
+ conversation_ids: Filter messages by conversation ids.
600
+
515
601
created_after: Filters messages that are created after the specified timestamp.
516
602
517
603
created_before: Filters messages that are created before specified timestamp.
@@ -520,6 +606,8 @@ async def metrics(
520
606
521
607
offset: Offset for pagination.
522
608
609
+ user_emails: Filter messages by users.
610
+
523
611
extra_headers: Send extra headers
524
612
525
613
extra_query: Add additional query parameters to the request
@@ -539,10 +627,12 @@ async def metrics(
539
627
timeout = timeout ,
540
628
query = await async_maybe_transform (
541
629
{
630
+ "conversation_ids" : conversation_ids ,
542
631
"created_after" : created_after ,
543
632
"created_before" : created_before ,
544
633
"limit" : limit ,
545
634
"offset" : offset ,
635
+ "user_emails" : user_emails ,
546
636
},
547
637
query_metrics_params .QueryMetricsParams ,
548
638
),
0 commit comments