|
2 | 2 |
|
3 | 3 | from __future__ import annotations
|
4 | 4 |
|
5 |
| -from typing import Optional |
| 5 | +from typing import Iterable, Optional |
6 | 6 |
|
7 | 7 | import httpx
|
8 | 8 |
|
@@ -54,6 +54,7 @@ def create(
|
54 | 54 | *,
|
55 | 55 | question: str,
|
56 | 56 | answer: Optional[str] | NotGiven = NOT_GIVEN,
|
| 57 | + client_query_metadata: Iterable[object] | NotGiven = NOT_GIVEN, |
57 | 58 | draft_answer: Optional[str] | NotGiven = NOT_GIVEN,
|
58 | 59 | x_client_library_version: str | NotGiven = NOT_GIVEN,
|
59 | 60 | x_integration_type: str | NotGiven = NOT_GIVEN,
|
@@ -97,6 +98,7 @@ def create(
|
97 | 98 | {
|
98 | 99 | "question": question,
|
99 | 100 | "answer": answer,
|
| 101 | + "client_query_metadata": client_query_metadata, |
100 | 102 | "draft_answer": draft_answer,
|
101 | 103 | },
|
102 | 104 | entry_create_params.EntryCreateParams,
|
@@ -232,6 +234,7 @@ def query(
|
232 | 234 | project_id: str,
|
233 | 235 | *,
|
234 | 236 | question: str,
|
| 237 | + client_metadata: Optional[object] | NotGiven = NOT_GIVEN, |
235 | 238 | x_client_library_version: str | NotGiven = NOT_GIVEN,
|
236 | 239 | x_integration_type: str | NotGiven = NOT_GIVEN,
|
237 | 240 | x_source: str | NotGiven = NOT_GIVEN,
|
@@ -270,7 +273,13 @@ def query(
|
270 | 273 | }
|
271 | 274 | return self._post(
|
272 | 275 | f"/api/projects/{project_id}/entries/query",
|
273 |
| - body=maybe_transform({"question": question}, entry_query_params.EntryQueryParams), |
| 276 | + body=maybe_transform( |
| 277 | + { |
| 278 | + "question": question, |
| 279 | + "client_metadata": client_metadata, |
| 280 | + }, |
| 281 | + entry_query_params.EntryQueryParams, |
| 282 | + ), |
274 | 283 | options=make_request_options(
|
275 | 284 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
276 | 285 | ),
|
@@ -304,6 +313,7 @@ async def create(
|
304 | 313 | *,
|
305 | 314 | question: str,
|
306 | 315 | answer: Optional[str] | NotGiven = NOT_GIVEN,
|
| 316 | + client_query_metadata: Iterable[object] | NotGiven = NOT_GIVEN, |
307 | 317 | draft_answer: Optional[str] | NotGiven = NOT_GIVEN,
|
308 | 318 | x_client_library_version: str | NotGiven = NOT_GIVEN,
|
309 | 319 | x_integration_type: str | NotGiven = NOT_GIVEN,
|
@@ -347,6 +357,7 @@ async def create(
|
347 | 357 | {
|
348 | 358 | "question": question,
|
349 | 359 | "answer": answer,
|
| 360 | + "client_query_metadata": client_query_metadata, |
350 | 361 | "draft_answer": draft_answer,
|
351 | 362 | },
|
352 | 363 | entry_create_params.EntryCreateParams,
|
@@ -482,6 +493,7 @@ async def query(
|
482 | 493 | project_id: str,
|
483 | 494 | *,
|
484 | 495 | question: str,
|
| 496 | + client_metadata: Optional[object] | NotGiven = NOT_GIVEN, |
485 | 497 | x_client_library_version: str | NotGiven = NOT_GIVEN,
|
486 | 498 | x_integration_type: str | NotGiven = NOT_GIVEN,
|
487 | 499 | x_source: str | NotGiven = NOT_GIVEN,
|
@@ -520,7 +532,13 @@ async def query(
|
520 | 532 | }
|
521 | 533 | return await self._post(
|
522 | 534 | f"/api/projects/{project_id}/entries/query",
|
523 |
| - body=await async_maybe_transform({"question": question}, entry_query_params.EntryQueryParams), |
| 535 | + body=await async_maybe_transform( |
| 536 | + { |
| 537 | + "question": question, |
| 538 | + "client_metadata": client_metadata, |
| 539 | + }, |
| 540 | + entry_query_params.EntryQueryParams, |
| 541 | + ), |
524 | 542 | options=make_request_options(
|
525 | 543 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
526 | 544 | ),
|
|
0 commit comments