ibm-watsonx-orchestrate 1.12.2__py3-none-any.whl → 1.13.0b1__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 (53) hide show
  1. ibm_watsonx_orchestrate/__init__.py +1 -1
  2. ibm_watsonx_orchestrate/agent_builder/connections/types.py +34 -3
  3. ibm_watsonx_orchestrate/agent_builder/knowledge_bases/types.py +13 -2
  4. ibm_watsonx_orchestrate/agent_builder/models/types.py +17 -1
  5. ibm_watsonx_orchestrate/agent_builder/toolkits/types.py +14 -2
  6. ibm_watsonx_orchestrate/agent_builder/tools/__init__.py +1 -1
  7. ibm_watsonx_orchestrate/agent_builder/tools/types.py +21 -3
  8. ibm_watsonx_orchestrate/agent_builder/voice_configurations/__init__.py +1 -1
  9. ibm_watsonx_orchestrate/agent_builder/voice_configurations/types.py +11 -0
  10. ibm_watsonx_orchestrate/cli/commands/agents/agents_controller.py +31 -53
  11. ibm_watsonx_orchestrate/cli/commands/connections/connections_command.py +2 -2
  12. ibm_watsonx_orchestrate/cli/commands/connections/connections_controller.py +54 -28
  13. ibm_watsonx_orchestrate/cli/commands/copilot/copilot_command.py +36 -2
  14. ibm_watsonx_orchestrate/cli/commands/copilot/copilot_controller.py +270 -26
  15. ibm_watsonx_orchestrate/cli/commands/copilot/copilot_server_controller.py +4 -4
  16. ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_command.py +30 -3
  17. ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_environment_manager.py +158 -0
  18. ibm_watsonx_orchestrate/cli/commands/knowledge_bases/knowledge_bases_command.py +26 -0
  19. ibm_watsonx_orchestrate/cli/commands/knowledge_bases/knowledge_bases_controller.py +150 -34
  20. ibm_watsonx_orchestrate/cli/commands/models/models_command.py +2 -2
  21. ibm_watsonx_orchestrate/cli/commands/models/models_controller.py +29 -10
  22. ibm_watsonx_orchestrate/cli/commands/server/server_command.py +50 -18
  23. ibm_watsonx_orchestrate/cli/commands/toolkit/toolkit_controller.py +139 -27
  24. ibm_watsonx_orchestrate/cli/commands/tools/tools_command.py +2 -2
  25. ibm_watsonx_orchestrate/cli/commands/tools/tools_controller.py +43 -29
  26. ibm_watsonx_orchestrate/cli/commands/voice_configurations/voice_configurations_controller.py +23 -11
  27. ibm_watsonx_orchestrate/cli/common.py +26 -0
  28. ibm_watsonx_orchestrate/cli/config.py +30 -1
  29. ibm_watsonx_orchestrate/client/agents/agent_client.py +1 -1
  30. ibm_watsonx_orchestrate/client/connections/connections_client.py +1 -14
  31. ibm_watsonx_orchestrate/client/copilot/cpe/copilot_cpe_client.py +55 -11
  32. ibm_watsonx_orchestrate/client/knowledge_bases/knowledge_base_client.py +6 -2
  33. ibm_watsonx_orchestrate/client/model_policies/model_policies_client.py +1 -1
  34. ibm_watsonx_orchestrate/client/models/models_client.py +1 -1
  35. ibm_watsonx_orchestrate/client/threads/threads_client.py +34 -0
  36. ibm_watsonx_orchestrate/client/tools/tempus_client.py +4 -2
  37. ibm_watsonx_orchestrate/client/utils.py +29 -7
  38. ibm_watsonx_orchestrate/docker/compose-lite.yml +3 -2
  39. ibm_watsonx_orchestrate/docker/default.env +15 -10
  40. ibm_watsonx_orchestrate/flow_builder/flows/flow.py +28 -12
  41. ibm_watsonx_orchestrate/flow_builder/types.py +25 -0
  42. ibm_watsonx_orchestrate/flow_builder/utils.py +1 -9
  43. ibm_watsonx_orchestrate/utils/async_helpers.py +31 -0
  44. ibm_watsonx_orchestrate/utils/docker_utils.py +1177 -33
  45. ibm_watsonx_orchestrate/utils/environment.py +165 -20
  46. ibm_watsonx_orchestrate/utils/exceptions.py +1 -1
  47. ibm_watsonx_orchestrate/utils/tokens.py +51 -0
  48. ibm_watsonx_orchestrate/utils/utils.py +57 -2
  49. {ibm_watsonx_orchestrate-1.12.2.dist-info → ibm_watsonx_orchestrate-1.13.0b1.dist-info}/METADATA +2 -2
  50. {ibm_watsonx_orchestrate-1.12.2.dist-info → ibm_watsonx_orchestrate-1.13.0b1.dist-info}/RECORD +53 -48
  51. {ibm_watsonx_orchestrate-1.12.2.dist-info → ibm_watsonx_orchestrate-1.13.0b1.dist-info}/WHEEL +0 -0
  52. {ibm_watsonx_orchestrate-1.12.2.dist-info → ibm_watsonx_orchestrate-1.13.0b1.dist-info}/entry_points.txt +0 -0
  53. {ibm_watsonx_orchestrate-1.12.2.dist-info → ibm_watsonx_orchestrate-1.13.0b1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,31 @@
1
+ import asyncio
2
+ import threading
3
+ from concurrent.futures import ThreadPoolExecutor
4
+ from typing import Any, Coroutine, TypeVar, Optional
5
+
6
+ T = TypeVar("T")
7
+
8
+
9
+ def run_coroutine_sync(coroutine: Coroutine[Any, Any, T], timeout: Optional[float] = None) -> T:
10
+ def run_in_new_loop():
11
+ new_loop = asyncio.new_event_loop()
12
+ asyncio.set_event_loop(new_loop)
13
+ try:
14
+ return new_loop.run_until_complete(coroutine)
15
+ finally:
16
+ new_loop.close()
17
+
18
+ try:
19
+ loop = asyncio.get_running_loop()
20
+ except RuntimeError:
21
+ return asyncio.run(coroutine)
22
+
23
+ if threading.current_thread() is threading.main_thread():
24
+ if not loop.is_running():
25
+ return loop.run_until_complete(coroutine)
26
+ else:
27
+ with ThreadPoolExecutor() as pool:
28
+ future = pool.submit(run_in_new_loop)
29
+ return future.result(timeout=timeout)
30
+ else:
31
+ return asyncio.run_coroutine_threadsafe(coroutine, loop).result()