orq-ai-sdk 4.2.0rc49__py3-none-any.whl → 4.2.15__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.
Files changed (104) hide show
  1. orq_ai_sdk/_hooks/globalhook.py +0 -1
  2. orq_ai_sdk/_version.py +3 -3
  3. orq_ai_sdk/agents.py +186 -186
  4. orq_ai_sdk/audio.py +30 -0
  5. orq_ai_sdk/chat.py +22 -0
  6. orq_ai_sdk/completions.py +438 -0
  7. orq_ai_sdk/contacts.py +43 -886
  8. orq_ai_sdk/deployments.py +61 -0
  9. orq_ai_sdk/edits.py +364 -0
  10. orq_ai_sdk/embeddings.py +344 -0
  11. orq_ai_sdk/generations.py +370 -0
  12. orq_ai_sdk/images.py +28 -0
  13. orq_ai_sdk/models/__init__.py +3839 -424
  14. orq_ai_sdk/models/conversationresponse.py +1 -1
  15. orq_ai_sdk/models/conversationwithmessagesresponse.py +1 -1
  16. orq_ai_sdk/models/createagentrequestop.py +768 -12
  17. orq_ai_sdk/models/createagentresponse.py +68 -2
  18. orq_ai_sdk/models/createchatcompletionop.py +538 -313
  19. orq_ai_sdk/models/createcompletionop.py +2078 -0
  20. orq_ai_sdk/models/createcontactop.py +5 -10
  21. orq_ai_sdk/models/createconversationop.py +1 -1
  22. orq_ai_sdk/models/createconversationresponseop.py +2 -2
  23. orq_ai_sdk/models/createdatasetitemop.py +4 -4
  24. orq_ai_sdk/models/createdatasetop.py +1 -1
  25. orq_ai_sdk/models/createdatasourceop.py +1 -1
  26. orq_ai_sdk/models/createembeddingop.py +579 -0
  27. orq_ai_sdk/models/createevalop.py +14 -14
  28. orq_ai_sdk/models/createidentityop.py +1 -1
  29. orq_ai_sdk/models/createimageeditop.py +715 -0
  30. orq_ai_sdk/models/createimageop.py +228 -82
  31. orq_ai_sdk/models/createimagevariationop.py +706 -0
  32. orq_ai_sdk/models/creatememoryop.py +4 -2
  33. orq_ai_sdk/models/createmoderationop.py +521 -0
  34. orq_ai_sdk/models/createpromptop.py +375 -6
  35. orq_ai_sdk/models/creatererankop.py +608 -0
  36. orq_ai_sdk/models/createresponseop.py +2567 -0
  37. orq_ai_sdk/models/createspeechop.py +466 -0
  38. orq_ai_sdk/models/createtoolop.py +6 -6
  39. orq_ai_sdk/models/createtranscriptionop.py +732 -0
  40. orq_ai_sdk/models/createtranslationop.py +702 -0
  41. orq_ai_sdk/models/deploymentgetconfigop.py +17 -7
  42. orq_ai_sdk/models/deploymentsop.py +1 -0
  43. orq_ai_sdk/models/deploymentstreamop.py +7 -0
  44. orq_ai_sdk/models/filegetop.py +1 -1
  45. orq_ai_sdk/models/filelistop.py +1 -1
  46. orq_ai_sdk/models/fileuploadop.py +1 -1
  47. orq_ai_sdk/models/generateconversationnameop.py +1 -1
  48. orq_ai_sdk/models/getallmemoriesop.py +4 -2
  49. orq_ai_sdk/models/getallpromptsop.py +188 -3
  50. orq_ai_sdk/models/getalltoolsop.py +6 -6
  51. orq_ai_sdk/models/getevalsop.py +17 -17
  52. orq_ai_sdk/models/getonepromptop.py +188 -3
  53. orq_ai_sdk/models/getpromptversionop.py +188 -3
  54. orq_ai_sdk/models/invokedeploymentrequest.py +11 -4
  55. orq_ai_sdk/models/listagentsop.py +372 -0
  56. orq_ai_sdk/models/listdatasetdatapointsop.py +4 -4
  57. orq_ai_sdk/models/listdatasetsop.py +1 -1
  58. orq_ai_sdk/models/listdatasourcesop.py +1 -1
  59. orq_ai_sdk/models/listidentitiesop.py +1 -1
  60. orq_ai_sdk/models/listmodelsop.py +1 -0
  61. orq_ai_sdk/models/listpromptversionsop.py +188 -3
  62. orq_ai_sdk/models/partdoneevent.py +1 -1
  63. orq_ai_sdk/models/post_v2_router_ocrop.py +408 -0
  64. orq_ai_sdk/models/publiccontact.py +9 -3
  65. orq_ai_sdk/models/publicidentity.py +62 -0
  66. orq_ai_sdk/models/reasoningpart.py +1 -1
  67. orq_ai_sdk/models/responsedoneevent.py +14 -11
  68. orq_ai_sdk/models/retrieveagentrequestop.py +382 -0
  69. orq_ai_sdk/models/retrievedatapointop.py +4 -4
  70. orq_ai_sdk/models/retrievedatasetop.py +1 -1
  71. orq_ai_sdk/models/retrievedatasourceop.py +1 -1
  72. orq_ai_sdk/models/retrieveidentityop.py +1 -1
  73. orq_ai_sdk/models/retrievememoryop.py +4 -2
  74. orq_ai_sdk/models/retrievetoolop.py +6 -6
  75. orq_ai_sdk/models/runagentop.py +379 -9
  76. orq_ai_sdk/models/streamrunagentop.py +385 -9
  77. orq_ai_sdk/models/updateagentop.py +770 -12
  78. orq_ai_sdk/models/updateconversationop.py +1 -1
  79. orq_ai_sdk/models/updatedatapointop.py +4 -4
  80. orq_ai_sdk/models/updatedatasetop.py +1 -1
  81. orq_ai_sdk/models/updatedatasourceop.py +1 -1
  82. orq_ai_sdk/models/updateevalop.py +14 -14
  83. orq_ai_sdk/models/updateidentityop.py +1 -1
  84. orq_ai_sdk/models/updatememoryop.py +4 -2
  85. orq_ai_sdk/models/updatepromptop.py +375 -6
  86. orq_ai_sdk/models/updatetoolop.py +7 -7
  87. orq_ai_sdk/moderations.py +218 -0
  88. orq_ai_sdk/orq_completions.py +666 -0
  89. orq_ai_sdk/orq_responses.py +398 -0
  90. orq_ai_sdk/rerank.py +330 -0
  91. orq_ai_sdk/router.py +89 -641
  92. orq_ai_sdk/speech.py +333 -0
  93. orq_ai_sdk/transcriptions.py +416 -0
  94. orq_ai_sdk/translations.py +384 -0
  95. orq_ai_sdk/variations.py +364 -0
  96. orq_ai_sdk-4.2.15.dist-info/METADATA +888 -0
  97. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.15.dist-info}/RECORD +99 -76
  98. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.15.dist-info}/WHEEL +1 -1
  99. orq_ai_sdk/models/deletecontactop.py +0 -44
  100. orq_ai_sdk/models/listcontactsop.py +0 -265
  101. orq_ai_sdk/models/retrievecontactop.py +0 -142
  102. orq_ai_sdk/models/updatecontactop.py +0 -233
  103. orq_ai_sdk-4.2.0rc49.dist-info/METADATA +0 -788
  104. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.15.dist-info}/top_level.txt +0 -0
@@ -42,4 +42,3 @@ class GlobalHook(BeforeRequestHook):
42
42
  return httpx.Request(method=request.method, url=request.url, extensions=request.extensions, headers=request.headers, content=data)
43
43
 
44
44
  return request
45
-
orq_ai_sdk/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "orq-ai-sdk"
6
- __version__: str = "4.2.0-rc.49"
6
+ __version__: str = "4.2.15"
7
7
  __openapi_doc_version__: str = "2.0"
8
- __gen_version__: str = "2.797.1"
9
- __user_agent__: str = "speakeasy-sdk/python 4.2.0-rc.49 2.797.1 2.0 orq-ai-sdk"
8
+ __gen_version__: str = "2.801.2"
9
+ __user_agent__: str = "speakeasy-sdk/python 4.2.15 2.801.2 2.0 orq-ai-sdk"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
orq_ai_sdk/agents.py CHANGED
@@ -363,6 +363,192 @@ class Agents(BaseSDK):
363
363
 
364
364
  raise models.APIError("Unexpected response received", http_res)
365
365
 
366
+ def list(
367
+ self,
368
+ *,
369
+ limit: Optional[float] = None,
370
+ starting_after: Optional[str] = None,
371
+ ending_before: Optional[str] = None,
372
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
373
+ server_url: Optional[str] = None,
374
+ timeout_ms: Optional[int] = None,
375
+ http_headers: Optional[Mapping[str, str]] = None,
376
+ ) -> models.ListAgentsResponseBody:
377
+ r"""List agents
378
+
379
+ Retrieves a comprehensive list of agents configured in your workspace. Supports pagination for large datasets and returns agents sorted by creation date (newest first). Each agent in the response includes its complete configuration: model settings with fallback options, instructions, tools, knowledge bases, memory stores, and execution parameters. Use pagination parameters to efficiently navigate through large collections of agents.
380
+
381
+ :param limit: A limit on the number of objects to be returned. Limit can range between 1 and 200. When not provided, returns all agents without pagination.
382
+ :param starting_after: A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `after=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the next page of the list.
383
+ :param ending_before: A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `before=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the previous page of the list.
384
+ :param retries: Override the default retry configuration for this method
385
+ :param server_url: Override the default server URL for this method
386
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
387
+ :param http_headers: Additional headers to set or replace on requests.
388
+ """
389
+ base_url = None
390
+ url_variables = None
391
+ if timeout_ms is None:
392
+ timeout_ms = self.sdk_configuration.timeout_ms
393
+
394
+ if timeout_ms is None:
395
+ timeout_ms = 600000
396
+
397
+ if server_url is not None:
398
+ base_url = server_url
399
+ else:
400
+ base_url = self._get_url(base_url, url_variables)
401
+
402
+ request = models.ListAgentsRequest(
403
+ limit=limit,
404
+ starting_after=starting_after,
405
+ ending_before=ending_before,
406
+ )
407
+
408
+ req = self._build_request(
409
+ method="GET",
410
+ path="/v2/agents",
411
+ base_url=base_url,
412
+ url_variables=url_variables,
413
+ request=request,
414
+ request_body_required=False,
415
+ request_has_path_params=False,
416
+ request_has_query_params=True,
417
+ user_agent_header="user-agent",
418
+ accept_header_value="application/json",
419
+ http_headers=http_headers,
420
+ security=self.sdk_configuration.security,
421
+ allow_empty_value=None,
422
+ timeout_ms=timeout_ms,
423
+ )
424
+
425
+ if retries == UNSET:
426
+ if self.sdk_configuration.retry_config is not UNSET:
427
+ retries = self.sdk_configuration.retry_config
428
+
429
+ retry_config = None
430
+ if isinstance(retries, utils.RetryConfig):
431
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
432
+
433
+ http_res = self.do_request(
434
+ hook_ctx=HookContext(
435
+ config=self.sdk_configuration,
436
+ base_url=base_url or "",
437
+ operation_id="ListAgents",
438
+ oauth2_scopes=None,
439
+ security_source=get_security_from_env(
440
+ self.sdk_configuration.security, models.Security
441
+ ),
442
+ ),
443
+ request=req,
444
+ error_status_codes=["4XX", "5XX"],
445
+ retry_config=retry_config,
446
+ )
447
+
448
+ if utils.match_response(http_res, "200", "application/json"):
449
+ return unmarshal_json_response(models.ListAgentsResponseBody, http_res)
450
+ if utils.match_response(http_res, "4XX", "*"):
451
+ http_res_text = utils.stream_to_text(http_res)
452
+ raise models.APIError("API error occurred", http_res, http_res_text)
453
+ if utils.match_response(http_res, "5XX", "*"):
454
+ http_res_text = utils.stream_to_text(http_res)
455
+ raise models.APIError("API error occurred", http_res, http_res_text)
456
+
457
+ raise models.APIError("Unexpected response received", http_res)
458
+
459
+ async def list_async(
460
+ self,
461
+ *,
462
+ limit: Optional[float] = None,
463
+ starting_after: Optional[str] = None,
464
+ ending_before: Optional[str] = None,
465
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
466
+ server_url: Optional[str] = None,
467
+ timeout_ms: Optional[int] = None,
468
+ http_headers: Optional[Mapping[str, str]] = None,
469
+ ) -> models.ListAgentsResponseBody:
470
+ r"""List agents
471
+
472
+ Retrieves a comprehensive list of agents configured in your workspace. Supports pagination for large datasets and returns agents sorted by creation date (newest first). Each agent in the response includes its complete configuration: model settings with fallback options, instructions, tools, knowledge bases, memory stores, and execution parameters. Use pagination parameters to efficiently navigate through large collections of agents.
473
+
474
+ :param limit: A limit on the number of objects to be returned. Limit can range between 1 and 200. When not provided, returns all agents without pagination.
475
+ :param starting_after: A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `after=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the next page of the list.
476
+ :param ending_before: A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `before=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the previous page of the list.
477
+ :param retries: Override the default retry configuration for this method
478
+ :param server_url: Override the default server URL for this method
479
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
480
+ :param http_headers: Additional headers to set or replace on requests.
481
+ """
482
+ base_url = None
483
+ url_variables = None
484
+ if timeout_ms is None:
485
+ timeout_ms = self.sdk_configuration.timeout_ms
486
+
487
+ if timeout_ms is None:
488
+ timeout_ms = 600000
489
+
490
+ if server_url is not None:
491
+ base_url = server_url
492
+ else:
493
+ base_url = self._get_url(base_url, url_variables)
494
+
495
+ request = models.ListAgentsRequest(
496
+ limit=limit,
497
+ starting_after=starting_after,
498
+ ending_before=ending_before,
499
+ )
500
+
501
+ req = self._build_request_async(
502
+ method="GET",
503
+ path="/v2/agents",
504
+ base_url=base_url,
505
+ url_variables=url_variables,
506
+ request=request,
507
+ request_body_required=False,
508
+ request_has_path_params=False,
509
+ request_has_query_params=True,
510
+ user_agent_header="user-agent",
511
+ accept_header_value="application/json",
512
+ http_headers=http_headers,
513
+ security=self.sdk_configuration.security,
514
+ allow_empty_value=None,
515
+ timeout_ms=timeout_ms,
516
+ )
517
+
518
+ if retries == UNSET:
519
+ if self.sdk_configuration.retry_config is not UNSET:
520
+ retries = self.sdk_configuration.retry_config
521
+
522
+ retry_config = None
523
+ if isinstance(retries, utils.RetryConfig):
524
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
525
+
526
+ http_res = await self.do_request_async(
527
+ hook_ctx=HookContext(
528
+ config=self.sdk_configuration,
529
+ base_url=base_url or "",
530
+ operation_id="ListAgents",
531
+ oauth2_scopes=None,
532
+ security_source=get_security_from_env(
533
+ self.sdk_configuration.security, models.Security
534
+ ),
535
+ ),
536
+ request=req,
537
+ error_status_codes=["4XX", "5XX"],
538
+ retry_config=retry_config,
539
+ )
540
+
541
+ if utils.match_response(http_res, "200", "application/json"):
542
+ return unmarshal_json_response(models.ListAgentsResponseBody, http_res)
543
+ if utils.match_response(http_res, "4XX", "*"):
544
+ http_res_text = await utils.stream_to_text_async(http_res)
545
+ raise models.APIError("API error occurred", http_res, http_res_text)
546
+ if utils.match_response(http_res, "5XX", "*"):
547
+ http_res_text = await utils.stream_to_text_async(http_res)
548
+ raise models.APIError("API error occurred", http_res, http_res_text)
549
+
550
+ raise models.APIError("Unexpected response received", http_res)
551
+
366
552
  def delete(
367
553
  self,
368
554
  *,
@@ -1425,192 +1611,6 @@ class Agents(BaseSDK):
1425
1611
 
1426
1612
  raise models.APIError("Unexpected response received", http_res)
1427
1613
 
1428
- def list(
1429
- self,
1430
- *,
1431
- limit: Optional[float] = None,
1432
- starting_after: Optional[str] = None,
1433
- ending_before: Optional[str] = None,
1434
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1435
- server_url: Optional[str] = None,
1436
- timeout_ms: Optional[int] = None,
1437
- http_headers: Optional[Mapping[str, str]] = None,
1438
- ) -> models.ListAgentsResponseBody:
1439
- r"""List agents
1440
-
1441
- Retrieves a comprehensive list of agents configured in your workspace. Supports pagination for large datasets and returns agents sorted by creation date (newest first). Each agent in the response includes its complete configuration: model settings with fallback options, instructions, tools, knowledge bases, memory stores, and execution parameters. Use pagination parameters to efficiently navigate through large collections of agents.
1442
-
1443
- :param limit: A limit on the number of objects to be returned. Limit can range between 1 and 200. When not provided, returns all agents without pagination.
1444
- :param starting_after: A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `after=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the next page of the list.
1445
- :param ending_before: A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `before=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the previous page of the list.
1446
- :param retries: Override the default retry configuration for this method
1447
- :param server_url: Override the default server URL for this method
1448
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1449
- :param http_headers: Additional headers to set or replace on requests.
1450
- """
1451
- base_url = None
1452
- url_variables = None
1453
- if timeout_ms is None:
1454
- timeout_ms = self.sdk_configuration.timeout_ms
1455
-
1456
- if timeout_ms is None:
1457
- timeout_ms = 600000
1458
-
1459
- if server_url is not None:
1460
- base_url = server_url
1461
- else:
1462
- base_url = self._get_url(base_url, url_variables)
1463
-
1464
- request = models.ListAgentsRequest(
1465
- limit=limit,
1466
- starting_after=starting_after,
1467
- ending_before=ending_before,
1468
- )
1469
-
1470
- req = self._build_request(
1471
- method="GET",
1472
- path="/v2/agents/",
1473
- base_url=base_url,
1474
- url_variables=url_variables,
1475
- request=request,
1476
- request_body_required=False,
1477
- request_has_path_params=False,
1478
- request_has_query_params=True,
1479
- user_agent_header="user-agent",
1480
- accept_header_value="application/json",
1481
- http_headers=http_headers,
1482
- security=self.sdk_configuration.security,
1483
- allow_empty_value=None,
1484
- timeout_ms=timeout_ms,
1485
- )
1486
-
1487
- if retries == UNSET:
1488
- if self.sdk_configuration.retry_config is not UNSET:
1489
- retries = self.sdk_configuration.retry_config
1490
-
1491
- retry_config = None
1492
- if isinstance(retries, utils.RetryConfig):
1493
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1494
-
1495
- http_res = self.do_request(
1496
- hook_ctx=HookContext(
1497
- config=self.sdk_configuration,
1498
- base_url=base_url or "",
1499
- operation_id="ListAgents",
1500
- oauth2_scopes=None,
1501
- security_source=get_security_from_env(
1502
- self.sdk_configuration.security, models.Security
1503
- ),
1504
- ),
1505
- request=req,
1506
- error_status_codes=["4XX", "5XX"],
1507
- retry_config=retry_config,
1508
- )
1509
-
1510
- if utils.match_response(http_res, "200", "application/json"):
1511
- return unmarshal_json_response(models.ListAgentsResponseBody, http_res)
1512
- if utils.match_response(http_res, "4XX", "*"):
1513
- http_res_text = utils.stream_to_text(http_res)
1514
- raise models.APIError("API error occurred", http_res, http_res_text)
1515
- if utils.match_response(http_res, "5XX", "*"):
1516
- http_res_text = utils.stream_to_text(http_res)
1517
- raise models.APIError("API error occurred", http_res, http_res_text)
1518
-
1519
- raise models.APIError("Unexpected response received", http_res)
1520
-
1521
- async def list_async(
1522
- self,
1523
- *,
1524
- limit: Optional[float] = None,
1525
- starting_after: Optional[str] = None,
1526
- ending_before: Optional[str] = None,
1527
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1528
- server_url: Optional[str] = None,
1529
- timeout_ms: Optional[int] = None,
1530
- http_headers: Optional[Mapping[str, str]] = None,
1531
- ) -> models.ListAgentsResponseBody:
1532
- r"""List agents
1533
-
1534
- Retrieves a comprehensive list of agents configured in your workspace. Supports pagination for large datasets and returns agents sorted by creation date (newest first). Each agent in the response includes its complete configuration: model settings with fallback options, instructions, tools, knowledge bases, memory stores, and execution parameters. Use pagination parameters to efficiently navigate through large collections of agents.
1535
-
1536
- :param limit: A limit on the number of objects to be returned. Limit can range between 1 and 200. When not provided, returns all agents without pagination.
1537
- :param starting_after: A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `after=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the next page of the list.
1538
- :param ending_before: A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `before=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the previous page of the list.
1539
- :param retries: Override the default retry configuration for this method
1540
- :param server_url: Override the default server URL for this method
1541
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1542
- :param http_headers: Additional headers to set or replace on requests.
1543
- """
1544
- base_url = None
1545
- url_variables = None
1546
- if timeout_ms is None:
1547
- timeout_ms = self.sdk_configuration.timeout_ms
1548
-
1549
- if timeout_ms is None:
1550
- timeout_ms = 600000
1551
-
1552
- if server_url is not None:
1553
- base_url = server_url
1554
- else:
1555
- base_url = self._get_url(base_url, url_variables)
1556
-
1557
- request = models.ListAgentsRequest(
1558
- limit=limit,
1559
- starting_after=starting_after,
1560
- ending_before=ending_before,
1561
- )
1562
-
1563
- req = self._build_request_async(
1564
- method="GET",
1565
- path="/v2/agents/",
1566
- base_url=base_url,
1567
- url_variables=url_variables,
1568
- request=request,
1569
- request_body_required=False,
1570
- request_has_path_params=False,
1571
- request_has_query_params=True,
1572
- user_agent_header="user-agent",
1573
- accept_header_value="application/json",
1574
- http_headers=http_headers,
1575
- security=self.sdk_configuration.security,
1576
- allow_empty_value=None,
1577
- timeout_ms=timeout_ms,
1578
- )
1579
-
1580
- if retries == UNSET:
1581
- if self.sdk_configuration.retry_config is not UNSET:
1582
- retries = self.sdk_configuration.retry_config
1583
-
1584
- retry_config = None
1585
- if isinstance(retries, utils.RetryConfig):
1586
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1587
-
1588
- http_res = await self.do_request_async(
1589
- hook_ctx=HookContext(
1590
- config=self.sdk_configuration,
1591
- base_url=base_url or "",
1592
- operation_id="ListAgents",
1593
- oauth2_scopes=None,
1594
- security_source=get_security_from_env(
1595
- self.sdk_configuration.security, models.Security
1596
- ),
1597
- ),
1598
- request=req,
1599
- error_status_codes=["4XX", "5XX"],
1600
- retry_config=retry_config,
1601
- )
1602
-
1603
- if utils.match_response(http_res, "200", "application/json"):
1604
- return unmarshal_json_response(models.ListAgentsResponseBody, http_res)
1605
- if utils.match_response(http_res, "4XX", "*"):
1606
- http_res_text = await utils.stream_to_text_async(http_res)
1607
- raise models.APIError("API error occurred", http_res, http_res_text)
1608
- if utils.match_response(http_res, "5XX", "*"):
1609
- http_res_text = await utils.stream_to_text_async(http_res)
1610
- raise models.APIError("API error occurred", http_res, http_res_text)
1611
-
1612
- raise models.APIError("Unexpected response received", http_res)
1613
-
1614
1614
  @deprecated(
1615
1615
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1616
1616
  )
orq_ai_sdk/audio.py ADDED
@@ -0,0 +1,30 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from .basesdk import BaseSDK
4
+ from .sdkconfiguration import SDKConfiguration
5
+ from orq_ai_sdk.speech import Speech
6
+ from orq_ai_sdk.transcriptions import Transcriptions
7
+ from orq_ai_sdk.translations import Translations
8
+ from typing import Optional
9
+
10
+
11
+ class Audio(BaseSDK):
12
+ speech: Speech
13
+ transcriptions: Transcriptions
14
+ translations: Translations
15
+
16
+ def __init__(
17
+ self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
18
+ ) -> None:
19
+ BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
20
+ self.sdk_configuration = sdk_config
21
+ self._init_sdks()
22
+
23
+ def _init_sdks(self):
24
+ self.speech = Speech(self.sdk_configuration, parent_ref=self.parent_ref)
25
+ self.transcriptions = Transcriptions(
26
+ self.sdk_configuration, parent_ref=self.parent_ref
27
+ )
28
+ self.translations = Translations(
29
+ self.sdk_configuration, parent_ref=self.parent_ref
30
+ )
orq_ai_sdk/chat.py ADDED
@@ -0,0 +1,22 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from .basesdk import BaseSDK
4
+ from .sdkconfiguration import SDKConfiguration
5
+ from orq_ai_sdk.orq_completions import OrqCompletions
6
+ from typing import Optional
7
+
8
+
9
+ class Chat(BaseSDK):
10
+ completions: OrqCompletions
11
+
12
+ def __init__(
13
+ self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
14
+ ) -> None:
15
+ BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
16
+ self.sdk_configuration = sdk_config
17
+ self._init_sdks()
18
+
19
+ def _init_sdks(self):
20
+ self.completions = OrqCompletions(
21
+ self.sdk_configuration, parent_ref=self.parent_ref
22
+ )