From c305814f26ab7f495ba80defde55bab269c5a8b6 Mon Sep 17 00:00:00 2001 From: API Engineering Date: Fri, 18 Jul 2025 18:53:41 +0000 Subject: [PATCH] [bot] Updated client based on openapi-42e49ab/clientgen --- DO_OPENAPI_COMMIT_SHA.txt | 2 +- src/pydo/aio/operations/_operations.py | 21094 ++++++++++++++++++---- src/pydo/operations/_operations.py | 21572 +++++++++++++++++++---- 3 files changed, 36127 insertions(+), 6541 deletions(-) diff --git a/DO_OPENAPI_COMMIT_SHA.txt b/DO_OPENAPI_COMMIT_SHA.txt index 67dd5d5..a33ba50 100644 --- a/DO_OPENAPI_COMMIT_SHA.txt +++ b/DO_OPENAPI_COMMIT_SHA.txt @@ -1 +1 @@ -b768fe5 +42e49ab diff --git a/src/pydo/aio/operations/_operations.py b/src/pydo/aio/operations/_operations.py index ced5463..a6423cc 100644 --- a/src/pydo/aio/operations/_operations.py +++ b/src/pydo/aio/operations/_operations.py @@ -218,11 +218,15 @@ build_genai_create_agent_api_key_request, build_genai_create_agent_request, build_genai_create_anthropic_api_key_request, + build_genai_create_evaluation_dataset_file_upload_presigned_urls_request, + build_genai_create_evaluation_dataset_request, + build_genai_create_evaluation_test_case_request, build_genai_create_indexing_job_request, build_genai_create_knowledge_base_data_source_request, build_genai_create_knowledge_base_request, build_genai_create_model_api_key_request, build_genai_create_openai_api_key_request, + build_genai_create_workspace_request, build_genai_delete_agent_api_key_request, build_genai_delete_agent_request, build_genai_delete_anthropic_api_key_request, @@ -230,22 +234,33 @@ build_genai_delete_knowledge_base_request, build_genai_delete_model_api_key_request, build_genai_delete_openai_api_key_request, + build_genai_delete_workspace_request, build_genai_detach_agent_function_request, build_genai_detach_agent_request, build_genai_detach_knowledge_base_request, build_genai_get_agent_children_request, build_genai_get_agent_request, build_genai_get_anthropic_api_key_request, + build_genai_get_evaluation_run_prompt_results_request, + build_genai_get_evaluation_run_request, + build_genai_get_evaluation_run_results_request, + build_genai_get_evaluation_test_case_request, build_genai_get_indexing_job_request, build_genai_get_knowledge_base_request, build_genai_get_openai_api_key_request, + build_genai_get_workspace_request, build_genai_list_agent_api_keys_request, build_genai_list_agent_versions_request, build_genai_list_agents_by_anthropic_key_request, build_genai_list_agents_by_openai_key_request, + build_genai_list_agents_by_workspace_request, build_genai_list_agents_request, build_genai_list_anthropic_api_keys_request, build_genai_list_datacenter_regions_request, + build_genai_list_evaluation_metrics_request, + build_genai_list_evaluation_runs_by_test_case_request, + build_genai_list_evaluation_test_cases_by_workspace_request, + build_genai_list_evaluation_test_cases_request, build_genai_list_indexing_job_data_sources_request, build_genai_list_indexing_jobs_request, build_genai_list_knowledge_base_data_sources_request, @@ -253,18 +268,23 @@ build_genai_list_model_api_keys_request, build_genai_list_models_request, build_genai_list_openai_api_keys_request, + build_genai_list_workspaces_request, build_genai_regenerate_agent_api_key_request, build_genai_regenerate_model_api_key_request, build_genai_rollback_to_agent_version_request, + build_genai_run_evaluation_test_case_request, build_genai_update_agent_api_key_request, build_genai_update_agent_deployment_visibility_request, build_genai_update_agent_function_request, build_genai_update_agent_request, + build_genai_update_agents_workspace_request, build_genai_update_anthropic_api_key_request, build_genai_update_attached_agent_request, + build_genai_update_evaluation_test_case_request, build_genai_update_knowledge_base_request, build_genai_update_model_api_key_request, build_genai_update_openai_api_key_request, + build_genai_update_workspace_request, build_image_actions_get_request, build_image_actions_list_request, build_image_actions_post_request, @@ -2173,6 +2193,23 @@ async def list( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -2207,6 +2244,10 @@ async def list( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -3674,6 +3715,25 @@ async def list( The version of the database engine. } ], + "disable_edge_cache": False, # Optional. + Default value is False. .. role:: raw-html-m2r(raw) :format: + html If set to ``true``"" , the app will **not** be cached at + the edge (CDN). Enable this option if you want to manage CDN + configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your + app. This setting is also recommended for apps that require + real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model + Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for + static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # + Optional. Default value is False. If set to ``true``"" , email + addresses in the app will not be obfuscated. This is useful for + apps that require email addresses to be visible (in the HTML + markup). "domains": [ { "domain": "str", # The @@ -3709,6 +3769,10 @@ async def list( Default value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , + suspicious requests will go through additional security checks to + help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. @@ -5333,6 +5397,25 @@ async def list( The version of the database engine. } ], + "disable_edge_cache": False, # Optional. + Default value is False. .. role:: raw-html-m2r(raw) :format: + html If set to ``true``"" , the app will **not** be cached at + the edge (CDN). Enable this option if you want to manage CDN + configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your + app. This setting is also recommended for apps that require + real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model + Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for + static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # + Optional. Default value is False. If set to ``true``"" , email + addresses in the app will not be obfuscated. This is useful for + apps that require email addresses to be visible (in the HTML + markup). "domains": [ { "domain": "str", # The @@ -5368,6 +5451,10 @@ async def list( Default value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , + suspicious requests will go through additional security checks to + help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. @@ -6930,6 +7017,25 @@ async def list( The version of the database engine. } ], + "disable_edge_cache": False, # Optional. + Default value is False. .. role:: raw-html-m2r(raw) :format: + html If set to ``true``"" , the app will **not** be cached at + the edge (CDN). Enable this option if you want to manage CDN + configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your + app. This setting is also recommended for apps that require + real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model + Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for + static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # + Optional. Default value is False. If set to ``true``"" , email + addresses in the app will not be obfuscated. This is useful for + apps that require email addresses to be visible (in the HTML + markup). "domains": [ { "domain": "str", # The @@ -6965,6 +7071,10 @@ async def list( Default value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , + suspicious requests will go through additional security checks to + help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. @@ -8518,6 +8628,25 @@ async def list( The version of the database engine. } ], + "disable_edge_cache": False, # Optional. + Default value is False. .. role:: raw-html-m2r(raw) :format: + html If set to ``true``"" , the app will **not** be cached at + the edge (CDN). Enable this option if you want to manage CDN + configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your + app. This setting is also recommended for apps that require + real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model + Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for + static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # + Optional. Default value is False. If set to ``true``"" , email + addresses in the app will not be obfuscated. This is useful for + apps that require email addresses to be visible (in the HTML + markup). "domains": [ { "domain": "str", # The @@ -8553,6 +8682,10 @@ async def list( Default value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , + suspicious requests will go through additional security checks to + help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. @@ -10104,6 +10237,22 @@ async def create( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -10135,6 +10284,9 @@ async def create( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -11355,6 +11507,22 @@ async def create( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -11389,6 +11557,10 @@ async def create( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -12775,6 +12947,23 @@ async def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -12809,6 +12998,10 @@ async def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -14359,6 +14552,23 @@ async def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -14393,6 +14603,10 @@ async def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -15882,6 +16096,23 @@ async def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -15916,6 +16147,10 @@ async def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -17397,6 +17632,23 @@ async def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -17431,6 +17683,10 @@ async def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -18851,6 +19107,22 @@ async def create( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -18885,6 +19157,10 @@ async def create( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -20271,6 +20547,23 @@ async def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -20305,6 +20598,10 @@ async def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -21855,6 +22152,23 @@ async def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -21889,6 +22203,10 @@ async def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -23378,6 +23696,23 @@ async def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -23412,6 +23747,10 @@ async def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -24893,6 +25232,23 @@ async def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -24927,6 +25283,10 @@ async def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -26341,6 +26701,22 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -26372,6 +26748,9 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -27592,6 +27971,22 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -27626,6 +28021,10 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -29012,6 +29411,23 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -29046,6 +29462,10 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -30596,6 +31016,23 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -30630,6 +31067,10 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -32119,6 +32560,23 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -32153,6 +32611,10 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -33634,6 +34096,23 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -33668,6 +34147,10 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -35270,6 +35753,22 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -35304,6 +35803,10 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -36690,6 +37193,23 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -36724,6 +37244,10 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -38274,6 +38798,23 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -38308,6 +38849,10 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -39797,6 +40342,23 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -39831,6 +40393,10 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -41312,6 +41878,23 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -41346,6 +41929,10 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -42861,6 +43448,22 @@ async def update( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -42892,6 +43495,9 @@ async def update( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -44114,6 +44720,22 @@ async def update( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -44148,6 +44770,10 @@ async def update( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -45534,6 +46160,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -45568,6 +46211,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -47118,6 +47765,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -47152,6 +47816,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -48641,6 +49309,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -48675,6 +49360,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -50156,6 +50845,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -50190,6 +50896,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -51628,6 +52338,22 @@ async def update( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -51662,6 +52388,10 @@ async def update( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -53048,6 +53778,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -53082,6 +53829,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -54632,6 +55383,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -54666,6 +55434,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -56155,6 +56927,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -56189,6 +56978,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -57670,6 +58463,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -57704,6 +58514,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -59133,6 +59947,22 @@ async def update( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -59164,6 +59994,9 @@ async def update( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -60386,6 +61219,22 @@ async def update( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -60420,6 +61269,10 @@ async def update( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -61806,6 +62659,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -61840,6 +62710,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -63390,6 +64264,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -63424,6 +64315,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -64913,6 +65808,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -64947,6 +65859,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -66428,6 +67344,23 @@ async def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -66462,6 +67395,10 @@ async def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -68100,6 +69037,22 @@ async def restart( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -68134,6 +69087,10 @@ async def restart( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -69574,6 +70531,22 @@ async def restart( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -69608,6 +70581,10 @@ async def restart( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -71048,6 +72025,22 @@ async def restart( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -71082,6 +72075,10 @@ async def restart( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -73025,6 +74022,23 @@ async def list_deployments( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -73059,6 +74073,10 @@ async def list_deployments( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -74664,6 +75682,22 @@ async def create_deployment( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -74698,6 +75732,10 @@ async def create_deployment( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -76139,6 +77177,22 @@ async def create_deployment( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -76173,6 +77227,10 @@ async def create_deployment( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -77612,6 +78670,22 @@ async def create_deployment( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -77646,6 +78720,10 @@ async def create_deployment( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -79169,6 +80247,22 @@ async def get_deployment( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -79203,6 +80297,10 @@ async def get_deployment( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -80713,6 +81811,22 @@ async def cancel_deployment( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -80747,6 +81861,10 @@ async def cancel_deployment( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -83078,6 +84196,22 @@ async def validate_app_spec( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -83109,6 +84243,9 @@ async def validate_app_spec( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -84342,6 +85479,22 @@ async def validate_app_spec( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -84373,6 +85526,9 @@ async def validate_app_spec( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -85628,6 +86784,22 @@ async def validate_app_spec( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -85659,6 +86831,9 @@ async def validate_app_spec( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -86897,6 +88072,22 @@ async def validate_app_spec( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -86928,6 +88119,9 @@ async def validate_app_spec( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -88161,6 +89355,22 @@ async def validate_app_spec( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -88192,6 +89402,9 @@ async def validate_app_spec( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -90233,6 +91446,22 @@ async def create_rollback( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -90267,6 +91496,10 @@ async def create_rollback( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -91716,6 +92949,22 @@ async def create_rollback( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -91750,6 +92999,10 @@ async def create_rollback( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -93202,6 +94455,22 @@ async def create_rollback( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -93236,6 +94505,10 @@ async def create_rollback( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -95283,6 +96556,22 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -95317,6 +96606,10 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -178290,7 +179583,7 @@ async def list_agents( }, "name": "str", # Optional. Agent name. "project_id": "str", # Optional. The DigitalOcean project ID - associated with the agent.:code:`
`Requires ``project:read`` scope. + associated with the agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -178311,7 +179604,7 @@ async def list_agents( "route_uuid": "str", # Optional. Route uuid. "tags": [ "str" # Optional. A set of abitrary tags to organize - your agent.:code:`
`Requires ``tag:read`` scope. + your agent. ], "temperature": 0.0, # Optional. Controls the model"u2019s creativity, specified as a number between 0 and 1. Lower values produce @@ -178370,6 +179663,14 @@ async def list_agents( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # @@ -178387,8 +179688,7 @@ async def list_agents( code. "tags": [ "str" # Optional. Tags to - organize related resources.:code:`
`Requires - ``tag:read`` scope. + organize related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -178483,7 +179783,9 @@ async def list_agents( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. - "uuid": "str" # Optional. Unique agent id. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str" # Optional. The latest version of the + agent. } ], "links": { @@ -178637,12 +179939,11 @@ async def create_agent( "open_ai_key_uuid": "str", # Optional. Optional OpenAI API key ID to use with OpenAI models. "project_id": "str", # Optional. The id of the DigitalOcean project this - agent will belong to.:code:`
`Requires ``project:update`` scope. + agent will belong to. "region": "str", # Optional. The DigitalOcean region to deploy your agent in. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:create`` scope. + "str" # Optional. Agent tag to organize related resources. ] } @@ -178694,6 +179995,8 @@ async def create_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -178811,6 +180114,12 @@ async def create_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -178823,7 +180132,7 @@ async def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -178833,6 +180142,15 @@ async def create_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -178937,8 +180255,7 @@ async def create_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -178957,8 +180274,7 @@ async def create_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -179010,6 +180326,13 @@ async def create_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -179025,7 +180348,7 @@ async def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -179110,6 +180433,7 @@ async def create_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -179134,6 +180458,20 @@ async def create_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -179146,6 +180484,9 @@ async def create_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -179156,11 +180497,15 @@ async def create_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -179169,6 +180514,10 @@ async def create_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -179279,6 +180628,8 @@ async def create_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -179396,6 +180747,12 @@ async def create_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -179408,7 +180765,7 @@ async def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -179418,6 +180775,15 @@ async def create_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -179522,8 +180888,7 @@ async def create_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -179542,8 +180907,7 @@ async def create_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -179595,6 +180959,13 @@ async def create_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -179610,7 +180981,7 @@ async def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -179695,6 +181066,7 @@ async def create_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -179719,6 +181091,20 @@ async def create_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -179731,6 +181117,9 @@ async def create_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -179741,11 +181130,15 @@ async def create_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -179754,6 +181147,10 @@ async def create_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -179828,12 +181225,11 @@ async def create_agent( "open_ai_key_uuid": "str", # Optional. Optional OpenAI API key ID to use with OpenAI models. "project_id": "str", # Optional. The id of the DigitalOcean project this - agent will belong to.:code:`
`Requires ``project:update`` scope. + agent will belong to. "region": "str", # Optional. The DigitalOcean region to deploy your agent in. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:create`` scope. + "str" # Optional. Agent tag to organize related resources. ] } @@ -179885,6 +181281,8 @@ async def create_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -180002,6 +181400,12 @@ async def create_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -180014,7 +181418,7 @@ async def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -180024,6 +181428,15 @@ async def create_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -180128,8 +181541,7 @@ async def create_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -180148,8 +181560,7 @@ async def create_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -180201,6 +181612,13 @@ async def create_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -180216,7 +181634,7 @@ async def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -180301,6 +181719,7 @@ async def create_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -180325,6 +181744,20 @@ async def create_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -180337,6 +181770,9 @@ async def create_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -180347,11 +181783,15 @@ async def create_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -180360,6 +181800,10 @@ async def create_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -181503,6 +182947,8 @@ async def attach_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -181620,6 +183066,12 @@ async def attach_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -181632,7 +183084,7 @@ async def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -181642,6 +183094,15 @@ async def attach_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -181746,8 +183207,7 @@ async def attach_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -181766,8 +183226,7 @@ async def attach_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -181819,6 +183278,13 @@ async def attach_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -181834,7 +183300,7 @@ async def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -181919,6 +183385,7 @@ async def attach_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -181943,6 +183410,20 @@ async def attach_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -181955,6 +183436,9 @@ async def attach_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -181965,11 +183449,15 @@ async def attach_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -181978,6 +183466,10 @@ async def attach_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -182091,6 +183583,8 @@ async def attach_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -182208,6 +183702,12 @@ async def attach_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -182220,7 +183720,7 @@ async def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -182230,6 +183730,15 @@ async def attach_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -182334,8 +183843,7 @@ async def attach_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -182354,8 +183862,7 @@ async def attach_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -182407,6 +183914,13 @@ async def attach_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -182422,7 +183936,7 @@ async def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -182507,6 +184021,7 @@ async def attach_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -182531,6 +184046,20 @@ async def attach_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -182543,6 +184072,9 @@ async def attach_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -182553,11 +184085,15 @@ async def attach_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -182566,6 +184102,10 @@ async def attach_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -182689,6 +184229,8 @@ async def attach_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -182806,6 +184348,12 @@ async def attach_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -182818,7 +184366,7 @@ async def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -182828,6 +184376,15 @@ async def attach_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -182932,8 +184489,7 @@ async def attach_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -182952,8 +184508,7 @@ async def attach_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -183005,6 +184560,13 @@ async def attach_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -183020,7 +184582,7 @@ async def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -183105,6 +184667,7 @@ async def attach_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -183129,6 +184692,20 @@ async def attach_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -183141,6 +184718,9 @@ async def attach_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -183151,11 +184731,15 @@ async def attach_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -183164,6 +184748,10 @@ async def attach_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -183390,6 +184978,8 @@ async def update_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -183507,6 +185097,12 @@ async def update_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -183519,7 +185115,7 @@ async def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -183529,6 +185125,15 @@ async def update_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -183633,8 +185238,7 @@ async def update_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -183653,8 +185257,7 @@ async def update_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -183706,6 +185309,13 @@ async def update_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -183721,7 +185331,7 @@ async def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -183806,6 +185416,7 @@ async def update_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -183830,6 +185441,20 @@ async def update_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -183842,6 +185467,9 @@ async def update_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -183852,11 +185480,15 @@ async def update_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -183865,6 +185497,10 @@ async def update_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -183981,6 +185617,8 @@ async def update_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -184098,6 +185736,12 @@ async def update_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -184110,7 +185754,7 @@ async def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -184120,6 +185764,15 @@ async def update_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -184224,8 +185877,7 @@ async def update_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -184244,8 +185896,7 @@ async def update_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -184297,6 +185948,13 @@ async def update_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -184312,7 +185970,7 @@ async def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -184397,6 +186055,7 @@ async def update_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -184421,6 +186080,20 @@ async def update_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -184433,6 +186106,9 @@ async def update_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -184443,11 +186119,15 @@ async def update_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -184456,6 +186136,10 @@ async def update_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -184583,6 +186267,8 @@ async def update_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -184700,6 +186386,12 @@ async def update_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -184712,7 +186404,7 @@ async def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -184722,6 +186414,15 @@ async def update_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -184826,8 +186527,7 @@ async def update_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -184846,8 +186546,7 @@ async def update_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -184899,6 +186598,13 @@ async def update_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -184914,7 +186620,7 @@ async def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -184999,6 +186705,7 @@ async def update_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -185023,6 +186730,20 @@ async def update_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -185035,6 +186756,9 @@ async def update_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -185045,11 +186769,15 @@ async def update_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -185058,6 +186786,10 @@ async def update_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -185259,6 +186991,8 @@ async def detach_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -185376,6 +187110,12 @@ async def detach_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -185388,7 +187128,7 @@ async def detach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -185398,6 +187138,15 @@ async def detach_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -185502,8 +187251,7 @@ async def detach_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -185522,8 +187270,7 @@ async def detach_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -185575,6 +187322,13 @@ async def detach_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -185590,7 +187344,7 @@ async def detach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -185675,6 +187429,7 @@ async def detach_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -185699,6 +187454,20 @@ async def detach_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -185711,6 +187480,9 @@ async def detach_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -185721,11 +187493,15 @@ async def detach_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -185734,6 +187510,10 @@ async def detach_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -185913,6 +187693,8 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -186030,6 +187812,12 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -186042,7 +187830,7 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -186052,6 +187840,15 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -186156,8 +187953,7 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -186176,8 +187972,7 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -186229,6 +188024,13 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -186244,7 +188046,7 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -186329,6 +188131,7 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -186353,6 +188156,20 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -186365,6 +188182,9 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -186375,11 +188195,15 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -186388,6 +188212,10 @@ async def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -186570,6 +188398,8 @@ async def attach_knowledge_base( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -186687,6 +188517,12 @@ async def attach_knowledge_base( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -186699,7 +188535,7 @@ async def attach_knowledge_base( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -186709,6 +188545,15 @@ async def attach_knowledge_base( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -186813,8 +188658,7 @@ async def attach_knowledge_base( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -186833,8 +188677,7 @@ async def attach_knowledge_base( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -186886,6 +188729,13 @@ async def attach_knowledge_base( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -186901,7 +188751,7 @@ async def attach_knowledge_base( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -186986,6 +188836,7 @@ async def attach_knowledge_base( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -187010,6 +188861,20 @@ async def attach_knowledge_base( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -187022,6 +188887,9 @@ async def attach_knowledge_base( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -187032,11 +188900,15 @@ async def attach_knowledge_base( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -187045,6 +188917,10 @@ async def attach_knowledge_base( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -187228,6 +189104,8 @@ async def detach_knowledge_base( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -187345,6 +189223,12 @@ async def detach_knowledge_base( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -187357,7 +189241,7 @@ async def detach_knowledge_base( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -187367,6 +189251,15 @@ async def detach_knowledge_base( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -187471,8 +189364,7 @@ async def detach_knowledge_base( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -187491,8 +189383,7 @@ async def detach_knowledge_base( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -187544,6 +189435,13 @@ async def detach_knowledge_base( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -187559,7 +189457,7 @@ async def detach_knowledge_base( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -187644,6 +189542,7 @@ async def detach_knowledge_base( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -187668,6 +189567,20 @@ async def detach_knowledge_base( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -187680,6 +189593,9 @@ async def detach_knowledge_base( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -187690,11 +189606,15 @@ async def detach_knowledge_base( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -187703,6 +189623,10 @@ async def detach_knowledge_base( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -188531,6 +190455,8 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -188648,6 +190574,12 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -188660,7 +190592,7 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -188670,6 +190602,15 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -188774,8 +190715,7 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -188794,8 +190734,7 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -188847,6 +190786,13 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -188862,7 +190808,7 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -188947,6 +190893,7 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -188971,6 +190918,20 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -188983,6 +190944,9 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -188993,11 +190957,15 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -189006,6 +190974,10 @@ async def get_agent(self, uuid: str, **kwargs: Any) -> JSON: Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -189152,6 +191124,8 @@ async def update_agent( body = { "anthropic_key_uuid": "str", # Optional. Optional anthropic key uuid for use with anthropic models. + "conversation_logs_enabled": bool, # Optional. Optional update of + conversation logs enabled. "description": "str", # Optional. Agent description. "instruction": "str", # Optional. Agent instruction. Instructions help your agent to perform its job effectively. See `Write Effective Agent Instructions @@ -189167,7 +191141,7 @@ async def update_agent( "open_ai_key_uuid": "str", # Optional. Optional OpenAI key uuid for use with OpenAI models. "project_id": "str", # Optional. The id of the DigitalOcean project this - agent will belong to.:code:`
`Requires ``project:update`` scope. + agent will belong to. "provide_citations": bool, # Optional. "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: The retrieval method is @@ -189179,8 +191153,7 @@ async def update_agent( "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". "tags": [ - "str" # Optional. A set of abitrary tags to organize your - agent.:code:`
`Requires ``tag:create`` scope. + "str" # Optional. A set of abitrary tags to organize your agent. ], "temperature": 0.0, # Optional. Controls the model"u2019s creativity, specified as a number between 0 and 1. Lower values produce more predictable and @@ -189239,6 +191212,8 @@ async def update_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -189356,6 +191331,12 @@ async def update_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -189368,7 +191349,7 @@ async def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -189378,6 +191359,15 @@ async def update_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -189482,8 +191472,7 @@ async def update_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -189502,8 +191491,7 @@ async def update_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -189555,6 +191543,13 @@ async def update_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -189570,7 +191565,7 @@ async def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -189655,6 +191650,7 @@ async def update_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -189679,6 +191675,20 @@ async def update_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -189691,6 +191701,9 @@ async def update_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -189701,11 +191714,15 @@ async def update_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -189714,6 +191731,10 @@ async def update_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -189827,6 +191848,8 @@ async def update_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -189944,6 +191967,12 @@ async def update_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -189956,7 +191985,7 @@ async def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -189966,6 +191995,15 @@ async def update_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -190070,8 +192108,7 @@ async def update_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -190090,8 +192127,7 @@ async def update_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -190143,6 +192179,13 @@ async def update_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -190158,7 +192201,7 @@ async def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -190243,6 +192286,7 @@ async def update_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -190267,6 +192311,20 @@ async def update_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -190279,6 +192337,9 @@ async def update_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -190289,11 +192350,15 @@ async def update_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -190302,6 +192367,10 @@ async def update_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -190363,6 +192432,8 @@ async def update_agent( body = { "anthropic_key_uuid": "str", # Optional. Optional anthropic key uuid for use with anthropic models. + "conversation_logs_enabled": bool, # Optional. Optional update of + conversation logs enabled. "description": "str", # Optional. Agent description. "instruction": "str", # Optional. Agent instruction. Instructions help your agent to perform its job effectively. See `Write Effective Agent Instructions @@ -190378,7 +192449,7 @@ async def update_agent( "open_ai_key_uuid": "str", # Optional. Optional OpenAI key uuid for use with OpenAI models. "project_id": "str", # Optional. The id of the DigitalOcean project this - agent will belong to.:code:`
`Requires ``project:update`` scope. + agent will belong to. "provide_citations": bool, # Optional. "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: The retrieval method is @@ -190390,8 +192461,7 @@ async def update_agent( "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". "tags": [ - "str" # Optional. A set of abitrary tags to organize your - agent.:code:`
`Requires ``tag:create`` scope. + "str" # Optional. A set of abitrary tags to organize your agent. ], "temperature": 0.0, # Optional. Controls the model"u2019s creativity, specified as a number between 0 and 1. Lower values produce more predictable and @@ -190450,6 +192520,8 @@ async def update_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -190567,6 +192639,12 @@ async def update_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -190579,7 +192657,7 @@ async def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -190589,6 +192667,15 @@ async def update_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -190693,8 +192780,7 @@ async def update_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -190713,8 +192799,7 @@ async def update_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -190766,6 +192851,13 @@ async def update_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -190781,7 +192873,7 @@ async def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -190866,6 +192958,7 @@ async def update_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -190890,6 +192983,20 @@ async def update_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -190902,6 +193009,9 @@ async def update_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -190912,11 +193022,15 @@ async def update_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -190925,6 +193039,10 @@ async def update_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -191119,6 +193237,8 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -191236,6 +193356,12 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -191248,7 +193374,7 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -191258,6 +193384,15 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -191362,8 +193497,7 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -191382,8 +193516,7 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -191435,6 +193568,13 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -191450,7 +193590,7 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -191535,6 +193675,7 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -191559,6 +193700,20 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -191571,6 +193726,9 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -191581,11 +193739,15 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -191594,6 +193756,10 @@ async def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -191776,6 +193942,8 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether + conversation logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -191901,6 +194069,13 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -191916,7 +194091,7 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -191926,6 +194101,16 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: knowledge base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo + project identifier. + "galileo_project_name": "str", # Optional. Name of + the Galileo project. + "log_stream_id": "str", # Optional. Identifier for + the log stream. + "log_stream_name": "str" # Optional. Name of the log + stream. + }, "max_tokens": 0, # Optional. Child agents. "model": { "agreement": { @@ -192040,8 +194225,7 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. Child agents. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -192061,7 +194245,7 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "route_uuid": "str", # Optional. Child agents. "tags": [ "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "temperature": 0.0, # Optional. Child agents. "template": { @@ -192117,6 +194301,14 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # @@ -192134,8 +194326,7 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: code. "tags": [ "str" # Optional. Tags to - organize related resources.:code:`
`Requires - ``tag:read`` scope. + organize related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -192228,6 +194419,8 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the + agent. "workspace": { "agents": [ ... @@ -192252,6 +194445,20 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: Optional. Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 + 00:00:00", # Optional. Time created at. + "dataset_name": "str", # + Optional. Name of the dataset. + "dataset_uuid": "str", # + Optional. UUID of the dataset. + "file_size": "str", # + Optional. The size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. + Number of rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -192264,6 +194471,9 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning + that a lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -192275,11 +194485,16 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # + Optional. The minimum value for the metric. } ], "name": "str", # Optional. @@ -192289,6 +194504,10 @@ async def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: Optional. Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This + is a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -192496,6 +194715,8 @@ async def update_agent_deployment_visibility( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -192613,6 +194834,12 @@ async def update_agent_deployment_visibility( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -192625,7 +194852,7 @@ async def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -192635,6 +194862,15 @@ async def update_agent_deployment_visibility( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -192739,8 +194975,7 @@ async def update_agent_deployment_visibility( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -192759,8 +194994,7 @@ async def update_agent_deployment_visibility( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -192812,6 +195046,13 @@ async def update_agent_deployment_visibility( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -192827,7 +195068,7 @@ async def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -192912,6 +195153,7 @@ async def update_agent_deployment_visibility( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -192936,6 +195178,20 @@ async def update_agent_deployment_visibility( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -192948,6 +195204,9 @@ async def update_agent_deployment_visibility( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -192958,11 +195217,15 @@ async def update_agent_deployment_visibility( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -192971,6 +195234,10 @@ async def update_agent_deployment_visibility( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -193084,6 +195351,8 @@ async def update_agent_deployment_visibility( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -193201,6 +195470,12 @@ async def update_agent_deployment_visibility( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -193213,7 +195488,7 @@ async def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -193223,6 +195498,15 @@ async def update_agent_deployment_visibility( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -193327,8 +195611,7 @@ async def update_agent_deployment_visibility( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -193347,8 +195630,7 @@ async def update_agent_deployment_visibility( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -193400,6 +195682,13 @@ async def update_agent_deployment_visibility( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -193415,7 +195704,7 @@ async def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -193500,6 +195789,7 @@ async def update_agent_deployment_visibility( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -193524,6 +195814,20 @@ async def update_agent_deployment_visibility( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -193536,6 +195840,9 @@ async def update_agent_deployment_visibility( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -193546,11 +195853,15 @@ async def update_agent_deployment_visibility( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -193559,6 +195870,10 @@ async def update_agent_deployment_visibility( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -193678,6 +195993,8 @@ async def update_agent_deployment_visibility( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -193795,6 +196112,12 @@ async def update_agent_deployment_visibility( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -193807,7 +196130,7 @@ async def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -193817,6 +196140,15 @@ async def update_agent_deployment_visibility( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -193921,8 +196253,7 @@ async def update_agent_deployment_visibility( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -193941,8 +196272,7 @@ async def update_agent_deployment_visibility( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -193994,6 +196324,13 @@ async def update_agent_deployment_visibility( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -194009,7 +196346,7 @@ async def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -194094,6 +196431,7 @@ async def update_agent_deployment_visibility( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -194118,6 +196456,20 @@ async def update_agent_deployment_visibility( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -194130,6 +196482,9 @@ async def update_agent_deployment_visibility( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -194140,11 +196495,15 @@ async def update_agent_deployment_visibility( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -194153,6 +196512,10 @@ async def update_agent_deployment_visibility( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -194391,8 +196754,7 @@ async def list_agent_versions( "RETRIEVAL_METHOD_REWRITE", "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". "tags": [ - "str" # Optional. Tags associated with the - agent.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Tags associated with the agent. ], "temperature": 0.0, # Optional. Temperature setting for the agent. @@ -195766,6 +198128,8 @@ async def list_agents_by_anthropic_key( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether + conversation logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -195889,6 +198253,13 @@ async def list_agents_by_anthropic_key( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -195904,7 +198275,7 @@ async def list_agents_by_anthropic_key( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -195914,6 +198285,16 @@ async def list_agents_by_anthropic_key( knowledge base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo + project identifier. + "galileo_project_name": "str", # Optional. Name of + the Galileo project. + "log_stream_id": "str", # Optional. Identifier for + the log stream. + "log_stream_name": "str" # Optional. Name of the log + stream. + }, "max_tokens": 0, # Optional. "model": { "agreement": { @@ -196028,8 +198409,7 @@ async def list_agents_by_anthropic_key( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -196049,7 +198429,7 @@ async def list_agents_by_anthropic_key( "route_uuid": "str", # Optional. "tags": [ "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "temperature": 0.0, # Optional. "template": { @@ -196105,6 +198485,14 @@ async def list_agents_by_anthropic_key( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # @@ -196122,8 +198510,7 @@ async def list_agents_by_anthropic_key( code. "tags": [ "str" # Optional. Tags to - organize related resources.:code:`
`Requires - ``tag:read`` scope. + organize related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -196216,6 +198603,8 @@ async def list_agents_by_anthropic_key( "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the + agent. "workspace": { "agents": [ ... @@ -196240,6 +198629,20 @@ async def list_agents_by_anthropic_key( Optional. Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 + 00:00:00", # Optional. Time created at. + "dataset_name": "str", # + Optional. Name of the dataset. + "dataset_uuid": "str", # + Optional. UUID of the dataset. + "file_size": "str", # + Optional. The size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. + Number of rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -196252,6 +198655,9 @@ async def list_agents_by_anthropic_key( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning + that a lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -196263,11 +198669,16 @@ async def list_agents_by_anthropic_key( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # + Optional. The minimum value for the metric. } ], "name": "str", # Optional. @@ -196277,6 +198688,10 @@ async def list_agents_by_anthropic_key( Optional. Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This + is a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -196408,24 +198823,24 @@ async def list_agents_by_anthropic_key( return cast(JSON, deserialized) # type: ignore - @distributed_trace_async - async def list_indexing_jobs( + @overload + async def create_evaluation_dataset( self, + body: Optional[JSON] = None, *, - page: Optional[int] = None, - per_page: Optional[int] = None, + content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """List Indexing Jobs for a Knowledge Base. + """Create Evaluation Dataset. - To list all indexing jobs for a knowledge base, send a GET request to - ``/v2/gen-ai/indexing_jobs``. + To create an evaluation dataset, send a POST request to ``/v2/gen-ai/evaluation_datasets``. - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -196433,49 +198848,108 @@ async def list_indexing_jobs( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "file_upload_dataset": { + "original_file_name": "str", # Optional. The original file name. + "size_in_bytes": "str", # Optional. The size of the file in bytes. + "stored_object_key": "str" # Optional. The object key the file was + stored as. + }, + "name": "str" # Optional. The name of the agent evaluation dataset. + } + # response body for status code(s): 200 response == { - "jobs": [ - { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. The indexing jobs. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. The - indexing jobs. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. The - indexing jobs. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. - } + "evaluation_dataset_uuid": "str" # Optional. Evaluation dataset uuid. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def create_evaluation_dataset( + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create Evaluation Dataset. + + To create an evaluation dataset, send a POST request to ``/v2/gen-ai/evaluation_datasets``. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "evaluation_dataset_uuid": "str" # Optional. Evaluation dataset uuid. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def create_evaluation_dataset( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create Evaluation Dataset. + + To create an evaluation dataset, send a POST request to ``/v2/gen-ai/evaluation_datasets``. + + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "file_upload_dataset": { + "original_file_name": "str", # Optional. The original file name. + "size_in_bytes": "str", # Optional. The size of the file in bytes. + "stored_object_key": "str" # Optional. The object key the file was + stored as. }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. - } + "name": "str" # Optional. The name of the agent evaluation dataset. + } + + # response body for status code(s): 200 + response == { + "evaluation_dataset_uuid": "str" # Optional. Evaluation dataset uuid. } # response body for status code(s): 404 response == { @@ -196502,14 +198976,29 @@ async def list_indexing_jobs( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_indexing_jobs_request( - page=page, - per_page=per_page, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_create_evaluation_dataset_request( + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -196569,7 +199058,7 @@ async def list_indexing_jobs( return cast(JSON, deserialized) # type: ignore @overload - async def create_indexing_job( + async def create_evaluation_dataset_file_upload_presigned_urls( # pylint: disable=name-too-long self, body: Optional[JSON] = None, *, @@ -196577,10 +199066,10 @@ async def create_indexing_job( **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Start Indexing Job for a Knowledge Base. + """Create Presigned URLs for Evaluation Dataset File Upload. - To start an indexing job for a knowledge base, send a POST request to - ``/v2/gen-ai/indexing_jobs``. + To create presigned URLs for evaluation dataset file upload, send a POST request to + ``/v2/gen-ai/evaluation_datasets/file_upload_presigned_urls``. :param body: Default value is None. :type body: JSON @@ -196596,39 +199085,31 @@ async def create_indexing_job( # JSON input template you can fill out and use as your body input. body = { - "data_source_uuids": [ - "str" # Optional. List of data source ids to index, if none are - provided, all data sources will be indexed. - ], - "knowledge_base_uuid": "str" # Optional. Knowledge base id. + "files": [ + { + "file_name": "str", # Optional. Local filename. + "file_size": "str" # Optional. The size of the file in + bytes. + } + ] } # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. - } + "request_id": "str", # Optional. The ID generated for the request for + Presigned URLs. + "uploads": [ + { + "expires_at": "2020-02-20 00:00:00", # Optional. The time + the url expires at. + "object_key": "str", # Optional. The unique object key to + store the file as. + "original_file_name": "str", # Optional. The original file + name. + "presigned_url": "str" # Optional. The actual presigned URL + the client can use to upload the file directly. + } + ] } # response body for status code(s): 404 response == { @@ -196644,7 +199125,7 @@ async def create_indexing_job( """ @overload - async def create_indexing_job( + async def create_evaluation_dataset_file_upload_presigned_urls( # pylint: disable=name-too-long self, body: Optional[IO[bytes]] = None, *, @@ -196652,10 +199133,10 @@ async def create_indexing_job( **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Start Indexing Job for a Knowledge Base. + """Create Presigned URLs for Evaluation Dataset File Upload. - To start an indexing job for a knowledge base, send a POST request to - ``/v2/gen-ai/indexing_jobs``. + To create presigned URLs for evaluation dataset file upload, send a POST request to + ``/v2/gen-ai/evaluation_datasets/file_upload_presigned_urls``. :param body: Default value is None. :type body: IO[bytes] @@ -196671,30 +199152,20 @@ async def create_indexing_job( # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. - } + "request_id": "str", # Optional. The ID generated for the request for + Presigned URLs. + "uploads": [ + { + "expires_at": "2020-02-20 00:00:00", # Optional. The time + the url expires at. + "object_key": "str", # Optional. The unique object key to + store the file as. + "original_file_name": "str", # Optional. The original file + name. + "presigned_url": "str" # Optional. The actual presigned URL + the client can use to upload the file directly. + } + ] } # response body for status code(s): 404 response == { @@ -196710,14 +199181,14 @@ async def create_indexing_job( """ @distributed_trace_async - async def create_indexing_job( + async def create_evaluation_dataset_file_upload_presigned_urls( # pylint: disable=name-too-long self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Start Indexing Job for a Knowledge Base. + """Create Presigned URLs for Evaluation Dataset File Upload. - To start an indexing job for a knowledge base, send a POST request to - ``/v2/gen-ai/indexing_jobs``. + To create presigned URLs for evaluation dataset file upload, send a POST request to + ``/v2/gen-ai/evaluation_datasets/file_upload_presigned_urls``. :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] @@ -196730,39 +199201,31 @@ async def create_indexing_job( # JSON input template you can fill out and use as your body input. body = { - "data_source_uuids": [ - "str" # Optional. List of data source ids to index, if none are - provided, all data sources will be indexed. - ], - "knowledge_base_uuid": "str" # Optional. Knowledge base id. + "files": [ + { + "file_name": "str", # Optional. Local filename. + "file_size": "str" # Optional. The size of the file in + bytes. + } + ] } # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. - } + "request_id": "str", # Optional. The ID generated for the request for + Presigned URLs. + "uploads": [ + { + "expires_at": "2020-02-20 00:00:00", # Optional. The time + the url expires at. + "object_key": "str", # Optional. The unique object key to + store the file as. + "original_file_name": "str", # Optional. The original file + name. + "presigned_url": "str" # Optional. The actual presigned URL + the client can use to upload the file directly. + } + ] } # response body for status code(s): 404 response == { @@ -196808,12 +199271,14 @@ async def create_indexing_job( else: _json = None - _request = build_genai_create_indexing_job_request( - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, + _request = ( + build_genai_create_evaluation_dataset_file_upload_presigned_urls_request( + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) ) _request.url = self._client.format_url(_request.url) @@ -196871,17 +199336,12 @@ async def create_indexing_job( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def list_indexing_job_data_sources( - self, indexing_job_uuid: str, **kwargs: Any - ) -> JSON: + async def list_evaluation_metrics(self, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """List Data Sources for Indexing Job for a Knowledge Base. + """List Evaluation Metrics. - To list all datasources for an indexing job, send a GET request to - ``/v2/gen-ai/indexing_jobs/{indexing_job_uuid}/data_sources``. + To list all evaluation metrics, send a GET request to ``/v2/gen-ai/evaluation_metrics``. - :param indexing_job_uuid: Uuid of the indexing job. Required. - :type indexing_job_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -196891,39 +199351,25 @@ async def list_indexing_job_data_sources( # response body for status code(s): 200 response == { - "indexed_data_sources": [ + "metrics": [ { - "completed_at": "2020-02-20 00:00:00", # Optional. Timestamp - when data source completed indexing. - "data_source_uuid": "str", # Optional. Uuid of the indexed - data source. - "error_details": "str", # Optional. A detailed error - description. - "error_msg": "str", # Optional. A string code provinding a - hint which part of the system experienced an error. - "failed_item_count": "str", # Optional. Total count of files - that have failed. - "indexed_file_count": "str", # Optional. Total count of - files that have been indexed. - "indexed_item_count": "str", # Optional. Total count of - files that have been indexed. - "removed_item_count": "str", # Optional. Total count of - files that have been removed. - "skipped_item_count": "str", # Optional. Total count of - files that have been skipped. - "started_at": "2020-02-20 00:00:00", # Optional. Timestamp - when data source started indexing. - "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. Default - value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: - "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", - "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", - "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". - "total_bytes": "str", # Optional. Total size of files in - data source in bytes. - "total_bytes_indexed": "str", # Optional. Total size of - files in data source in bytes that have been indexed. - "total_file_count": "str" # Optional. Total file count in - the data source. + "description": "str", # Optional. + "inverted": bool, # Optional. If true, the metric is + inverted, meaning that a lower value is better. + "metric_name": "str", # Optional. + "metric_type": "METRIC_TYPE_UNSPECIFIED", # Optional. + Default value is "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values + are: "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The maximum value for the + metric. + "range_min": 0.0 # Optional. The minimum value for the + metric. } ] } @@ -196957,8 +199403,7 @@ async def list_indexing_job_data_sources( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_indexing_job_data_sources_request( - indexing_job_uuid=indexing_job_uuid, + _request = build_genai_list_evaluation_metrics_request( headers=_headers, params=_params, ) @@ -197017,16 +199462,114 @@ async def list_indexing_job_data_sources( return cast(JSON, deserialized) # type: ignore + @overload + async def run_evaluation_test_case( + self, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Run an Evaluation Test Case. + + To run an evaluation test case, send a POST request to ``/v2/gen-ai/evaluation_runs``. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Agent UUIDs to run the test case against. + ], + "run_name": "str", # Optional. The name of the run. + "test_case_uuid": "str" # Optional. Test-case UUID to run. + } + + # response body for status code(s): 200 + response == { + "evaluation_run_uuids": [ + "str" # Optional. + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def run_evaluation_test_case( + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Run an Evaluation Test Case. + + To run an evaluation test case, send a POST request to ``/v2/gen-ai/evaluation_runs``. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "evaluation_run_uuids": [ + "str" # Optional. + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + @distributed_trace_async - async def get_indexing_job(self, uuid: str, **kwargs: Any) -> JSON: + async def run_evaluation_test_case( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """Retrieve Status of Indexing Job for a Knowledge Base. + """Run an Evaluation Test Case. - To get status of an indexing Job for a knowledge base, send a GET request to - ``/v2/gen-ai/indexing_jobs/{uuid}``. + To run an evaluation test case, send a POST request to ``/v2/gen-ai/evaluation_runs``. - :param uuid: Indexing job id. Required. - :type uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -197034,32 +199577,20 @@ async def get_indexing_job(self, uuid: str, **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Agent UUIDs to run the test case against. + ], + "run_name": "str", # Optional. The name of the run. + "test_case_uuid": "str" # Optional. Test-case UUID to run. + } + # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. - } + "evaluation_run_uuids": [ + "str" # Optional. + ] } # response body for status code(s): 404 response == { @@ -197086,13 +199617,29 @@ async def get_indexing_job(self, uuid: str, **kwargs: Any) -> JSON: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_get_indexing_job_request( - uuid=uuid, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_run_evaluation_test_case_request( + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -197151,28 +199698,16 @@ async def get_indexing_job(self, uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore - @overload - async def cancel_indexing_job( - self, - uuid: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> JSON: + @distributed_trace_async + async def get_evaluation_run(self, evaluation_run_uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Cancel Indexing Job for a Knowledge Base. + """Retrieve Information About an Existing Evaluation Run. - To cancel an indexing job for a knowledge base, send a PUT request to - ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + To retrive information about an existing evaluation run, send a GET request to + ``/v2/gen-ai/evaluation_runs/{evaluation_run_uuid}``. - :param uuid: A unique identifier for an indexing job. Required. - :type uuid: str - :param body: Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str + :param evaluation_run_uuid: Evaluation run UUID. Required. + :type evaluation_run_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -197180,36 +199715,70 @@ async def cancel_indexing_job( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "uuid": "str" # Optional. A unique identifier for an indexing job. - } - # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. + "evaluation_run": { + "agent_deleted": bool, # Optional. Whether agent is deleted. + "agent_name": "str", # Optional. Agent name. + "agent_uuid": "str", # Optional. Agent UUID. + "agent_version_hash": "str", # Optional. Version hash. + "agent_workspace_uuid": "str", # Optional. Agent workspace uuid. + "created_by_user_email": "str", # Optional. + "created_by_user_id": "str", # Optional. + "error_description": "str", # Optional. The error description. + "evaluation_run_uuid": "str", # Optional. Evaluation run UUID. + "evaluation_test_case_workspace_uuid": "str", # Optional. Evaluation + test case workspace uuid. + "finished_at": "2020-02-20 00:00:00", # Optional. Run end time. + "pass_status": bool, # Optional. The pass status of the evaluation + run based on the star metric. + "queued_at": "2020-02-20 00:00:00", # Optional. Run queued time. + "run_level_metric_results": [ + { + "error_description": "str", # Optional. Error + description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", + # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the + metric as a number. + "reasoning": "str", # Optional. Reasoning of the + metric result. + "string_value": "str" # Optional. The value of the + metric as a string. + } ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. + "run_name": "str", # Optional. Run name. + "star_metric_result": { + "error_description": "str", # Optional. Error description if + the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values + are: "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the metric as + a number. + "reasoning": "str", # Optional. Reasoning of the metric + result. + "string_value": "str" # Optional. The value of the metric as + a string. + }, + "started_at": "2020-02-20 00:00:00", # Optional. Run start time. + "status": "EVALUATION_RUN_STATUS_UNSPECIFIED", # Optional. Default + value is "EVALUATION_RUN_STATUS_UNSPECIFIED". Evaluation Run Statuses. Known + values are: "EVALUATION_RUN_STATUS_UNSPECIFIED", "EVALUATION_RUN_QUEUED", + "EVALUATION_RUN_RUNNING_DATASET", "EVALUATION_RUN_EVALUATING_RESULTS", + "EVALUATION_RUN_CANCELLING", "EVALUATION_RUN_CANCELLED", + "EVALUATION_RUN_SUCCESSFUL", "EVALUATION_RUN_PARTIALLY_SUCCESSFUL", and + "EVALUATION_RUN_FAILED". + "test_case_description": "str", # Optional. Test case description. + "test_case_name": "str", # Optional. Test case name. + "test_case_uuid": "str", # Optional. Test-case UUID. + "test_case_version": 0 # Optional. Test-case-version. } } # response body for status code(s): 404 @@ -197224,29 +199793,105 @@ async def cancel_indexing_job( tickets to help identify the issue. } """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - async def cancel_indexing_job( + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_get_evaluation_run_request( + evaluation_run_uuid=evaluation_run_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_evaluation_run_results( self, - uuid: str, - body: Optional[IO[bytes]] = None, + evaluation_run_uuid: str, *, - content_type: str = "application/json", + page: Optional[int] = None, + per_page: Optional[int] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Cancel Indexing Job for a Knowledge Base. + """Retrieve Results of an Evaluation Run. - To cancel an indexing job for a knowledge base, send a PUT request to - ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + To retrieve results of an evaluation run, send a GET request to + ``/v2/gen-ai/evaluation_runs/{evaluation_run_uuid}/results``. - :param uuid: A unique identifier for an indexing job. Required. - :type uuid: str - :param body: Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str + :param evaluation_run_uuid: Evaluation run UUID. Required. + :type evaluation_run_uuid: str + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -197256,30 +199901,128 @@ async def cancel_indexing_job( # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. + "evaluation_run": { + "agent_deleted": bool, # Optional. Whether agent is deleted. + "agent_name": "str", # Optional. Agent name. + "agent_uuid": "str", # Optional. Agent UUID. + "agent_version_hash": "str", # Optional. Version hash. + "agent_workspace_uuid": "str", # Optional. Agent workspace uuid. + "created_by_user_email": "str", # Optional. + "created_by_user_id": "str", # Optional. + "error_description": "str", # Optional. The error description. + "evaluation_run_uuid": "str", # Optional. Evaluation run UUID. + "evaluation_test_case_workspace_uuid": "str", # Optional. Evaluation + test case workspace uuid. + "finished_at": "2020-02-20 00:00:00", # Optional. Run end time. + "pass_status": bool, # Optional. The pass status of the evaluation + run based on the star metric. + "queued_at": "2020-02-20 00:00:00", # Optional. Run queued time. + "run_level_metric_results": [ + { + "error_description": "str", # Optional. Error + description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", + # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the + metric as a number. + "reasoning": "str", # Optional. Reasoning of the + metric result. + "string_value": "str" # Optional. The value of the + metric as a string. + } ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. - } + "run_name": "str", # Optional. Run name. + "star_metric_result": { + "error_description": "str", # Optional. Error description if + the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values + are: "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the metric as + a number. + "reasoning": "str", # Optional. Reasoning of the metric + result. + "string_value": "str" # Optional. The value of the metric as + a string. + }, + "started_at": "2020-02-20 00:00:00", # Optional. Run start time. + "status": "EVALUATION_RUN_STATUS_UNSPECIFIED", # Optional. Default + value is "EVALUATION_RUN_STATUS_UNSPECIFIED". Evaluation Run Statuses. Known + values are: "EVALUATION_RUN_STATUS_UNSPECIFIED", "EVALUATION_RUN_QUEUED", + "EVALUATION_RUN_RUNNING_DATASET", "EVALUATION_RUN_EVALUATING_RESULTS", + "EVALUATION_RUN_CANCELLING", "EVALUATION_RUN_CANCELLED", + "EVALUATION_RUN_SUCCESSFUL", "EVALUATION_RUN_PARTIALLY_SUCCESSFUL", and + "EVALUATION_RUN_FAILED". + "test_case_description": "str", # Optional. Test case description. + "test_case_name": "str", # Optional. Test case name. + "test_case_uuid": "str", # Optional. Test-case UUID. + "test_case_version": 0 # Optional. Test-case-version. + }, + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + }, + "prompts": [ + { + "ground_truth": "str", # Optional. The ground truth for the + prompt. + "input": "str", # Optional. The prompt level results. + "input_tokens": "str", # Optional. The number of input + tokens used in the prompt. + "output": "str", # Optional. The prompt level results. + "output_tokens": "str", # Optional. The number of output + tokens used in the prompt. + "prompt_chunks": [ + { + "chunk_usage_pct": 0.0, # Optional. The + usage percentage of the chunk. + "chunk_used": bool, # Optional. Indicates if + the chunk was used in the prompt. + "index_uuid": "str", # Optional. The index + uuid (Knowledge Base) of the chunk. + "source_name": "str", # Optional. The source + name for the chunk, e.g., the file name or document title. + "text": "str" # Optional. Text content of + the chunk. + } + ], + "prompt_id": 0, # Optional. Prompt ID. + "prompt_level_metric_results": [ + { + "error_description": "str", # Optional. + Error description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric + name. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value + of the metric as a number. + "reasoning": "str", # Optional. Reasoning of + the metric result. + "string_value": "str" # Optional. The value + of the metric as a string. + } + ] + } + ] } # response body for status code(s): 404 response == { @@ -197293,21 +200036,100 @@ async def cancel_indexing_job( tickets to help identify the issue. } """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_get_evaluation_run_results_request( + evaluation_run_uuid=evaluation_run_uuid, + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def cancel_indexing_job( - self, uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + async def get_evaluation_run_prompt_results( + self, evaluation_run_uuid: str, prompt_id: int, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Cancel Indexing Job for a Knowledge Base. + """Retrieve Results of an Evaluation Run Prompt. - To cancel an indexing job for a knowledge base, send a PUT request to - ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + To retrieve results of an evaluation run, send a GET request to + ``/v2/gen-ai/evaluation_runs/{evaluation_run_uuid}/results/{prompt_id}``. - :param uuid: A unique identifier for an indexing job. Required. - :type uuid: str - :param body: Is either a JSON type or a IO[bytes] type. Default value is None. - :type body: JSON or IO[bytes] + :param evaluation_run_uuid: Evaluation run UUID. Required. + :type evaluation_run_uuid: str + :param prompt_id: Prompt ID to get results for. Required. + :type prompt_id: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -197315,36 +200137,48 @@ async def cancel_indexing_job( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "uuid": "str" # Optional. A unique identifier for an indexing job. - } - # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. + "prompt": { + "ground_truth": "str", # Optional. The ground truth for the prompt. + "input": "str", # Optional. + "input_tokens": "str", # Optional. The number of input tokens used + in the prompt. + "output": "str", # Optional. + "output_tokens": "str", # Optional. The number of output tokens used + in the prompt. + "prompt_chunks": [ + { + "chunk_usage_pct": 0.0, # Optional. The usage + percentage of the chunk. + "chunk_used": bool, # Optional. Indicates if the + chunk was used in the prompt. + "index_uuid": "str", # Optional. The index uuid + (Knowledge Base) of the chunk. + "source_name": "str", # Optional. The source name + for the chunk, e.g., the file name or document title. + "text": "str" # Optional. Text content of the chunk. + } ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. + "prompt_id": 0, # Optional. Prompt ID. + "prompt_level_metric_results": [ + { + "error_description": "str", # Optional. Error + description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", + # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the + metric as a number. + "reasoning": "str", # Optional. Reasoning of the + metric result. + "string_value": "str" # Optional. The value of the + metric as a string. + } + ] } } # response body for status code(s): 404 @@ -197372,30 +200206,14 @@ async def cancel_indexing_job( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) cls: ClsType[JSON] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _json = body - else: - _json = None - - _request = build_genai_cancel_indexing_job_request( - uuid=uuid, - content_type=content_type, - json=_json, - content=_content, + _request = build_genai_get_evaluation_run_prompt_results_request( + evaluation_run_uuid=evaluation_run_uuid, + prompt_id=prompt_id, headers=_headers, params=_params, ) @@ -197455,22 +200273,12 @@ async def cancel_indexing_job( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def list_knowledge_bases( - self, - *, - page: Optional[int] = None, - per_page: Optional[int] = None, - **kwargs: Any - ) -> JSON: + async def list_evaluation_test_cases(self, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """List Knowledge Bases. + """List Evaluation Test Cases. - To list all knowledge bases, send a GET request to ``/v2/gen-ai/knowledge_bases``. + To list all evaluation test cases, send a GET request to ``/v2/gen-ai/evaluation_test_cases``. - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -197480,71 +200288,109 @@ async def list_knowledge_bases( # response body for status code(s): 200 response == { - "knowledge_bases": [ + "evaluation_test_cases": [ { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time - when the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "database_id": "str", # Optional. The knowledge bases. - "embedding_model_uuid": "str", # Optional. The knowledge - bases. - "is_public": bool, # Optional. Whether the knowledge base is - public or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. + "archived_at": "2020-02-20 00:00:00", # Optional. + Alternative way of authentication for internal usage only - should not be + exposed to public api. + "created_at": "2020-02-20 00:00:00", # Optional. Alternative + way of authentication for internal usage only - should not be exposed to + public api. + "created_by_user_email": "str", # Optional. Alternative way + of authentication for internal usage only - should not be exposed to + public api. + "created_by_user_id": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "dataset": { "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge - base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. - Default value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of - datasources being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "uuid": "str" # Optional. Unique id. + Time created at. + "dataset_name": "str", # Optional. Name of the + dataset. + "dataset_uuid": "str", # Optional. UUID of the + dataset. + "file_size": "str", # Optional. The size of the + dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does the + dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in the + dataset. }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. The knowledge bases. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "user_id": "str", # Optional. Id of user that created the - knowledge base. - "uuid": "str" # Optional. Unique id for knowledge base. - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. + "dataset_name": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "dataset_uuid": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "description": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "latest_version_number_of_runs": 0, # Optional. Alternative + way of authentication for internal usage only - should not be exposed to + public api. + "metrics": [ + { + "description": "str", # Optional. + Alternative way of authentication for internal usage only - + should not be exposed to public api. + "inverted": bool, # Optional. If true, the + metric is inverted, meaning that a lower value is better. + "metric_name": "str", # Optional. + Alternative way of authentication for internal usage only - + should not be exposed to public api. + "metric_type": "METRIC_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_TYPE_UNSPECIFIED". Known + values are: "METRIC_TYPE_UNSPECIFIED", + "METRIC_TYPE_GENERAL_QUALITY", and "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Alternative way of authentication for internal usage only - + should not be exposed to public api. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The maximum + value for the metric. + "range_min": 0.0 # Optional. The minimum + value for the metric. + } + ], + "name": "str", # Optional. Alternative way of authentication + for internal usage only - should not be exposed to public api. + "star_metric": { + "metric_uuid": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to + public api. + "name": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to + public api. + "success_threshold": 0.0, # Optional. The success + threshold for the star metric. This is a value that the metric must + reach to be considered successful. + "success_threshold_pct": 0 # Optional. The success + threshold for the star metric. This is a percentage value between 0 + and 100. + }, + "test_case_uuid": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "total_runs": 0, # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "updated_at": "2020-02-20 00:00:00", # Optional. Alternative + way of authentication for internal usage only - should not be exposed to + public api. + "updated_by_user_email": "str", # Optional. Alternative way + of authentication for internal usage only - should not be exposed to + public api. + "updated_by_user_id": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "version": 0 # Optional. Alternative way of authentication + for internal usage only - should not be exposed to public api. } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. - } + ] } # response body for status code(s): 404 response == { @@ -197576,9 +200422,7 @@ async def list_knowledge_bases( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_knowledge_bases_request( - page=page, - per_page=per_page, + _request = build_genai_list_evaluation_test_cases_request( headers=_headers, params=_params, ) @@ -197638,7 +200482,7 @@ async def list_knowledge_bases( return cast(JSON, deserialized) # type: ignore @overload - async def create_knowledge_base( + async def create_evaluation_test_case( self, body: Optional[JSON] = None, *, @@ -197646,9 +200490,9 @@ async def create_knowledge_base( **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a Knowledge Base. + """Create Evaluation Test Case. - To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. + To create an evaluation test-case send a POST request to ``/v2/gen-ai/evaluation_test_cases``. :param body: Default value is None. :type body: JSON @@ -197664,124 +200508,28 @@ async def create_knowledge_base( # JSON input template you can fill out and use as your body input. body = { - "database_id": "str", # Optional. Identifier of the DigitalOcean OpenSearch - database this knowledge base will use, optional. If not provided, we create a new - database for the knowledge base in the same region as the knowledge base. - "datasources": [ - { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. AWS S3 Data Source. - "key_id": "str", # Optional. The AWS Key ID. - "region": "str", # Optional. Region of bucket. - "secret_key": "str" # Optional. The AWS Secret Key. - }, - "bucket_name": "str", # Optional. Deprecated, moved to - data_source_details. - "bucket_region": "str", # Optional. Deprecated, moved to - data_source_details. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The - original file name. - "size_in_bytes": "str", # Optional. The size of the - file in bytes. - "stored_object_key": "str" # Optional. The object - key the file was stored as. - }, - "item_path": "str", # Optional. The data sources to use for - this knowledge base. See `Organize Data Sources - `_ - for more information on data sources best practices. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. Spaces Bucket Data - Source. - "region": "str" # Optional. Region of bucket. - }, - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to - crawl. - "crawling_option": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Options for specifying how URLs found on pages - should be handled. * UNKNOWN: Default unknown value * SCOPED: Only - include the base URL. * PATH: Crawl the base URL and linked pages - within the URL path. * DOMAIN: Crawl the base URL and linked pages - within the same domain. * SUBDOMAINS: Crawl the base URL and linked - pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", - "PATH", "DOMAIN", and "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest - and index media (images, etc.) on web pages. - } - } - ], - "embedding_model_uuid": "str", # Optional. Identifier for the `embedding - model - `_. - "name": "str", # Optional. Name of the knowledge base. - "project_id": "str", # Optional. Identifier of the DigitalOcean project this - knowledge base will belong to.:code:`
`Requires ``tag:create`` scope. - "region": "str", # Optional. The datacenter region to deploy the knowledge - base in. - "tags": [ - "str" # Optional. Tags to organize your knowledge - base..:code:`
`Requires ``tag:update`` scope. + "dataset_uuid": "str", # Optional. Dataset against which the test"u2011case + is executed. + "description": "str", # Optional. Description of the test case. + "metrics": [ + "str" # Optional. Full metric list to use for evaluation test case. ], - "vpc_uuid": "str" # Optional. The VPC to deploy the knowledge base database - in..:code:`
`Requires ``vpc:update`` scope. + "name": "str", # Optional. Name of the test case. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success threshold for the + star metric. This is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # Optional. The success threshold for the + star metric. This is a percentage value between 0 and 100. + }, + "workspace_uuid": "str" # Optional. The workspace uuid. } # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. - } + "test_case_uuid": "str" # Optional. Test"u2011case UUID. } # response body for status code(s): 404 response == { @@ -197797,7 +200545,7 @@ async def create_knowledge_base( """ @overload - async def create_knowledge_base( + async def create_evaluation_test_case( self, body: Optional[IO[bytes]] = None, *, @@ -197805,9 +200553,9 @@ async def create_knowledge_base( **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a Knowledge Base. + """Create Evaluation Test Case. - To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. + To create an evaluation test-case send a POST request to ``/v2/gen-ai/evaluation_test_cases``. :param body: Default value is None. :type body: IO[bytes] @@ -197823,54 +200571,7 @@ async def create_knowledge_base( # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. - } + "test_case_uuid": "str" # Optional. Test"u2011case UUID. } # response body for status code(s): 404 response == { @@ -197886,13 +200587,13 @@ async def create_knowledge_base( """ @distributed_trace_async - async def create_knowledge_base( + async def create_evaluation_test_case( self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a Knowledge Base. + """Create Evaluation Test Case. - To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. + To create an evaluation test-case send a POST request to ``/v2/gen-ai/evaluation_test_cases``. :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] @@ -197905,124 +200606,28 @@ async def create_knowledge_base( # JSON input template you can fill out and use as your body input. body = { - "database_id": "str", # Optional. Identifier of the DigitalOcean OpenSearch - database this knowledge base will use, optional. If not provided, we create a new - database for the knowledge base in the same region as the knowledge base. - "datasources": [ - { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. AWS S3 Data Source. - "key_id": "str", # Optional. The AWS Key ID. - "region": "str", # Optional. Region of bucket. - "secret_key": "str" # Optional. The AWS Secret Key. - }, - "bucket_name": "str", # Optional. Deprecated, moved to - data_source_details. - "bucket_region": "str", # Optional. Deprecated, moved to - data_source_details. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The - original file name. - "size_in_bytes": "str", # Optional. The size of the - file in bytes. - "stored_object_key": "str" # Optional. The object - key the file was stored as. - }, - "item_path": "str", # Optional. The data sources to use for - this knowledge base. See `Organize Data Sources - `_ - for more information on data sources best practices. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. Spaces Bucket Data - Source. - "region": "str" # Optional. Region of bucket. - }, - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to - crawl. - "crawling_option": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Options for specifying how URLs found on pages - should be handled. * UNKNOWN: Default unknown value * SCOPED: Only - include the base URL. * PATH: Crawl the base URL and linked pages - within the URL path. * DOMAIN: Crawl the base URL and linked pages - within the same domain. * SUBDOMAINS: Crawl the base URL and linked - pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", - "PATH", "DOMAIN", and "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest - and index media (images, etc.) on web pages. - } - } - ], - "embedding_model_uuid": "str", # Optional. Identifier for the `embedding - model - `_. - "name": "str", # Optional. Name of the knowledge base. - "project_id": "str", # Optional. Identifier of the DigitalOcean project this - knowledge base will belong to.:code:`
`Requires ``tag:create`` scope. - "region": "str", # Optional. The datacenter region to deploy the knowledge - base in. - "tags": [ - "str" # Optional. Tags to organize your knowledge - base..:code:`
`Requires ``tag:update`` scope. + "dataset_uuid": "str", # Optional. Dataset against which the test"u2011case + is executed. + "description": "str", # Optional. Description of the test case. + "metrics": [ + "str" # Optional. Full metric list to use for evaluation test case. ], - "vpc_uuid": "str" # Optional. The VPC to deploy the knowledge base database - in..:code:`
`Requires ``vpc:update`` scope. + "name": "str", # Optional. Name of the test case. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success threshold for the + star metric. This is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # Optional. The success threshold for the + star metric. This is a percentage value between 0 and 100. + }, + "workspace_uuid": "str" # Optional. The workspace uuid. } # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. - } + "test_case_uuid": "str" # Optional. Test"u2011case UUID. } # response body for status code(s): 404 response == { @@ -198068,7 +200673,7 @@ async def create_knowledge_base( else: _json = None - _request = build_genai_create_knowledge_base_request( + _request = build_genai_create_evaluation_test_case_request( content_type=content_type, json=_json, content=_content, @@ -198131,26 +200736,23 @@ async def create_knowledge_base( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def list_knowledge_base_data_sources( + async def list_evaluation_runs_by_test_case( self, - knowledge_base_uuid: str, + evaluation_test_case_uuid: str, *, - page: Optional[int] = None, - per_page: Optional[int] = None, + evaluation_test_case_version: Optional[int] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """List Data Sources for a Knowledge Base. + """List Evaluation Runs by Test Case. - To list all data sources for a knowledge base, send a GET request to - ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. + To list all evaluation runs by test case, send a GET request to + ``/v2/gen-ai/evaluation_test_cases/{evaluation_test_case_uuid}/evaluation_runs``. - :param knowledge_base_uuid: Knowledge base id. Required. - :type knowledge_base_uuid: str - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int + :param evaluation_test_case_uuid: Evaluation run UUID. Required. + :type evaluation_test_case_uuid: str + :keyword evaluation_test_case_version: Version of the test case. Default value is None. + :paramtype evaluation_test_case_version: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -198160,96 +200762,259 @@ async def list_knowledge_base_data_sources( # response body for status code(s): 200 response == { - "knowledge_base_data_sources": [ + "evaluation_runs": [ { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. AWS S3 Data Source - for Display. - "region": "str" # Optional. Region of bucket. - }, - "bucket_name": "str", # Optional. Name of storage bucket - - Deprecated, moved to data_source_details. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The - original file name. - "size_in_bytes": "str", # Optional. The size of the - file in bytes. - "stored_object_key": "str" # Optional. The object - key the file was stored as. - }, - "item_path": "str", # Optional. Path of folder or object in - bucket - Deprecated, moved to data_source_details. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge - base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. - Default value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of - datasources being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "uuid": "str" # Optional. Unique id. - }, - "region": "str", # Optional. Region code - Deprecated, moved - to data_source_details. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. Spaces Bucket Data - Source. - "region": "str" # Optional. Region of bucket. + "agent_deleted": bool, # Optional. Whether agent is deleted. + "agent_name": "str", # Optional. Agent name. + "agent_uuid": "str", # Optional. Agent UUID. + "agent_version_hash": "str", # Optional. Version hash. + "agent_workspace_uuid": "str", # Optional. Agent workspace + uuid. + "created_by_user_email": "str", # Optional. List of + evaluation runs. + "created_by_user_id": "str", # Optional. List of evaluation + runs. + "error_description": "str", # Optional. The error + description. + "evaluation_run_uuid": "str", # Optional. Evaluation run + UUID. + "evaluation_test_case_workspace_uuid": "str", # Optional. + Evaluation test case workspace uuid. + "finished_at": "2020-02-20 00:00:00", # Optional. Run end + time. + "pass_status": bool, # Optional. The pass status of the + evaluation run based on the star metric. + "queued_at": "2020-02-20 00:00:00", # Optional. Run queued + time. + "run_level_metric_results": [ + { + "error_description": "str", # Optional. + Error description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric + name. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value + of the metric as a number. + "reasoning": "str", # Optional. Reasoning of + the metric result. + "string_value": "str" # Optional. The value + of the metric as a string. + } + ], + "run_name": "str", # Optional. Run name. + "star_metric_result": { + "error_description": "str", # Optional. Error + description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", + # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the + metric as a number. + "reasoning": "str", # Optional. Reasoning of the + metric result. + "string_value": "str" # Optional. The value of the + metric as a string. }, - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str", # Optional. Unique id of knowledge base. - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to - crawl. - "crawling_option": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Options for specifying how URLs found on pages - should be handled. * UNKNOWN: Default unknown value * SCOPED: Only - include the base URL. * PATH: Crawl the base URL and linked pages - within the URL path. * DOMAIN: Crawl the base URL and linked pages - within the same domain. * SUBDOMAINS: Crawl the base URL and linked - pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", - "PATH", "DOMAIN", and "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest - and index media (images, etc.) on web pages. - } - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. + "started_at": "2020-02-20 00:00:00", # Optional. Run start + time. + "status": "EVALUATION_RUN_STATUS_UNSPECIFIED", # Optional. + Default value is "EVALUATION_RUN_STATUS_UNSPECIFIED". Evaluation Run + Statuses. Known values are: "EVALUATION_RUN_STATUS_UNSPECIFIED", + "EVALUATION_RUN_QUEUED", "EVALUATION_RUN_RUNNING_DATASET", + "EVALUATION_RUN_EVALUATING_RESULTS", "EVALUATION_RUN_CANCELLING", + "EVALUATION_RUN_CANCELLED", "EVALUATION_RUN_SUCCESSFUL", + "EVALUATION_RUN_PARTIALLY_SUCCESSFUL", and "EVALUATION_RUN_FAILED". + "test_case_description": "str", # Optional. Test case + description. + "test_case_name": "str", # Optional. Test case name. + "test_case_uuid": "str", # Optional. Test-case UUID. + "test_case_version": 0 # Optional. Test-case-version. } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_evaluation_runs_by_test_case_request( + evaluation_test_case_uuid=evaluation_test_case_uuid, + evaluation_test_case_version=evaluation_test_case_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_evaluation_test_case( + self, + test_case_uuid: str, + *, + evaluation_test_case_version: Optional[int] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Retrieve Information About an Existing Evaluation Test Case. + + To retrive information about an existing evaluation test case, send a GET request to + ``/v2/gen-ai/evaluation_test_case/{test_case_uuid}``. + + :param test_case_uuid: The test case uuid to retrieve. Required. + :type test_case_uuid: str + :keyword evaluation_test_case_version: Version of the test case. Default value is None. + :paramtype evaluation_test_case_version: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "evaluation_test_case": { + "archived_at": "2020-02-20 00:00:00", # Optional. + "created_at": "2020-02-20 00:00:00", # Optional. + "created_by_user_email": "str", # Optional. + "created_by_user_id": "str", # Optional. + "dataset": { + "created_at": "2020-02-20 00:00:00", # Optional. Time + created at. + "dataset_name": "str", # Optional. Name of the dataset. + "dataset_uuid": "str", # Optional. UUID of the dataset. + "file_size": "str", # Optional. The size of the dataset + uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does the dataset have + a ground truth column?. + "row_count": 0 # Optional. Number of rows in the dataset. + }, + "dataset_name": "str", # Optional. + "dataset_uuid": "str", # Optional. + "description": "str", # Optional. + "latest_version_number_of_runs": 0, # Optional. + "metrics": [ + { + "description": "str", # Optional. + "inverted": bool, # Optional. If true, the metric is + inverted, meaning that a lower value is better. + "metric_name": "str", # Optional. + "metric_type": "METRIC_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_TYPE_UNSPECIFIED". Known values + are: "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", + # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The maximum value for + the metric. + "range_min": 0.0 # Optional. The minimum value for + the metric. + } + ], + "name": "str", # Optional. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success threshold + for the star metric. This is a value that the metric must reach to be + considered successful. + "success_threshold_pct": 0 # Optional. The success threshold + for the star metric. This is a percentage value between 0 and 100. + }, + "test_case_uuid": "str", # Optional. + "total_runs": 0, # Optional. + "updated_at": "2020-02-20 00:00:00", # Optional. + "updated_by_user_email": "str", # Optional. + "updated_by_user_id": "str", # Optional. + "version": 0 # Optional. } } # response body for status code(s): 404 @@ -198282,10 +201047,9 @@ async def list_knowledge_base_data_sources( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_knowledge_base_data_sources_request( - knowledge_base_uuid=knowledge_base_uuid, - page=page, - per_page=per_page, + _request = build_genai_get_evaluation_test_case_request( + test_case_uuid=test_case_uuid, + evaluation_test_case_version=evaluation_test_case_version, headers=_headers, params=_params, ) @@ -198345,22 +201109,22 @@ async def list_knowledge_base_data_sources( return cast(JSON, deserialized) # type: ignore @overload - async def create_knowledge_base_data_source( + async def update_evaluation_test_case( self, - knowledge_base_uuid: str, + test_case_uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Add Data Source to a Knowledge Base. + """Update an Evaluation Test Case. - To add a data source to a knowledge base, send a POST request to - ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. + To update an evaluation test-case send a PUT request to + ``/v2/gen-ai/evaluation_test_cases/{test_case_uuid}``. - :param knowledge_base_uuid: Knowledge base id. Required. - :type knowledge_base_uuid: str + :param test_case_uuid: Test-case UUID to update. Required. + :type test_case_uuid: str :param body: Default value is None. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -198375,105 +201139,31 @@ async def create_knowledge_base_data_source( # JSON input template you can fill out and use as your body input. body = { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. AWS S3 Data Source. - "key_id": "str", # Optional. The AWS Key ID. - "region": "str", # Optional. Region of bucket. - "secret_key": "str" # Optional. The AWS Secret Key. + "dataset_uuid": "str", # Optional. Dataset against which the test"u2011case + is executed. + "description": "str", # Optional. Description of the test case. + "metrics": { + "metric_uuids": [ + "str" # Optional. + ] }, - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. Spaces Bucket Data Source. - "region": "str" # Optional. Region of bucket. + "name": "str", # Optional. Name of the test case. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success threshold for the + star metric. This is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # Optional. The success threshold for the + star metric. This is a percentage value between 0 and 100. }, - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to crawl. - "crawling_option": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Options for specifying how URLs found on pages should be handled. - * UNKNOWN: Default unknown value * SCOPED: Only include the base URL. * PATH: - Crawl the base URL and linked pages within the URL path. * DOMAIN: Crawl the - base URL and linked pages within the same domain. * SUBDOMAINS: Crawl the - base URL and linked pages for any subdomain. Known values are: "UNKNOWN", - "SCOPED", "PATH", "DOMAIN", and "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest and index media - (images, etc.) on web pages. - } + "test_case_uuid": "str" # Optional. Test-case UUID to update. } # response body for status code(s): 200 response == { - "knowledge_base_data_source": { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. AWS S3 Data Source for - Display. - "region": "str" # Optional. Region of bucket. - }, - "bucket_name": "str", # Optional. Name of storage bucket - - Deprecated, moved to data_source_details. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The original file - name. - "size_in_bytes": "str", # Optional. The size of the file in - bytes. - "stored_object_key": "str" # Optional. The object key the - file was stored as. - }, - "item_path": "str", # Optional. Path of folder or object in bucket - - Deprecated, moved to data_source_details. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "region": "str", # Optional. Region code - Deprecated, moved to - data_source_details. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. Spaces Bucket Data Source. - "region": "str" # Optional. Region of bucket. - }, - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str", # Optional. Unique id of knowledge base. - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to crawl. - "crawling_option": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Options for specifying how URLs found on pages should be - handled. * UNKNOWN: Default unknown value * SCOPED: Only include the - base URL. * PATH: Crawl the base URL and linked pages within the URL - path. * DOMAIN: Crawl the base URL and linked pages within the same - domain. * SUBDOMAINS: Crawl the base URL and linked pages for any - subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and - "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest and index - media (images, etc.) on web pages. - } - } + "test_case_uuid": "str", # Optional. + "version": 0 # Optional. The new verson of the test case. } # response body for status code(s): 404 response == { @@ -198489,22 +201179,22 @@ async def create_knowledge_base_data_source( """ @overload - async def create_knowledge_base_data_source( + async def update_evaluation_test_case( self, - knowledge_base_uuid: str, + test_case_uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Add Data Source to a Knowledge Base. + """Update an Evaluation Test Case. - To add a data source to a knowledge base, send a POST request to - ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. + To update an evaluation test-case send a PUT request to + ``/v2/gen-ai/evaluation_test_cases/{test_case_uuid}``. - :param knowledge_base_uuid: Knowledge base id. Required. - :type knowledge_base_uuid: str + :param test_case_uuid: Test-case UUID to update. Required. + :type test_case_uuid: str :param body: Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -198519,76 +201209,8 @@ async def create_knowledge_base_data_source( # response body for status code(s): 200 response == { - "knowledge_base_data_source": { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. AWS S3 Data Source for - Display. - "region": "str" # Optional. Region of bucket. - }, - "bucket_name": "str", # Optional. Name of storage bucket - - Deprecated, moved to data_source_details. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The original file - name. - "size_in_bytes": "str", # Optional. The size of the file in - bytes. - "stored_object_key": "str" # Optional. The object key the - file was stored as. - }, - "item_path": "str", # Optional. Path of folder or object in bucket - - Deprecated, moved to data_source_details. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "region": "str", # Optional. Region code - Deprecated, moved to - data_source_details. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. Spaces Bucket Data Source. - "region": "str" # Optional. Region of bucket. - }, - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str", # Optional. Unique id of knowledge base. - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to crawl. - "crawling_option": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Options for specifying how URLs found on pages should be - handled. * UNKNOWN: Default unknown value * SCOPED: Only include the - base URL. * PATH: Crawl the base URL and linked pages within the URL - path. * DOMAIN: Crawl the base URL and linked pages within the same - domain. * SUBDOMAINS: Crawl the base URL and linked pages for any - subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and - "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest and index - media (images, etc.) on web pages. - } - } + "test_case_uuid": "str", # Optional. + "version": 0 # Optional. The new verson of the test case. } # response body for status code(s): 404 response == { @@ -198604,20 +201226,20 @@ async def create_knowledge_base_data_source( """ @distributed_trace_async - async def create_knowledge_base_data_source( + async def update_evaluation_test_case( self, - knowledge_base_uuid: str, + test_case_uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Add Data Source to a Knowledge Base. + """Update an Evaluation Test Case. - To add a data source to a knowledge base, send a POST request to - ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. + To update an evaluation test-case send a PUT request to + ``/v2/gen-ai/evaluation_test_cases/{test_case_uuid}``. - :param knowledge_base_uuid: Knowledge base id. Required. - :type knowledge_base_uuid: str + :param test_case_uuid: Test-case UUID to update. Required. + :type test_case_uuid: str :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] :return: JSON object @@ -198629,105 +201251,31 @@ async def create_knowledge_base_data_source( # JSON input template you can fill out and use as your body input. body = { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. AWS S3 Data Source. - "key_id": "str", # Optional. The AWS Key ID. - "region": "str", # Optional. Region of bucket. - "secret_key": "str" # Optional. The AWS Secret Key. + "dataset_uuid": "str", # Optional. Dataset against which the test"u2011case + is executed. + "description": "str", # Optional. Description of the test case. + "metrics": { + "metric_uuids": [ + "str" # Optional. + ] }, - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. Spaces Bucket Data Source. - "region": "str" # Optional. Region of bucket. + "name": "str", # Optional. Name of the test case. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success threshold for the + star metric. This is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # Optional. The success threshold for the + star metric. This is a percentage value between 0 and 100. }, - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to crawl. - "crawling_option": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Options for specifying how URLs found on pages should be handled. - * UNKNOWN: Default unknown value * SCOPED: Only include the base URL. * PATH: - Crawl the base URL and linked pages within the URL path. * DOMAIN: Crawl the - base URL and linked pages within the same domain. * SUBDOMAINS: Crawl the - base URL and linked pages for any subdomain. Known values are: "UNKNOWN", - "SCOPED", "PATH", "DOMAIN", and "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest and index media - (images, etc.) on web pages. - } + "test_case_uuid": "str" # Optional. Test-case UUID to update. } # response body for status code(s): 200 response == { - "knowledge_base_data_source": { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. AWS S3 Data Source for - Display. - "region": "str" # Optional. Region of bucket. - }, - "bucket_name": "str", # Optional. Name of storage bucket - - Deprecated, moved to data_source_details. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The original file - name. - "size_in_bytes": "str", # Optional. The size of the file in - bytes. - "stored_object_key": "str" # Optional. The object key the - file was stored as. - }, - "item_path": "str", # Optional. Path of folder or object in bucket - - Deprecated, moved to data_source_details. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "region": "str", # Optional. Region code - Deprecated, moved to - data_source_details. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. Spaces Bucket Data Source. - "region": "str" # Optional. Region of bucket. - }, - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str", # Optional. Unique id of knowledge base. - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to crawl. - "crawling_option": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Options for specifying how URLs found on pages should be - handled. * UNKNOWN: Default unknown value * SCOPED: Only include the - base URL. * PATH: Crawl the base URL and linked pages within the URL - path. * DOMAIN: Crawl the base URL and linked pages within the same - domain. * SUBDOMAINS: Crawl the base URL and linked pages for any - subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and - "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest and index - media (images, etc.) on web pages. - } - } + "test_case_uuid": "str", # Optional. + "version": 0 # Optional. The new verson of the test case. } # response body for status code(s): 404 response == { @@ -198773,8 +201321,8 @@ async def create_knowledge_base_data_source( else: _json = None - _request = build_genai_create_knowledge_base_data_source_request( - knowledge_base_uuid=knowledge_base_uuid, + _request = build_genai_update_evaluation_test_case_request( + test_case_uuid=test_case_uuid, content_type=content_type, json=_json, content=_content, @@ -198837,132 +201385,23 @@ async def create_knowledge_base_data_source( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def delete_knowledge_base_data_source( - self, knowledge_base_uuid: str, data_source_uuid: str, **kwargs: Any + async def list_indexing_jobs( + self, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Delete a Data Source from a Knowledge Base. - - To delete a data source from a knowledge base, send a DELETE request to - ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources/{data_source_uuid}``. - - :param knowledge_base_uuid: Knowledge base id. Required. - :type knowledge_base_uuid: str - :param data_source_uuid: Data source id. Required. - :type data_source_uuid: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "data_source_uuid": "str", # Optional. Data source id. - "knowledge_base_uuid": "str" # Optional. Knowledge base id. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_genai_delete_knowledge_base_data_source_request( - knowledge_base_uuid=knowledge_base_uuid, - data_source_uuid=data_source_uuid, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @distributed_trace_async - async def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: - # pylint: disable=line-too-long - """Retrieve Information About an Existing Knowledge Base. + """List Indexing Jobs for a Knowledge Base. - To retrive information about an existing knowledge base, send a GET request to - ``/v2/gen-ai/knowledge_bases/{uuid}``. + To list all indexing jobs for a knowledge base, send a GET request to + ``/v2/gen-ai/indexing_jobs``. - :param uuid: Knowledge base id. Required. - :type uuid: str + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -198972,30 +201411,17 @@ async def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "database_status": "CREATING", # Optional. Default value is "CREATING". - Known values are: "CREATING", "ONLINE", "POWEROFF", "REBUILDING", "REBALANCING", - "DECOMMISSIONED", "FORKING", "MIGRATING", "RESIZING", "RESTORING", "POWERING_ON", - and "UNHEALTHY". - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { + "jobs": [ + { "completed_datasources": 0, # Optional. Number of datasources indexed completed. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "data_source_uuids": [ - "str" # Optional. IndexingJob description. + "str" # Optional. The indexing jobs. ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. + "finished_at": "2020-02-20 00:00:00", # Optional. The + indexing jobs. "knowledge_base_uuid": "str", # Optional. Knowledge base id. "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: @@ -199003,26 +201429,34 @@ async def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. + "started_at": "2020-02-20 00:00:00", # Optional. The + indexing jobs. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. } } # response body for status code(s): 404 @@ -199055,8 +201489,9 @@ async def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_get_knowledge_base_request( - uuid=uuid, + _request = build_genai_list_indexing_jobs_request( + page=page, + per_page=per_page, headers=_headers, params=_params, ) @@ -199116,21 +201551,19 @@ async def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @overload - async def update_knowledge_base( + async def create_indexing_job( self, - uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update a Knowledge Base. + """Start Indexing Job for a Knowledge Base. - To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + To start an indexing job for a knowledge base, send a POST request to + ``/v2/gen-ai/indexing_jobs``. - :param uuid: Knowledge base id. Required. - :type uuid: str :param body: Default value is None. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -199145,69 +201578,43 @@ async def update_knowledge_base( # JSON input template you can fill out and use as your body input. body = { - "database_id": "str", # Optional. The id of the DigitalOcean database this - knowledge base will use, optiona. - "embedding_model_uuid": "str", # Optional. Identifier for the foundation - model. - "name": "str", # Optional. Knowledge base name. - "project_id": "str", # Optional. The id of the DigitalOcean project this - knowledge base will belong to.:code:`
`Requires ``project:update`` scope. - "tags": [ - "str" # Optional. Tags to organize your knowledge - base..:code:`
`Requires ``tag:create`` scope. + "data_source_uuids": [ + "str" # Optional. List of data source ids to index, if none are + provided, all data sources will be indexed. ], - "uuid": "str" # Optional. Knowledge base id. + "knowledge_base_uuid": "str" # Optional. Knowledge base id. } # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -199224,21 +201631,19 @@ async def update_knowledge_base( """ @overload - async def update_knowledge_base( + async def create_indexing_job( self, - uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update a Knowledge Base. + """Start Indexing Job for a Knowledge Base. - To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + To start an indexing job for a knowledge base, send a POST request to + ``/v2/gen-ai/indexing_jobs``. - :param uuid: Knowledge base id. Required. - :type uuid: str :param body: Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -199253,53 +201658,34 @@ async def update_knowledge_base( # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -199316,16 +201702,15 @@ async def update_knowledge_base( """ @distributed_trace_async - async def update_knowledge_base( - self, uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + async def create_indexing_job( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update a Knowledge Base. + """Start Indexing Job for a Knowledge Base. - To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + To start an indexing job for a knowledge base, send a POST request to + ``/v2/gen-ai/indexing_jobs``. - :param uuid: Knowledge base id. Required. - :type uuid: str :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] :return: JSON object @@ -199337,69 +201722,43 @@ async def update_knowledge_base( # JSON input template you can fill out and use as your body input. body = { - "database_id": "str", # Optional. The id of the DigitalOcean database this - knowledge base will use, optiona. - "embedding_model_uuid": "str", # Optional. Identifier for the foundation - model. - "name": "str", # Optional. Knowledge base name. - "project_id": "str", # Optional. The id of the DigitalOcean project this - knowledge base will belong to.:code:`
`Requires ``project:update`` scope. - "tags": [ - "str" # Optional. Tags to organize your knowledge - base..:code:`
`Requires ``tag:create`` scope. + "data_source_uuids": [ + "str" # Optional. List of data source ids to index, if none are + provided, all data sources will be indexed. ], - "uuid": "str" # Optional. Knowledge base id. + "knowledge_base_uuid": "str" # Optional. Knowledge base id. } # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -199446,8 +201805,7 @@ async def update_knowledge_base( else: _json = None - _request = build_genai_update_knowledge_base_request( - uuid=uuid, + _request = build_genai_create_indexing_job_request( content_type=content_type, json=_json, content=_content, @@ -199510,14 +201868,17 @@ async def update_knowledge_base( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def delete_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: + async def list_indexing_job_data_sources( + self, indexing_job_uuid: str, **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """Delete a Knowledge Base. + """List Data Sources for Indexing Job for a Knowledge Base. - To delete a knowledge base, send a DELETE request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + To list all datasources for an indexing job, send a GET request to + ``/v2/gen-ai/indexing_jobs/{indexing_job_uuid}/data_sources``. - :param uuid: Knowledge base id. Required. - :type uuid: str + :param indexing_job_uuid: Uuid of the indexing job. Required. + :type indexing_job_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -199527,7 +201888,41 @@ async def delete_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "uuid": "str" # Optional. The id of the deleted knowledge base. + "indexed_data_sources": [ + { + "completed_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source completed indexing. + "data_source_uuid": "str", # Optional. Uuid of the indexed + data source. + "error_details": "str", # Optional. A detailed error + description. + "error_msg": "str", # Optional. A string code provinding a + hint which part of the system experienced an error. + "failed_item_count": "str", # Optional. Total count of files + that have failed. + "indexed_file_count": "str", # Optional. Total count of + files that have been indexed. + "indexed_item_count": "str", # Optional. Total count of + files that have been indexed. + "removed_item_count": "str", # Optional. Total count of + files that have been removed. + "skipped_item_count": "str", # Optional. Total count of + files that have been skipped. + "started_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source started indexing. + "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. Default + value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: + "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", + "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", + "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". + "total_bytes": "str", # Optional. Total size of files in + data source in bytes. + "total_bytes_indexed": "str", # Optional. Total size of + files in data source in bytes that have been indexed. + "total_file_count": "str" # Optional. Total file count in + the data source. + } + ] } # response body for status code(s): 404 response == { @@ -199559,8 +201954,8 @@ async def delete_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_delete_knowledge_base_request( - uuid=uuid, + _request = build_genai_list_indexing_job_data_sources_request( + indexing_job_uuid=indexing_job_uuid, headers=_headers, params=_params, ) @@ -199620,37 +202015,15 @@ async def delete_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def list_models( - self, - *, - usecases: Optional[List[str]] = None, - public_only: Optional[bool] = None, - page: Optional[int] = None, - per_page: Optional[int] = None, - **kwargs: Any - ) -> JSON: + async def get_indexing_job(self, uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """List Available Models. - - To list all models, send a GET request to ``/v2/gen-ai/models``. - - :keyword usecases: Include only models defined for the listed usecases. + """Retrieve Status of Indexing Job for a Knowledge Base. + To get status of an indexing Job for a knowledge base, send a GET request to + ``/v2/gen-ai/indexing_jobs/{uuid}``. - * MODEL_USECASE_UNKNOWN: The use case of the model is unknown - * MODEL_USECASE_AGENT: The model maybe used in an agent - * MODEL_USECASE_FINETUNED: The model maybe used for fine tuning - * MODEL_USECASE_KNOWLEDGEBASE: The model maybe used for knowledge bases (embedding models) - * MODEL_USECASE_GUARDRAIL: The model maybe used for guardrails - * MODEL_USECASE_REASONING: The model usecase for reasoning - * MODEL_USECASE_SERVERLESS: The model usecase for serverless inference. Default value is None. - :paramtype usecases: list[str] - :keyword public_only: Only include models that are publicly available. Default value is None. - :paramtype public_only: bool - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int + :param uuid: Indexing job id. Required. + :type uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -199660,192 +202033,34 @@ async def list_models( # response body for status code(s): 200 response == { - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. - } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. - }, - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement Description. - "url": "str", # Optional. Agreement Description. - "uuid": "str" # Optional. Agreement Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the model, - this model is based on. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "upload_complete": bool, # Optional. Model has been fully - uploaded. - "url": "str", # Optional. Download url. - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version number. - "minor": 0, # Optional. Minor version number. - "patch": 0 # Optional. Patch version number. - } - } - ] - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_genai_list_models_request( - usecases=usecases, - public_only=public_only, - page=page, - per_page=per_page, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @distributed_trace_async - async def list_model_api_keys( - self, - *, - page: Optional[int] = None, - per_page: Optional[int] = None, - **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """List Model API Keys. - - To list all model API keys, send a GET request to ``/v2/gen-ai/models/api_keys``. - - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "api_key_infos": [ - { - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted - date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Api key infos. - "uuid": "str" # Optional. Uuid. - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. - } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -199878,9 +202093,8 @@ async def list_model_api_keys( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_model_api_keys_request( - page=page, - per_page=per_page, + _request = build_genai_get_indexing_job_request( + uuid=uuid, headers=_headers, params=_params, ) @@ -199940,18 +202154,22 @@ async def list_model_api_keys( return cast(JSON, deserialized) # type: ignore @overload - async def create_model_api_key( + async def cancel_indexing_job( self, + uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a Model API Key. + """Cancel Indexing Job for a Knowledge Base. - To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. + To cancel an indexing job for a knowledge base, send a PUT request to + ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + :param uuid: A unique identifier for an indexing job. Required. + :type uuid: str :param body: Default value is None. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -199966,18 +202184,39 @@ async def create_model_api_key( # JSON input template you can fill out and use as your body input. body = { - "name": "str" # Optional. A human friendly name to identify the key. + "uuid": "str" # Optional. A unique identifier for an indexing job. } # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -199994,18 +202233,22 @@ async def create_model_api_key( """ @overload - async def create_model_api_key( + async def cancel_indexing_job( self, + uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a Model API Key. + """Cancel Indexing Job for a Knowledge Base. - To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. + To cancel an indexing job for a knowledge base, send a PUT request to + ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + :param uuid: A unique identifier for an indexing job. Required. + :type uuid: str :param body: Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -200020,13 +202263,34 @@ async def create_model_api_key( # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -200043,14 +202307,17 @@ async def create_model_api_key( """ @distributed_trace_async - async def create_model_api_key( - self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + async def cancel_indexing_job( + self, uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a Model API Key. + """Cancel Indexing Job for a Knowledge Base. - To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. + To cancel an indexing job for a knowledge base, send a PUT request to + ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + :param uuid: A unique identifier for an indexing job. Required. + :type uuid: str :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] :return: JSON object @@ -200062,18 +202329,39 @@ async def create_model_api_key( # JSON input template you can fill out and use as your body input. body = { - "name": "str" # Optional. A human friendly name to identify the key. + "uuid": "str" # Optional. A unique identifier for an indexing job. } # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -200120,7 +202408,8 @@ async def create_model_api_key( else: _json = None - _request = build_genai_create_model_api_key_request( + _request = build_genai_cancel_indexing_job_request( + uuid=uuid, content_type=content_type, json=_json, content=_content, @@ -200182,22 +202471,208 @@ async def create_model_api_key( return cast(JSON, deserialized) # type: ignore + @distributed_trace_async + async def list_knowledge_bases( + self, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List Knowledge Bases. + + To list all knowledge bases, send a GET request to ``/v2/gen-ai/knowledge_bases``. + + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time + when the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "database_id": "str", # Optional. The knowledge bases. + "embedding_model_uuid": "str", # Optional. The knowledge + bases. + "is_public": bool, # Optional. Whether the knowledge base is + public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. + Default value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. + Default value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of + datasources being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. The knowledge bases. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related + resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "user_id": "str", # Optional. Id of user that created the + knowledge base. + "uuid": "str" # Optional. Unique id for knowledge base. + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_knowledge_bases_request( + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + @overload - async def update_model_api_key( + async def create_knowledge_base( self, - api_key_uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update API Key for a Model. + """Create a Knowledge Base. - To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str :param body: Default value is None. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -200212,19 +202687,127 @@ async def update_model_api_key( # JSON input template you can fill out and use as your body input. body = { - "api_key_uuid": "str", # Optional. API key ID. - "name": "str" # Optional. Name. + "database_id": "str", # Optional. Identifier of the DigitalOcean OpenSearch + database this knowledge base will use, optional. If not provided, we create a new + database for the knowledge base in the same region as the knowledge base. + "datasources": [ + { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. AWS S3 Data Source. + "key_id": "str", # Optional. The AWS Key ID. + "region": "str", # Optional. Region of bucket. + "secret_key": "str" # Optional. The AWS Secret Key. + }, + "bucket_name": "str", # Optional. Deprecated, moved to + data_source_details. + "bucket_region": "str", # Optional. Deprecated, moved to + data_source_details. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The + original file name. + "size_in_bytes": "str", # Optional. The size of the + file in bytes. + "stored_object_key": "str" # Optional. The object + key the file was stored as. + }, + "item_path": "str", # Optional. The data sources to use for + this knowledge base. See `Organize Data Sources + `_ + for more information on data sources best practices. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. Spaces Bucket Data + Source. + "region": "str" # Optional. Region of bucket. + }, + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to + crawl. + "crawling_option": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Options for specifying how URLs found on pages + should be handled. * UNKNOWN: Default unknown value * SCOPED: Only + include the base URL. * PATH: Crawl the base URL and linked pages + within the URL path. * DOMAIN: Crawl the base URL and linked pages + within the same domain. * SUBDOMAINS: Crawl the base URL and linked + pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", + "PATH", "DOMAIN", and "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest + and index media (images, etc.) on web pages. + } + } + ], + "embedding_model_uuid": "str", # Optional. Identifier for the `embedding + model + `_. + "name": "str", # Optional. Name of the knowledge base. + "project_id": "str", # Optional. Identifier of the DigitalOcean project this + knowledge base will belong to. + "region": "str", # Optional. The datacenter region to deploy the knowledge + base in. + "tags": [ + "str" # Optional. Tags to organize your knowledge base. + ], + "vpc_uuid": "str" # Optional. The VPC to deploy the knowledge base database + in. } # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. } } # response body for status code(s): 404 @@ -200241,21 +202824,18 @@ async def update_model_api_key( """ @overload - async def update_model_api_key( + async def create_knowledge_base( self, - api_key_uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update API Key for a Model. + """Create a Knowledge Base. - To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str :param body: Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -200270,13 +202850,58 @@ async def update_model_api_key( # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. } } # response body for status code(s): 404 @@ -200293,19 +202918,14 @@ async def update_model_api_key( """ @distributed_trace_async - async def update_model_api_key( - self, - api_key_uuid: str, - body: Optional[Union[JSON, IO[bytes]]] = None, - **kwargs: Any + async def create_knowledge_base( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update API Key for a Model. + """Create a Knowledge Base. - To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] :return: JSON object @@ -200317,19 +202937,127 @@ async def update_model_api_key( # JSON input template you can fill out and use as your body input. body = { - "api_key_uuid": "str", # Optional. API key ID. - "name": "str" # Optional. Name. + "database_id": "str", # Optional. Identifier of the DigitalOcean OpenSearch + database this knowledge base will use, optional. If not provided, we create a new + database for the knowledge base in the same region as the knowledge base. + "datasources": [ + { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. AWS S3 Data Source. + "key_id": "str", # Optional. The AWS Key ID. + "region": "str", # Optional. Region of bucket. + "secret_key": "str" # Optional. The AWS Secret Key. + }, + "bucket_name": "str", # Optional. Deprecated, moved to + data_source_details. + "bucket_region": "str", # Optional. Deprecated, moved to + data_source_details. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The + original file name. + "size_in_bytes": "str", # Optional. The size of the + file in bytes. + "stored_object_key": "str" # Optional. The object + key the file was stored as. + }, + "item_path": "str", # Optional. The data sources to use for + this knowledge base. See `Organize Data Sources + `_ + for more information on data sources best practices. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. Spaces Bucket Data + Source. + "region": "str" # Optional. Region of bucket. + }, + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to + crawl. + "crawling_option": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Options for specifying how URLs found on pages + should be handled. * UNKNOWN: Default unknown value * SCOPED: Only + include the base URL. * PATH: Crawl the base URL and linked pages + within the URL path. * DOMAIN: Crawl the base URL and linked pages + within the same domain. * SUBDOMAINS: Crawl the base URL and linked + pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", + "PATH", "DOMAIN", and "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest + and index media (images, etc.) on web pages. + } + } + ], + "embedding_model_uuid": "str", # Optional. Identifier for the `embedding + model + `_. + "name": "str", # Optional. Name of the knowledge base. + "project_id": "str", # Optional. Identifier of the DigitalOcean project this + knowledge base will belong to. + "region": "str", # Optional. The datacenter region to deploy the knowledge + base in. + "tags": [ + "str" # Optional. Tags to organize your knowledge base. + ], + "vpc_uuid": "str" # Optional. The VPC to deploy the knowledge base database + in. } # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. } } # response body for status code(s): 404 @@ -200376,8 +203104,7 @@ async def update_model_api_key( else: _json = None - _request = build_genai_update_model_api_key_request( - api_key_uuid=api_key_uuid, + _request = build_genai_create_knowledge_base_request( content_type=content_type, json=_json, content=_content, @@ -200440,15 +203167,26 @@ async def update_model_api_key( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def delete_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + async def list_knowledge_base_data_sources( + self, + knowledge_base_uuid: str, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """Delete API Key for a Model. + """List Data Sources for a Knowledge Base. - To delete an API key for a model, send a DELETE request to - ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + To list all data sources for a knowledge base, send a GET request to + ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. - :param api_key_uuid: API key for an agent. Required. - :type api_key_uuid: str + :param knowledge_base_uuid: Knowledge base id. Required. + :type knowledge_base_uuid: str + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -200458,13 +203196,135 @@ async def delete_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "knowledge_base_data_sources": [ + { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. AWS S3 Data Source + for Display. + "region": "str" # Optional. Region of bucket. + }, + "bucket_name": "str", # Optional. Name of storage bucket - + Deprecated, moved to data_source_details. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The + original file name. + "size_in_bytes": "str", # Optional. The size of the + file in bytes. + "stored_object_key": "str" # Optional. The object + key the file was stored as. + }, + "item_path": "str", # Optional. Path of folder or object in + bucket - Deprecated, moved to data_source_details. + "last_datasource_indexing_job": { + "completed_at": "2020-02-20 00:00:00", # Optional. + Timestamp when data source completed indexing. + "data_source_uuid": "str", # Optional. Uuid of the + indexed data source. + "error_details": "str", # Optional. A detailed error + description. + "error_msg": "str", # Optional. A string code + provinding a hint which part of the system experienced an error. + "failed_item_count": "str", # Optional. Total count + of files that have failed. + "indexed_file_count": "str", # Optional. Total count + of files that have been indexed. + "indexed_item_count": "str", # Optional. Total count + of files that have been indexed. + "removed_item_count": "str", # Optional. Total count + of files that have been removed. + "skipped_item_count": "str", # Optional. Total count + of files that have been skipped. + "started_at": "2020-02-20 00:00:00", # Optional. + Timestamp when data source started indexing. + "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. + Default value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: + "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", + "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", + "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". + "total_bytes": "str", # Optional. Total size of + files in data source in bytes. + "total_bytes_indexed": "str", # Optional. Total size + of files in data source in bytes that have been indexed. + "total_file_count": "str" # Optional. Total file + count in the data source. + }, + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. + Default value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. + Default value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of + datasources being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "uuid": "str" # Optional. Unique id. + }, + "region": "str", # Optional. Region code - Deprecated, moved + to data_source_details. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. Spaces Bucket Data + Source. + "region": "str" # Optional. Region of bucket. + }, + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str", # Optional. Unique id of knowledge base. + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to + crawl. + "crawling_option": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Options for specifying how URLs found on pages + should be handled. * UNKNOWN: Default unknown value * SCOPED: Only + include the base URL. * PATH: Crawl the base URL and linked pages + within the URL path. * DOMAIN: Crawl the base URL and linked pages + within the same domain. * SUBDOMAINS: Crawl the base URL and linked + pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", + "PATH", "DOMAIN", and "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest + and index media (images, etc.) on web pages. + } + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. } } # response body for status code(s): 404 @@ -200497,8 +203357,10 @@ async def delete_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_delete_model_api_key_request( - api_key_uuid=api_key_uuid, + _request = build_genai_list_knowledge_base_data_sources_request( + knowledge_base_uuid=knowledge_base_uuid, + page=page, + per_page=per_page, headers=_headers, params=_params, ) @@ -200557,16 +203419,28 @@ async def delete_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore - @distributed_trace_async - async def regenerate_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + @overload + async def create_knowledge_base_data_source( + self, + knowledge_base_uuid: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """Regenerate API Key for a Model. + """Add Data Source to a Knowledge Base. - To regenerate a model API key, send a PUT request to - ``/v2/gen-ai/models/api_keys/{api_key_uuid}/regenerate``. + To add a data source to a knowledge base, send a POST request to + ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str + :param knowledge_base_uuid: Knowledge base id. Required. + :type knowledge_base_uuid: str + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -200574,15 +203448,145 @@ async def regenerate_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JS Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. AWS S3 Data Source. + "key_id": "str", # Optional. The AWS Key ID. + "region": "str", # Optional. Region of bucket. + "secret_key": "str" # Optional. The AWS Secret Key. + }, + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. Spaces Bucket Data Source. + "region": "str" # Optional. Region of bucket. + }, + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to crawl. + "crawling_option": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Options for specifying how URLs found on pages should be handled. + * UNKNOWN: Default unknown value * SCOPED: Only include the base URL. * PATH: + Crawl the base URL and linked pages within the URL path. * DOMAIN: Crawl the + base URL and linked pages within the same domain. * SUBDOMAINS: Crawl the + base URL and linked pages for any subdomain. Known values are: "UNKNOWN", + "SCOPED", "PATH", "DOMAIN", and "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest and index media + (images, etc.) on web pages. + } + } + # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "knowledge_base_data_source": { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. AWS S3 Data Source for + Display. + "region": "str" # Optional. Region of bucket. + }, + "bucket_name": "str", # Optional. Name of storage bucket - + Deprecated, moved to data_source_details. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The original file + name. + "size_in_bytes": "str", # Optional. The size of the file in + bytes. + "stored_object_key": "str" # Optional. The object key the + file was stored as. + }, + "item_path": "str", # Optional. Path of folder or object in bucket - + Deprecated, moved to data_source_details. + "last_datasource_indexing_job": { + "completed_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source completed indexing. + "data_source_uuid": "str", # Optional. Uuid of the indexed + data source. + "error_details": "str", # Optional. A detailed error + description. + "error_msg": "str", # Optional. A string code provinding a + hint which part of the system experienced an error. + "failed_item_count": "str", # Optional. Total count of files + that have failed. + "indexed_file_count": "str", # Optional. Total count of + files that have been indexed. + "indexed_item_count": "str", # Optional. Total count of + files that have been indexed. + "removed_item_count": "str", # Optional. Total count of + files that have been removed. + "skipped_item_count": "str", # Optional. Total count of + files that have been skipped. + "started_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source started indexing. + "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. Default + value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: + "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", + "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", + "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". + "total_bytes": "str", # Optional. Total size of files in + data source in bytes. + "total_bytes_indexed": "str", # Optional. Total size of + files in data source in bytes that have been indexed. + "total_file_count": "str" # Optional. Total file count in + the data source. + }, + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "region": "str", # Optional. Region code - Deprecated, moved to + data_source_details. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. Spaces Bucket Data Source. + "region": "str" # Optional. Region of bucket. + }, + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str", # Optional. Unique id of knowledge base. + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to crawl. + "crawling_option": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Options for specifying how URLs found on pages should be + handled. * UNKNOWN: Default unknown value * SCOPED: Only include the + base URL. * PATH: Crawl the base URL and linked pages within the URL + path. * DOMAIN: Crawl the base URL and linked pages within the same + domain. * SUBDOMAINS: Crawl the base URL and linked pages for any + subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and + "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest and index + media (images, etc.) on web pages. + } } } # response body for status code(s): 404 @@ -200597,101 +203601,178 @@ async def regenerate_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JS tickets to help identify the issue. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_genai_regenerate_model_api_key_request( - api_key_uuid=api_key_uuid, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - if response.content: - deserialized = response.json() - else: - deserialized = None + @overload + async def create_knowledge_base_data_source( + self, + knowledge_base_uuid: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Add Data Source to a Knowledge Base. - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) + To add a data source to a knowledge base, send a POST request to + ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. - if response.content: - deserialized = response.json() - else: - deserialized = None + :param knowledge_base_uuid: Knowledge base id. Required. + :type knowledge_base_uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + Example: + .. code-block:: python - return cast(JSON, deserialized) # type: ignore + # response body for status code(s): 200 + response == { + "knowledge_base_data_source": { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. AWS S3 Data Source for + Display. + "region": "str" # Optional. Region of bucket. + }, + "bucket_name": "str", # Optional. Name of storage bucket - + Deprecated, moved to data_source_details. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The original file + name. + "size_in_bytes": "str", # Optional. The size of the file in + bytes. + "stored_object_key": "str" # Optional. The object key the + file was stored as. + }, + "item_path": "str", # Optional. Path of folder or object in bucket - + Deprecated, moved to data_source_details. + "last_datasource_indexing_job": { + "completed_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source completed indexing. + "data_source_uuid": "str", # Optional. Uuid of the indexed + data source. + "error_details": "str", # Optional. A detailed error + description. + "error_msg": "str", # Optional. A string code provinding a + hint which part of the system experienced an error. + "failed_item_count": "str", # Optional. Total count of files + that have failed. + "indexed_file_count": "str", # Optional. Total count of + files that have been indexed. + "indexed_item_count": "str", # Optional. Total count of + files that have been indexed. + "removed_item_count": "str", # Optional. Total count of + files that have been removed. + "skipped_item_count": "str", # Optional. Total count of + files that have been skipped. + "started_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source started indexing. + "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. Default + value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: + "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", + "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", + "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". + "total_bytes": "str", # Optional. Total size of files in + data source in bytes. + "total_bytes_indexed": "str", # Optional. Total size of + files in data source in bytes that have been indexed. + "total_file_count": "str" # Optional. Total file count in + the data source. + }, + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "region": "str", # Optional. Region code - Deprecated, moved to + data_source_details. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. Spaces Bucket Data Source. + "region": "str" # Optional. Region of bucket. + }, + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str", # Optional. Unique id of knowledge base. + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to crawl. + "crawling_option": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Options for specifying how URLs found on pages should be + handled. * UNKNOWN: Default unknown value * SCOPED: Only include the + base URL. * PATH: Crawl the base URL and linked pages within the URL + path. * DOMAIN: Crawl the base URL and linked pages within the same + domain. * SUBDOMAINS: Crawl the base URL and linked pages for any + subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and + "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest and index + media (images, etc.) on web pages. + } + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ @distributed_trace_async - async def list_openai_api_keys( + async def create_knowledge_base_data_source( self, - *, - page: Optional[int] = None, - per_page: Optional[int] = None, + knowledge_base_uuid: str, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """List OpenAI API Keys. + """Add Data Source to a Knowledge Base. - To list all OpenAI API keys, send a GET request to ``/v2/gen-ai/openai/keys``. + To add a data source to a knowledge base, send a POST request to + ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int + :param knowledge_base_uuid: Knowledge base id. Required. + :type knowledge_base_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -200699,83 +203780,145 @@ async def list_openai_api_keys( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. AWS S3 Data Source. + "key_id": "str", # Optional. The AWS Key ID. + "region": "str", # Optional. Region of bucket. + "secret_key": "str" # Optional. The AWS Secret Key. + }, + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. Spaces Bucket Data Source. + "region": "str" # Optional. Region of bucket. + }, + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to crawl. + "crawling_option": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Options for specifying how URLs found on pages should be handled. + * UNKNOWN: Default unknown value * SCOPED: Only include the base URL. * PATH: + Crawl the base URL and linked pages within the URL path. * DOMAIN: Crawl the + base URL and linked pages within the same domain. * SUBDOMAINS: Crawl the + base URL and linked pages for any subdomain. Known values are: "UNKNOWN", + "SCOPED", "PATH", "DOMAIN", and "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest and index media + (images, etc.) on web pages. + } + } + # response body for status code(s): 200 response == { - "api_key_infos": [ - { - "created_at": "2020-02-20 00:00:00", # Optional. Key - creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted - date. - "models": [ - { - "agreement": { - "description": "str", # Optional. - Agreement Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # - Optional. Creation date / time. - "inference_name": "str", # Optional. - Internally used name. - "inference_version": "str", # Optional. - Internally used version. - "is_foundational": bool, # Optional. True if - it is a foundational model provided by do. - "metadata": {}, # Optional. Additional meta - data. - "name": "str", # Optional. Name of the - model. - "parent_uuid": "str", # Optional. Unique id - of the model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # - Optional. Last modified. - "upload_complete": bool, # Optional. Model - has been fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the - model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major - version number. - "minor": 0, # Optional. Minor - version number. - "patch": 0 # Optional. Patch version - number. - } - } + "knowledge_base_data_source": { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. AWS S3 Data Source for + Display. + "region": "str" # Optional. Region of bucket. + }, + "bucket_name": "str", # Optional. Name of storage bucket - + Deprecated, moved to data_source_details. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The original file + name. + "size_in_bytes": "str", # Optional. The size of the file in + bytes. + "stored_object_key": "str" # Optional. The object key the + file was stored as. + }, + "item_path": "str", # Optional. Path of folder or object in bucket - + Deprecated, moved to data_source_details. + "last_datasource_indexing_job": { + "completed_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source completed indexing. + "data_source_uuid": "str", # Optional. Uuid of the indexed + data source. + "error_details": "str", # Optional. A detailed error + description. + "error_msg": "str", # Optional. A string code provinding a + hint which part of the system experienced an error. + "failed_item_count": "str", # Optional. Total count of files + that have failed. + "indexed_file_count": "str", # Optional. Total count of + files that have been indexed. + "indexed_item_count": "str", # Optional. Total count of + files that have been indexed. + "removed_item_count": "str", # Optional. Total count of + files that have been removed. + "skipped_item_count": "str", # Optional. Total count of + files that have been skipped. + "started_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source started indexing. + "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. Default + value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: + "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", + "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", + "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". + "total_bytes": "str", # Optional. Total size of files in + data source in bytes. + "total_bytes_indexed": "str", # Optional. Total size of + files in data source in bytes that have been indexed. + "total_file_count": "str" # Optional. Total file count in + the data source. + }, + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last - updated date. - "uuid": "str" # Optional. Uuid. - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "region": "str", # Optional. Region code - Deprecated, moved to + data_source_details. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. Spaces Bucket Data Source. + "region": "str" # Optional. Region of bucket. + }, + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str", # Optional. Unique id of knowledge base. + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to crawl. + "crawling_option": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Options for specifying how URLs found on pages should be + handled. * UNKNOWN: Default unknown value * SCOPED: Only include the + base URL. * PATH: Crawl the base URL and linked pages within the URL + path. * DOMAIN: Crawl the base URL and linked pages within the same + domain. * SUBDOMAINS: Crawl the base URL and linked pages for any + subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and + "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest and index + media (images, etc.) on web pages. } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. } } # response body for status code(s): 404 @@ -200803,14 +203946,30 @@ async def list_openai_api_keys( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_openai_api_keys_request( - page=page, - per_page=per_page, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_create_knowledge_base_data_source_request( + knowledge_base_uuid=knowledge_base_uuid, + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -200869,215 +204028,20 @@ async def list_openai_api_keys( return cast(JSON, deserialized) # type: ignore - @overload - async def create_openai_api_key( - self, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Create OpenAI API Key. - - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. - - :param body: Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "api_key": "str", # Optional. OpenAI API key. - "name": "str" # Optional. Name of the key. - } - - # response body for status code(s): 200 - response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } - ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. - "uuid": "str" # Optional. Uuid. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @overload - async def create_openai_api_key( - self, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Create OpenAI API Key. - - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. - - :param body: Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } - ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. - "uuid": "str" # Optional. Uuid. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - @distributed_trace_async - async def create_openai_api_key( - self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + async def delete_knowledge_base_data_source( + self, knowledge_base_uuid: str, data_source_uuid: str, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create OpenAI API Key. + """Delete a Data Source from a Knowledge Base. - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + To delete a data source from a knowledge base, send a DELETE request to + ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources/{data_source_uuid}``. - :param body: Is either a JSON type or a IO[bytes] type. Default value is None. - :type body: JSON or IO[bytes] + :param knowledge_base_uuid: Knowledge base id. Required. + :type knowledge_base_uuid: str + :param data_source_uuid: Data source id. Required. + :type data_source_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -201085,69 +204049,10 @@ async def create_openai_api_key( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "api_key": "str", # Optional. OpenAI API key. - "name": "str" # Optional. Name of the key. - } - # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } - ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. - "uuid": "str" # Optional. Uuid. - } + "data_source_uuid": "str", # Optional. Data source id. + "knowledge_base_uuid": "str" # Optional. Knowledge base id. } # response body for status code(s): 404 response == { @@ -201174,29 +204079,14 @@ async def create_openai_api_key( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) cls: ClsType[JSON] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _json = body - else: - _json = None - - _request = build_genai_create_openai_api_key_request( - content_type=content_type, - json=_json, - content=_content, + _request = build_genai_delete_knowledge_base_data_source_request( + knowledge_base_uuid=knowledge_base_uuid, + data_source_uuid=data_source_uuid, headers=_headers, params=_params, ) @@ -201256,15 +204146,15 @@ async def create_openai_api_key( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def get_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + async def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Get OpenAI API Key. + """Retrieve Information About an Existing Knowledge Base. - To retrieve details of an OpenAI API key, send a GET request to - ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To retrive information about an existing knowledge base, send a GET request to + ``/v2/gen-ai/knowledge_bases/{uuid}``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str + :param uuid: Knowledge base id. Required. + :type uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -201274,60 +204164,62 @@ async def get_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } + "database_status": "CREATING", # Optional. Default value is "CREATING". + Known values are: "CREATING", "ONLINE", "POWEROFF", "REBUILDING", "REBALANCING", + "DECOMMISSIONED", "FORKING", "MIGRATING", "RESIZING", "RESTORING", "POWERING_ON", + and "UNHEALTHY". + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. - "uuid": "str" # Optional. Uuid. + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. } } # response body for status code(s): 404 @@ -201360,8 +204252,8 @@ async def get_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_get_openai_api_key_request( - api_key_uuid=api_key_uuid, + _request = build_genai_get_knowledge_base_request( + uuid=uuid, headers=_headers, params=_params, ) @@ -201421,21 +204313,21 @@ async def get_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @overload - async def update_openai_api_key( + async def update_knowledge_base( self, - api_key_uuid: str, + uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update OpenAI API Key. + """Update a Knowledge Base. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str + :param uuid: Knowledge base id. Required. + :type uuid: str :param body: Default value is None. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -201450,66 +204342,851 @@ async def update_openai_api_key( # JSON input template you can fill out and use as your body input. body = { - "api_key": "str", # Optional. OpenAI API key. - "api_key_uuid": "str", # Optional. API key ID. - "name": "str" # Optional. Name of the key. + "database_id": "str", # Optional. The id of the DigitalOcean database this + knowledge base will use, optiona. + "embedding_model_uuid": "str", # Optional. Identifier for the foundation + model. + "name": "str", # Optional. Knowledge base name. + "project_id": "str", # Optional. The id of the DigitalOcean project this + knowledge base will belong to. + "tags": [ + "str" # Optional. Tags to organize your knowledge base. + ], + "uuid": "str" # Optional. Knowledge base id. } # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def update_knowledge_base( + self, + uuid: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update a Knowledge Base. + + To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + + :param uuid: Knowledge base id. Required. + :type uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def update_knowledge_base( + self, uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update a Knowledge Base. + + To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + + :param uuid: Knowledge base id. Required. + :type uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "database_id": "str", # Optional. The id of the DigitalOcean database this + knowledge base will use, optiona. + "embedding_model_uuid": "str", # Optional. Identifier for the foundation + model. + "name": "str", # Optional. Knowledge base name. + "project_id": "str", # Optional. The id of the DigitalOcean project this + knowledge base will belong to. + "tags": [ + "str" # Optional. Tags to organize your knowledge base. + ], + "uuid": "str" # Optional. Knowledge base id. + } + + # response body for status code(s): 200 + response == { + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_update_knowledge_base_request( + uuid=uuid, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def delete_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete a Knowledge Base. + + To delete a knowledge base, send a DELETE request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + + :param uuid: Knowledge base id. Required. + :type uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "uuid": "str" # Optional. The id of the deleted knowledge base. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_delete_knowledge_base_request( + uuid=uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_models( + self, + *, + usecases: Optional[List[str]] = None, + public_only: Optional[bool] = None, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List Available Models. + + To list all models, send a GET request to ``/v2/gen-ai/models``. + + :keyword usecases: Include only models defined for the listed usecases. + + + * MODEL_USECASE_UNKNOWN: The use case of the model is unknown + * MODEL_USECASE_AGENT: The model maybe used in an agent + * MODEL_USECASE_FINETUNED: The model maybe used for fine tuning + * MODEL_USECASE_KNOWLEDGEBASE: The model maybe used for knowledge bases (embedding models) + * MODEL_USECASE_GUARDRAIL: The model maybe used for guardrails + * MODEL_USECASE_REASONING: The model usecase for reasoning + * MODEL_USECASE_SERVERLESS: The model usecase for serverless inference. Default value is None. + :paramtype usecases: list[str] + :keyword public_only: Only include models that are publicly available. Default value is None. + :paramtype public_only: bool + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + }, + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement Description. + "url": "str", # Optional. Agreement Description. + "uuid": "str" # Optional. Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the model, + this model is based on. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "upload_complete": bool, # Optional. Model has been fully + uploaded. + "url": "str", # Optional. Download url. + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version number. + "minor": 0, # Optional. Minor version number. + "patch": 0 # Optional. Patch version number. + } + } + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_models_request( + usecases=usecases, + public_only=public_only, + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_model_api_keys( + self, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List Model API Keys. + + To list all model API keys, send a GET request to ``/v2/gen-ai/models/api_keys``. + + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted + date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_model_api_keys_request( + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def create_model_api_key( + self, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a Model API Key. + + To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "name": "str" # Optional. A human friendly name to identify the key. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. + "secret_key": "str", # Optional. Model API Key Info. "uuid": "str" # Optional. Uuid. } } @@ -201527,21 +205204,18 @@ async def update_openai_api_key( """ @overload - async def update_openai_api_key( + async def create_model_api_key( self, - api_key_uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update OpenAI API Key. + """Create a Model API Key. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str :param body: Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -201557,58 +205231,11 @@ async def update_openai_api_key( # response body for status code(s): 200 response == { "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } - ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. + "secret_key": "str", # Optional. Model API Key Info. "uuid": "str" # Optional. Uuid. } } @@ -201626,19 +205253,14 @@ async def update_openai_api_key( """ @distributed_trace_async - async def update_openai_api_key( - self, - api_key_uuid: str, - body: Optional[Union[JSON, IO[bytes]]] = None, - **kwargs: Any + async def create_model_api_key( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update OpenAI API Key. + """Create a Model API Key. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] :return: JSON object @@ -201650,66 +205272,17 @@ async def update_openai_api_key( # JSON input template you can fill out and use as your body input. body = { - "api_key": "str", # Optional. OpenAI API key. - "api_key_uuid": "str", # Optional. API key ID. - "name": "str" # Optional. Name of the key. + "name": "str" # Optional. A human friendly name to identify the key. } # response body for status code(s): 200 response == { "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } - ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. + "secret_key": "str", # Optional. Model API Key Info. "uuid": "str" # Optional. Uuid. } } @@ -201757,8 +205330,7 @@ async def update_openai_api_key( else: _json = None - _request = build_genai_update_openai_api_key_request( - api_key_uuid=api_key_uuid, + _request = build_genai_create_model_api_key_request( content_type=content_type, json=_json, content=_content, @@ -201820,16 +205392,27 @@ async def update_openai_api_key( return cast(JSON, deserialized) # type: ignore - @distributed_trace_async - async def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + @overload + async def update_model_api_key( + self, + api_key_uuid: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """Delete OpenAI API Key. + """Update API Key for a Model. - To delete an OpenAI API key, send a DELETE request to - ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. :param api_key_uuid: API key ID. Required. :type api_key_uuid: str + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -201837,62 +205420,10279 @@ async def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "api_key_uuid": "str", # Optional. API key ID. + "name": "str" # Optional. Name. + } + # response body for status code(s): 200 response == { "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Model API Key Info. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def update_model_api_key( + self, + api_key_uuid: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update API Key for a Model. + + To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Model API Key Info. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def update_model_api_key( + self, + api_key_uuid: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update API Key for a Model. + + To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "api_key_uuid": "str", # Optional. API key ID. + "name": "str" # Optional. Name. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Model API Key Info. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_update_model_api_key_request( + api_key_uuid=api_key_uuid, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def delete_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete API Key for a Model. + + To delete an API key for a model, send a DELETE request to + ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + + :param api_key_uuid: API key for an agent. Required. + :type api_key_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Model API Key Info. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_delete_model_api_key_request( + api_key_uuid=api_key_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def regenerate_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Regenerate API Key for a Model. + + To regenerate a model API key, send a PUT request to + ``/v2/gen-ai/models/api_keys/{api_key_uuid}/regenerate``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Model API Key Info. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_regenerate_model_api_key_request( + api_key_uuid=api_key_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_openai_api_keys( + self, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List OpenAI API Keys. + + To list all OpenAI API keys, send a GET request to ``/v2/gen-ai/openai/keys``. + + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", # Optional. Key + creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted + date. + "models": [ + { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last + updated date. + "uuid": "str" # Optional. Uuid. + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_openai_api_keys_request( + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def create_openai_api_key( + self, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create OpenAI API Key. + + To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "api_key": "str", # Optional. OpenAI API key. + "name": "str" # Optional. Name of the key. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def create_openai_api_key( + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create OpenAI API Key. + + To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def create_openai_api_key( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create OpenAI API Key. + + To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "api_key": "str", # Optional. OpenAI API key. + "name": "str" # Optional. Name of the key. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_create_openai_api_key_request( + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get OpenAI API Key. + + To retrieve details of an OpenAI API key, send a GET request to + ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_get_openai_api_key_request( + api_key_uuid=api_key_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def update_openai_api_key( + self, + api_key_uuid: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update OpenAI API Key. + + To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "api_key": "str", # Optional. OpenAI API key. + "api_key_uuid": "str", # Optional. API key ID. + "name": "str" # Optional. Name of the key. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def update_openai_api_key( + self, + api_key_uuid: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update OpenAI API Key. + + To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def update_openai_api_key( + self, + api_key_uuid: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update OpenAI API Key. + + To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "api_key": "str", # Optional. OpenAI API key. + "api_key_uuid": "str", # Optional. API key ID. + "name": "str" # Optional. Name of the key. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_update_openai_api_key_request( + api_key_uuid=api_key_uuid, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete OpenAI API Key. + + To delete an OpenAI API key, send a DELETE request to + ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_delete_openai_api_key_request( + api_key_uuid=api_key_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_agents_by_openai_key( + self, + uuid: str, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List agents by OpenAI key. + + List Agents by OpenAI Key. + + :param uuid: Unique ID of OpenAI key. Required. + :type uuid: str + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # Optional. Key + creation date. + "created_by": "str", # Optional. Created by user id + from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key + deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key + last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api key + infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api key. + } + ], + "chatbot": { + "button_background_color": "str", # Optional. A + Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A Chatbot. + "secondary_color": "str", # Optional. A Chatbot. + "starting_message": "str" # Optional. A Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. Whether + conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. Default + value is "STATUS_UNKNOWN". Known values are: "STATUS_UNKNOWN", + "STATUS_WAITING_FOR_DEPLOYMENT", "STATUS_DEPLOYING", + "STATUS_RUNNING", "STATUS_FAILED", "STATUS_WAITING_FOR_UNDEPLOYMENT", + "STATUS_UNDEPLOYING", "STATUS_UNDEPLOYMENT_FAILED", and + "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your deployed agent + here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # Optional. + Default value is "VISIBILITY_UNKNOWN". * VISIBILITY_UNKNOWN: The + status of the deployment is unknown * VISIBILITY_DISABLED: The + deployment is disabled and will no longer service requests * + VISIBILITY_PLAYGROUND: Deprecated: No longer a valid state * + VISIBILITY_PUBLIC: The deployment is public and will service requests + from the public internet * VISIBILITY_PRIVATE: The deployment is + private and will only service requests from other agents, or through + API keys. Known values are: "VISIBILITY_UNKNOWN", + "VISIBILITY_DISABLED", "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", + and "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of agent. + "functions": [ + { + "api_key": "str", # Optional. Api key. + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "created_by": "str", # Optional. Created by + user id from DO. + "description": "str", # Optional. Agent + description. + "faas_name": "str", # Optional. + "faas_namespace": "str", # Optional. + "input_schema": {}, # Optional. Any object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any object. + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Download your + agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", # + Optional. The guardrails the agent is attached to. + "default_response": "str", # Optional. The + guardrails the agent is attached to. + "description": "str", # Optional. The + guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. The + guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any object. + "name": "str", # Optional. The guardrails + the agent is attached to. + "priority": 0, # Optional. The guardrails + the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known values + are: "GUARDRAIL_TYPE_UNKNOWN", "GUARDRAIL_TYPE_JAILBREAK", + "GUARDRAIL_TYPE_SENSITIVE_DATA", and + "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", # + Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The guardrails the + agent is attached to. + } + ], + "if_case": "str", # Optional. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See `Write + Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 00:00:00", + # Optional. Time when the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "database_id": "str", # Optional. Knowledge + bases. + "embedding_model_uuid": "str", # Optional. + Knowledge bases. + "is_public": bool, # Optional. Whether the + knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # + Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", + # Optional. IndexingJob description. + "knowledge_base_uuid": "str", # + Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", + # Optional. Default value is "BATCH_JOB_PHASE_UNKNOWN". Known + values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", + # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of + tokens. + "total_datasources": 0, # Optional. + Number of datasources being indexed. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge + base. + "project_id": "str", # Optional. Knowledge + bases. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize + related resources. + ], + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "user_id": "str", # Optional. Id of user + that created the knowledge base. + "uuid": "str" # Optional. Unique id for + knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo + project identifier. + "galileo_project_name": "str", # Optional. Name of + the Galileo project. + "log_stream_id": "str", # Optional. Identifier for + the log stream. + "log_stream_name": "str" # Optional. Name of the log + stream. + }, + "max_tokens": 0, # Optional. + "model": { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # Optional. Key + creation date. + "created_by": "str", # Optional. Created by user id + from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key + deleted date. + "models": [ + { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key + last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. + "provide_citations": bool, # Optional. Whether the agent + should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # Optional. + Default value is "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: + The retrieval method is unknown * RETRIEVAL_METHOD_REWRITE: The + retrieval method is rewrite * RETRIEVAL_METHOD_STEP_BACK: The retrieval + method is step back * RETRIEVAL_METHOD_SUB_QUERIES: The retrieval + method is sub queries * RETRIEVAL_METHOD_NONE: The retrieval method is + none. Known values are: "RETRIEVAL_METHOD_UNKNOWN", + "RETRIEVAL_METHOD_REWRITE", "RETRIEVAL_METHOD_STEP_BACK", + "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # Optional. + Creation of route date / time. + "route_created_by": "str", # Optional. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. + "tags": [ + "str" # Optional. Agent tag to organize related + resources. + ], + "temperature": 0.0, # Optional. + "template": { + "created_at": "2020-02-20 00:00:00", # Optional. The + agent template's creation date. + "description": "str", # Optional. Deprecated - Use + summary instead. + "guardrails": [ + { + "priority": 0, # Optional. Priority + of the guardrail. + "uuid": "str" # Optional. Uuid of + the guardrail. + } + ], + "instruction": "str", # Optional. Instructions for + the agent template. + "k": 0, # Optional. The 'k' value for the agent + template. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + List of knowledge bases associated with the agent template. + "embedding_model_uuid": "str", # + Optional. List of knowledge bases associated with the agent + template. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + List of knowledge bases associated with the agent template. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "long_description": "str", # Optional. The long + description of the agent template. + "max_tokens": 0, # Optional. The max_tokens setting + for the agent template. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The short + description of the agent template. + "summary": "str", # Optional. The summary of the + agent template. + "tags": [ + "str" # Optional. List of tags associated + with the agent template. + ], + "temperature": 0.0, # Optional. The temperature + setting for the agent template. + "template_type": "AGENT_TEMPLATE_TYPE_STANDARD", # + Optional. Default value is "AGENT_TEMPLATE_TYPE_STANDARD". * + AGENT_TEMPLATE_TYPE_STANDARD: The standard agent template * + AGENT_TEMPLATE_TYPE_ONE_CLICK: The one click agent template. Known + values are: "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting for the + agent template. + "updated_at": "2020-02-20 00:00:00", # Optional. The + agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "url": "str", # Optional. Access your agent under this url. + "user_id": "str", # Optional. Id of user that created the + agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the + agent. + "workspace": { + "agents": [ + ... + ], + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date. + "created_by": "str", # Optional. The id of user who + created this workspace. + "created_by_email": "str", # Optional. The email of + the user who created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. + Deleted date. + "description": "str", # Optional. Description of the + workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "created_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "created_by_user_email": "str", # + Optional. Evaluations. + "created_by_user_id": "str", # + Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 + 00:00:00", # Optional. Time created at. + "dataset_name": "str", # + Optional. Name of the dataset. + "dataset_uuid": "str", # + Optional. UUID of the dataset. + "file_size": "str", # + Optional. The size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. + Number of rows in the dataset. + }, + "dataset_name": "str", # Optional. + Evaluations. + "dataset_uuid": "str", # Optional. + Evaluations. + "description": "str", # Optional. + Evaluations. + "latest_version_number_of_runs": 0, + # Optional. Evaluations. + "metrics": [ + { + "description": "str", + # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning + that a lower value is better. + "metric_name": "str", + # Optional. Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", + "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", + # Optional. Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default + value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # + Optional. The minimum value for the metric. + } + ], + "name": "str", # Optional. + Evaluations. + "star_metric": { + "metric_uuid": "str", # + Optional. Evaluations. + "name": "str", # Optional. + Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This + is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # + Optional. The success threshold for the star metric. This + is a percentage value between 0 and 100. + }, + "test_case_uuid": "str", # Optional. + Evaluations. + "total_runs": 0, # Optional. + Evaluations. + "updated_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "updated_by_user_email": "str", # + Optional. Evaluations. + "updated_by_user_id": "str", # + Optional. Evaluations. + "version": 0 # Optional. + Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. + Update date. + "uuid": "str" # Optional. Unique id. + } + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_agents_by_openai_key_request( + uuid=uuid, + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_datacenter_regions( + self, + *, + serves_inference: Optional[bool] = None, + serves_batch: Optional[bool] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List Datacenter Regions. + + To list all datacenter regions, send a GET request to ``/v2/gen-ai/regions``. + + :keyword serves_inference: Include datacenters that serve inference. Default value is None. + :paramtype serves_inference: bool + :keyword serves_batch: Include datacenters that are capable of running batch jobs. Default + value is None. + :paramtype serves_batch: bool + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "regions": [ + { + "inference_url": "str", # Optional. Url for inference + server. + "region": "str", # Optional. Region code. + "serves_batch": bool, # Optional. This datacenter is capable + of running batch jobs. + "serves_inference": bool, # Optional. This datacenter is + capable of serving inference. + "stream_inference_url": "str" # Optional. The url for the + inference streaming server. + } + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_datacenter_regions_request( + serves_inference=serves_inference, + serves_batch=serves_batch, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_workspaces(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """List Workspaces. + + To list all workspaces, send a GET request to ``/v2/gen-ai/workspaces``. + + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "workspaces": [ + { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", + # Optional. Key creation date. + "created_by": "str", # Optional. + Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", + # Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date. + "created_by": "str", # + Optional. Created by. + "deleted_at": "2020-02-20 + 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. + Name. + "secret_key": "str", # + Optional. Api key infos. + "uuid": "str" # Optional. + Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. + Api key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A + Chatbot. + "name": "str", # Optional. Name of + chatbot. + "primary_color": "str", # Optional. + A Chatbot. + "secondary_color": "str", # + Optional. A Chatbot. + "starting_message": "str" # + Optional. A Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": + "str" # Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # + Optional. Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # + Optional. Default value is "STATUS_UNKNOWN". Known values + are: "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Access + your deployed agent here. + "uuid": "str", # Optional. Unique + id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown + * VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: + Deprecated: No longer a valid state * VISIBILITY_PUBLIC: + The deployment is public and will service requests from the + public internet * VISIBILITY_PRIVATE: The deployment is + private and will only service requests from other agents, or + through API keys. Known values are: "VISIBILITY_UNKNOWN", + "VISIBILITY_DISABLED", "VISIBILITY_PLAYGROUND", + "VISIBILITY_PUBLIC", and "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. + Description of agent. + "functions": [ + { + "api_key": "str", # + Optional. Api key. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "created_by": "str", # + Optional. Created by user id from DO. + "description": "str", # + Optional. Agent description. + "faas_name": "str", # + Optional. Agents. + "faas_namespace": "str", # + Optional. Agents. + "input_schema": {}, # + Optional. Any object. + "name": "str", # Optional. + Name. + "output_schema": {}, # + Optional. Any object. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "url": "str", # Optional. + Download your agent here. + "uuid": "str" # Optional. + Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # + Optional. The guardrails the agent is attached to. + "created_at": "2020-02-20 + 00:00:00", # Optional. The guardrails the agent is + attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # + Optional. The guardrails the agent is attached to. + "guardrail_uuid": "str", # + Optional. The guardrails the agent is attached to. + "is_attached": bool, # + Optional. The guardrails the agent is attached to. + "is_default": bool, # + Optional. The guardrails the agent is attached to. + "metadata": {}, # Optional. + Any object. + "name": "str", # Optional. + The guardrails the agent is attached to. + "priority": 0, # Optional. + The guardrails the agent is attached to. + "type": + "GUARDRAIL_TYPE_UNKNOWN", # Optional. Default value is + "GUARDRAIL_TYPE_UNKNOWN". Known values are: + "GUARDRAIL_TYPE_UNKNOWN", "GUARDRAIL_TYPE_JAILBREAK", + "GUARDRAIL_TYPE_SENSITIVE_DATA", and + "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 + 00:00:00", # Optional. The guardrails the agent is + attached to. + "uuid": "str" # Optional. + The guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent + instruction. Instructions help your agent to perform its job + effectively. See `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. Knowledge bases. + "embedding_model_uuid": + "str", # Optional. Knowledge bases. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. Knowledge bases. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # + Optional. Galileo project identifier. + "galileo_project_name": "str", # + Optional. Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. + Name of the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", + # Optional. Key creation date. + "created_by": "str", # Optional. + Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": + "str", # Optional. Agreement Description. + "url": "str", + # Optional. Agreement Description. + "uuid": "str" + # Optional. Agreement Description. + }, + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "inference_name": + "str", # Optional. Internally used name. + "inference_version": + "str", # Optional. Internally used version. + "is_foundational": + bool, # Optional. True if it is a foundational model + provided by do. + "metadata": {}, # + Optional. Additional meta data. + "name": "str", # + Optional. Name of the model. + "parent_uuid": "str", + # Optional. Unique id of the model, this model is + based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default + value is "MODEL_PROVIDER_DIGITALOCEAN". Known values + are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and + "MODEL_PROVIDER_OPENAI". + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "upload_complete": + bool, # Optional. Model has been fully uploaded. + "url": "str", # + Optional. Download url. + "usecases": [ + "str" # + Optional. Usecases of the model. + ], + "uuid": "str", # + Optional. Unique id. + "version": { + "major": 0, + # Optional. Major version number. + "minor": 0, + # Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", + # Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. + Whether the agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": + "RETRIEVAL_METHOD_UNKNOWN", # Optional. Default value is + "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: The + retrieval method is unknown * RETRIEVAL_METHOD_REWRITE: The + retrieval method is rewrite * RETRIEVAL_METHOD_STEP_BACK: The + retrieval method is step back * RETRIEVAL_METHOD_SUB_QUERIES: + The retrieval method is sub queries * RETRIEVAL_METHOD_NONE: + The retrieval method is none. Known values are: + "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. + Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to + organize related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", + # Optional. The agent template's creation date. + "description": "str", # Optional. + Deprecated - Use summary instead. + "guardrails": [ + { + "priority": 0, # + Optional. Priority of the guardrail. + "uuid": "str" # + Optional. Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value + for the agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", + # Optional. List of knowledge bases associated with + the agent template. + "embedding_model_uuid": "str", # Optional. List of + knowledge bases associated with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or + not. + "last_indexing_job": + { + "completed_datasources": 0, # Optional. Number + of datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date + / time. + "data_source_uuids": [ + "str" + # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # + Optional. IndexingJob description. + "knowledge_base_uuid": "str", # Optional. + Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values + are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, + # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of + datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" + # Optional. Unique id. + }, + "name": "str", # + Optional. Name of knowledge base. + "project_id": "str", + # Optional. List of knowledge bases associated with + the agent template. + "region": "str", # + Optional. Region code. + "tags": [ + "str" # + Optional. Tags to organize related resources. + ], + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # + Optional. Unique id for knowledge base. + } + ], + "long_description": "str", # + Optional. The long description of the agent template. + "max_tokens": 0, # Optional. The + max_tokens setting for the agent template. + "model": { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + }, + "name": "str", # Optional. Name of + the agent template. + "short_description": "str", # + Optional. The short description of the agent template. + "summary": "str", # Optional. The + summary of the agent template. + "tags": [ + "str" # Optional. List of + tags associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * + AGENT_TEMPLATE_TYPE_STANDARD: The standard agent template + * AGENT_TEMPLATE_TYPE_ONE_CLICK: The one click agent + template. Known values are: "AGENT_TEMPLATE_TYPE_STANDARD" + and "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p + setting for the agent template. + "updated_at": "2020-02-20 00:00:00", + # Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your agent + under this url. + "user_id": "str", # Optional. Id of user + that created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The + latest version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date. + "created_by": "str", # Optional. The id of user who created + this workspace. + "created_by_email": "str", # Optional. The email of the user + who created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted + date. + "description": "str", # Optional. Description of the + workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # + Optional. Evaluations. + "created_at": "2020-02-20 00:00:00", # + Optional. Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, + "dataset_name": "str", # Optional. + Evaluations. + "dataset_uuid": "str", # Optional. + Evaluations. + "description": "str", # Optional. + Evaluations. + "latest_version_number_of_runs": 0, # + Optional. Evaluations. + "metrics": [ + { + "description": "str", # + Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. + "metric_name": "str", # + Optional. Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", + and "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # + Optional. Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default + value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values + are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. + Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # + Optional. The success threshold for the star metric. This is + a percentage value between 0 and 100. + }, + "test_case_uuid": "str", # Optional. + Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # + Optional. Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update + date. + "uuid": "str" # Optional. Unique id. + } + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_workspaces_request( + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def create_workspace( + self, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a Workspace. + + To create a new workspace, send a POST request to ``/v2/gen-ai/workspaces``. The response body + contains a JSON object with the newly created workspace object. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Ids of the agents(s) to attach to the workspace. + ], + "description": "str", # Optional. Description of the workspace. + "name": "str" # Optional. Name of the workspace. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def create_workspace( + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a Workspace. + + To create a new workspace, send a POST request to ``/v2/gen-ai/workspaces``. The response body + contains a JSON object with the newly created workspace object. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def create_workspace( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a Workspace. + + To create a new workspace, send a POST request to ``/v2/gen-ai/workspaces``. The response body + contains a JSON object with the newly created workspace object. + + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Ids of the agents(s) to attach to the workspace. + ], + "description": "str", # Optional. Description of the workspace. + "name": "str" # Optional. Name of the workspace. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_create_workspace_request( + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_workspace(self, workspace_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve an Existing Workspace. + + To retrieve details of a workspace, GET request to ``/v2/gen-ai/workspaces/{workspace_uuid}``. + The response body is a JSON object containing the workspace. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_get_workspace_request( + workspace_uuid=workspace_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def update_workspace( + self, + workspace_uuid: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update a Workspace. + + To update a workspace, send a PUT request to ``/v2/gen-ai/workspaces/{workspace_uuid}``. The + response body is a JSON object containing the workspace. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "description": "str", # Optional. The new description of the workspace. + "name": "str", # Optional. The new name of the workspace. + "workspace_uuid": "str" # Optional. Workspace UUID. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def update_workspace( + self, + workspace_uuid: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update a Workspace. + + To update a workspace, send a PUT request to ``/v2/gen-ai/workspaces/{workspace_uuid}``. The + response body is a JSON object containing the workspace. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def update_workspace( + self, + workspace_uuid: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update a Workspace. + + To update a workspace, send a PUT request to ``/v2/gen-ai/workspaces/{workspace_uuid}``. The + response body is a JSON object containing the workspace. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "description": "str", # Optional. The new description of the workspace. + "name": "str", # Optional. The new name of the workspace. + "workspace_uuid": "str" # Optional. Workspace UUID. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_update_workspace_request( + workspace_uuid=workspace_uuid, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def delete_workspace(self, workspace_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete a Workspace. + + To delete a workspace, send a DELETE request to ``/v2/gen-ai/workspace/{workspace_uuid}``. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "workspace_uuid": "str" # Optional. Workspace. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_delete_workspace_request( + workspace_uuid=workspace_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_agents_by_workspace( + self, + workspace_uuid: str, + *, + only_deployed: Optional[bool] = None, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List agents by Workspace. + + To list all agents by a Workspace, send a GET request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/agents``. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :keyword only_deployed: Only list agents that are deployed. Default value is None. + :paramtype only_deployed: bool + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # Optional. Key + creation date. + "created_by": "str", # Optional. Created by user id + from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key + deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key + last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api key + infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api key. + } + ], + "chatbot": { + "button_background_color": "str", # Optional. A + Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A Chatbot. + "secondary_color": "str", # Optional. A Chatbot. + "starting_message": "str" # Optional. A Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. Whether + conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. Default + value is "STATUS_UNKNOWN". Known values are: "STATUS_UNKNOWN", + "STATUS_WAITING_FOR_DEPLOYMENT", "STATUS_DEPLOYING", + "STATUS_RUNNING", "STATUS_FAILED", "STATUS_WAITING_FOR_UNDEPLOYMENT", + "STATUS_UNDEPLOYING", "STATUS_UNDEPLOYMENT_FAILED", and + "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your deployed agent + here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # Optional. + Default value is "VISIBILITY_UNKNOWN". * VISIBILITY_UNKNOWN: The + status of the deployment is unknown * VISIBILITY_DISABLED: The + deployment is disabled and will no longer service requests * + VISIBILITY_PLAYGROUND: Deprecated: No longer a valid state * + VISIBILITY_PUBLIC: The deployment is public and will service requests + from the public internet * VISIBILITY_PRIVATE: The deployment is + private and will only service requests from other agents, or through + API keys. Known values are: "VISIBILITY_UNKNOWN", + "VISIBILITY_DISABLED", "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", + and "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of agent. + "functions": [ + { + "api_key": "str", # Optional. Api key. + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "created_by": "str", # Optional. Created by + user id from DO. + "description": "str", # Optional. Agent + description. + "faas_name": "str", # Optional. + "faas_namespace": "str", # Optional. + "input_schema": {}, # Optional. Any object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any object. + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Download your + agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", # + Optional. The guardrails the agent is attached to. + "default_response": "str", # Optional. The + guardrails the agent is attached to. + "description": "str", # Optional. The + guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. The + guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any object. + "name": "str", # Optional. The guardrails + the agent is attached to. + "priority": 0, # Optional. The guardrails + the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known values + are: "GUARDRAIL_TYPE_UNKNOWN", "GUARDRAIL_TYPE_JAILBREAK", + "GUARDRAIL_TYPE_SENSITIVE_DATA", and + "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", # + Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The guardrails the + agent is attached to. + } + ], + "if_case": "str", # Optional. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See `Write + Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 00:00:00", + # Optional. Time when the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "database_id": "str", # Optional. Knowledge + bases. + "embedding_model_uuid": "str", # Optional. + Knowledge bases. + "is_public": bool, # Optional. Whether the + knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # + Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", + # Optional. IndexingJob description. + "knowledge_base_uuid": "str", # + Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", + # Optional. Default value is "BATCH_JOB_PHASE_UNKNOWN". Known + values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", + # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of + tokens. + "total_datasources": 0, # Optional. + Number of datasources being indexed. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge + base. + "project_id": "str", # Optional. Knowledge + bases. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize + related resources. + ], + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "user_id": "str", # Optional. Id of user + that created the knowledge base. + "uuid": "str" # Optional. Unique id for + knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo + project identifier. + "galileo_project_name": "str", # Optional. Name of + the Galileo project. + "log_stream_id": "str", # Optional. Identifier for + the log stream. + "log_stream_name": "str" # Optional. Name of the log + stream. + }, + "max_tokens": 0, # Optional. + "model": { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # Optional. Key + creation date. + "created_by": "str", # Optional. Created by user id + from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key + deleted date. + "models": [ + { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key + last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. + "provide_citations": bool, # Optional. Whether the agent + should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # Optional. + Default value is "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: + The retrieval method is unknown * RETRIEVAL_METHOD_REWRITE: The + retrieval method is rewrite * RETRIEVAL_METHOD_STEP_BACK: The retrieval + method is step back * RETRIEVAL_METHOD_SUB_QUERIES: The retrieval + method is sub queries * RETRIEVAL_METHOD_NONE: The retrieval method is + none. Known values are: "RETRIEVAL_METHOD_UNKNOWN", + "RETRIEVAL_METHOD_REWRITE", "RETRIEVAL_METHOD_STEP_BACK", + "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # Optional. + Creation of route date / time. + "route_created_by": "str", # Optional. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. + "tags": [ + "str" # Optional. Agent tag to organize related + resources. + ], + "temperature": 0.0, # Optional. + "template": { + "created_at": "2020-02-20 00:00:00", # Optional. The + agent template's creation date. + "description": "str", # Optional. Deprecated - Use + summary instead. + "guardrails": [ + { + "priority": 0, # Optional. Priority + of the guardrail. + "uuid": "str" # Optional. Uuid of + the guardrail. + } + ], + "instruction": "str", # Optional. Instructions for + the agent template. + "k": 0, # Optional. The 'k' value for the agent + template. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + List of knowledge bases associated with the agent template. + "embedding_model_uuid": "str", # + Optional. List of knowledge bases associated with the agent + template. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + List of knowledge bases associated with the agent template. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "long_description": "str", # Optional. The long + description of the agent template. + "max_tokens": 0, # Optional. The max_tokens setting + for the agent template. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The short + description of the agent template. + "summary": "str", # Optional. The summary of the + agent template. + "tags": [ + "str" # Optional. List of tags associated + with the agent template. + ], + "temperature": 0.0, # Optional. The temperature + setting for the agent template. + "template_type": "AGENT_TEMPLATE_TYPE_STANDARD", # + Optional. Default value is "AGENT_TEMPLATE_TYPE_STANDARD". * + AGENT_TEMPLATE_TYPE_STANDARD: The standard agent template * + AGENT_TEMPLATE_TYPE_ONE_CLICK: The one click agent template. Known + values are: "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting for the + agent template. + "updated_at": "2020-02-20 00:00:00", # Optional. The + agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "url": "str", # Optional. Access your agent under this url. + "user_id": "str", # Optional. Id of user that created the + agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the + agent. + "workspace": { + "agents": [ + ... + ], + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date. + "created_by": "str", # Optional. The id of user who + created this workspace. + "created_by_email": "str", # Optional. The email of + the user who created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. + Deleted date. + "description": "str", # Optional. Description of the + workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "created_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "created_by_user_email": "str", # + Optional. Evaluations. + "created_by_user_id": "str", # + Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 + 00:00:00", # Optional. Time created at. + "dataset_name": "str", # + Optional. Name of the dataset. + "dataset_uuid": "str", # + Optional. UUID of the dataset. + "file_size": "str", # + Optional. The size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. + Number of rows in the dataset. + }, + "dataset_name": "str", # Optional. + Evaluations. + "dataset_uuid": "str", # Optional. + Evaluations. + "description": "str", # Optional. + Evaluations. + "latest_version_number_of_runs": 0, + # Optional. Evaluations. + "metrics": [ + { + "description": "str", + # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning + that a lower value is better. + "metric_name": "str", + # Optional. Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", + "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", + # Optional. Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default + value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # + Optional. The minimum value for the metric. + } + ], + "name": "str", # Optional. + Evaluations. + "star_metric": { + "metric_uuid": "str", # + Optional. Evaluations. + "name": "str", # Optional. + Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This + is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # + Optional. The success threshold for the star metric. This + is a percentage value between 0 and 100. + }, + "test_case_uuid": "str", # Optional. + Evaluations. + "total_runs": 0, # Optional. + Evaluations. + "updated_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "updated_by_user_email": "str", # + Optional. Evaluations. + "updated_by_user_id": "str", # + Optional. Evaluations. + "version": 0 # Optional. + Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. + Update date. + "uuid": "str" # Optional. Unique id. + } + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_agents_by_workspace_request( + workspace_uuid=workspace_uuid, + only_deployed=only_deployed, + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def update_agents_workspace( + self, + workspace_uuid: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Move Agents to a Workspace. + + To move all listed agents a given workspace, send a PUT request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/agents``. + + :param workspace_uuid: Workspace uuid to move agents to. Required. + :type workspace_uuid: str + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Agent uuids. + ], + "workspace_uuid": "str" # Optional. Workspace uuid to move agents to. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "top_p": 0.0, # Optional. Agents. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... } ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. - "uuid": "str" # Optional. Uuid. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -201907,104 +215707,29 @@ async def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_genai_delete_openai_api_key_request( - api_key_uuid=api_key_uuid, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) # type: ignore - - @distributed_trace_async - async def list_agents_by_openai_key( + @overload + async def update_agents_workspace( self, - uuid: str, + workspace_uuid: str, + body: Optional[IO[bytes]] = None, *, - page: Optional[int] = None, - per_page: Optional[int] = None, + content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """List agents by OpenAI key. + """Move Agents to a Workspace. - List Agents by OpenAI Key. + To move all listed agents a given workspace, send a PUT request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/agents``. - :param uuid: Unique ID of OpenAI key. Required. - :type uuid: str - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int + :param workspace_uuid: Workspace uuid to move agents to. Required. + :type workspace_uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -202014,259 +215739,487 @@ async def list_agents_by_openai_key( # response body for status code(s): 200 response == { - "agents": [ - { - "anthropic_api_key": { - "created_at": "2020-02-20 00:00:00", # Optional. Key - creation date. - "created_by": "str", # Optional. Created by user id - from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key - deleted date. - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key - last updated date. - "uuid": "str" # Optional. Uuid. - }, - "api_key_infos": [ - { + "workspace": { + "agents": [ + { + "anthropic_api_key": { "created_at": "2020-02-20 00:00:00", # - Optional. Creation date. - "created_by": "str", # Optional. Created by. + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. "deleted_at": "2020-02-20 00:00:00", # - Optional. Deleted date. + Optional. Key deleted date. "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Api key - infos. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. "uuid": "str" # Optional. Uuid. - } - ], - "api_keys": [ - { - "api_key": "str" # Optional. Api key. - } - ], - "chatbot": { - "button_background_color": "str", # Optional. A - Chatbot. - "logo": "str", # Optional. A Chatbot. - "name": "str", # Optional. Name of chatbot. - "primary_color": "str", # Optional. A Chatbot. - "secondary_color": "str", # Optional. A Chatbot. - "starting_message": "str" # Optional. A Chatbot. - }, - "chatbot_identifiers": [ - { - "agent_chatbot_identifier": "str" # - Optional. Agent chatbot identifier. - } - ], - "child_agents": [ - ... - ], - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "deployment": { + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "name": "str", # Optional. Name. - "status": "STATUS_UNKNOWN", # Optional. Default - value is "STATUS_UNKNOWN". Known values are: "STATUS_UNKNOWN", - "STATUS_WAITING_FOR_DEPLOYMENT", "STATUS_DEPLOYING", - "STATUS_RUNNING", "STATUS_FAILED", "STATUS_WAITING_FOR_UNDEPLOYMENT", - "STATUS_UNDEPLOYING", "STATUS_UNDEPLOYMENT_FAILED", and - "STATUS_DELETED". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "url": "str", # Optional. Access your deployed agent - here. - "uuid": "str", # Optional. Unique id. - "visibility": "VISIBILITY_UNKNOWN" # Optional. - Default value is "VISIBILITY_UNKNOWN". * VISIBILITY_UNKNOWN: The - status of the deployment is unknown * VISIBILITY_DISABLED: The - deployment is disabled and will no longer service requests * - VISIBILITY_PLAYGROUND: Deprecated: No longer a valid state * - VISIBILITY_PUBLIC: The deployment is public and will service requests - from the public internet * VISIBILITY_PRIVATE: The deployment is - private and will only service requests from other agents, or through - API keys. Known values are: "VISIBILITY_UNKNOWN", - "VISIBILITY_DISABLED", "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", - and "VISIBILITY_PRIVATE". - }, - "description": "str", # Optional. Description of agent. - "functions": [ - { - "api_key": "str", # Optional. Api key. + "deployment": { "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "created_by": "str", # Optional. Created by - user id from DO. - "description": "str", # Optional. Agent - description. - "faas_name": "str", # Optional. - "faas_namespace": "str", # Optional. - "input_schema": {}, # Optional. Any object. "name": "str", # Optional. Name. - "output_schema": {}, # Optional. Any object. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "url": "str", # Optional. Download your - agent here. - "uuid": "str" # Optional. Unique id. - } - ], - "guardrails": [ - { - "agent_uuid": "str", # Optional. The - guardrails the agent is attached to. - "created_at": "2020-02-20 00:00:00", # - Optional. The guardrails the agent is attached to. - "default_response": "str", # Optional. The - guardrails the agent is attached to. - "description": "str", # Optional. The - guardrails the agent is attached to. - "guardrail_uuid": "str", # Optional. The - guardrails the agent is attached to. - "is_attached": bool, # Optional. The - guardrails the agent is attached to. - "is_default": bool, # Optional. The - guardrails the agent is attached to. - "metadata": {}, # Optional. Any object. - "name": "str", # Optional. The guardrails - the agent is attached to. - "priority": 0, # Optional. The guardrails - the agent is attached to. - "type": "GUARDRAIL_TYPE_UNKNOWN", # - Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known values - are: "GUARDRAIL_TYPE_UNKNOWN", "GUARDRAIL_TYPE_JAILBREAK", - "GUARDRAIL_TYPE_SENSITIVE_DATA", and - "GUARDRAIL_TYPE_CONTENT_MODERATION". - "updated_at": "2020-02-20 00:00:00", # - Optional. The guardrails the agent is attached to. - "uuid": "str" # Optional. The guardrails the - agent is attached to. - } - ], - "if_case": "str", # Optional. - "instruction": "str", # Optional. Agent instruction. - Instructions help your agent to perform its job effectively. See `Write - Effective Agent Instructions - `_ - for best practices. - "k": 0, # Optional. - "knowledge_bases": [ - { - "added_to_agent_at": "2020-02-20 00:00:00", - # Optional. Time when the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # - Optional. Creation date / time. - "database_id": "str", # Optional. Knowledge - bases. - "embedding_model_uuid": "str", # Optional. - Knowledge bases. - "is_public": bool, # Optional. Whether the - knowledge base is public or not. - "last_indexing_job": { - "completed_datasources": 0, # - Optional. Number of datasources indexed completed. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "data_source_uuids": [ - "str" # Optional. - IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", - # Optional. IndexingJob description. - "knowledge_base_uuid": "str", # - Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", - # Optional. Default value is "BATCH_JOB_PHASE_UNKNOWN". Known - values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", - # Optional. IndexingJob description. - "tokens": 0, # Optional. Number of - tokens. - "total_datasources": 0, # Optional. - Number of datasources being indexed. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. }, - "name": "str", # Optional. Name of knowledge - base. - "project_id": "str", # Optional. Knowledge - bases. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. - ], + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user - that created the knowledge base. - "uuid": "str" # Optional. Unique id for - knowledge base. - } - ], - "max_tokens": 0, # Optional. - "model": { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - }, - "name": "str", # Optional. Agent name. - "openai_api_key": { - "created_at": "2020-02-20 00:00:00", # Optional. Key - creation date. - "created_by": "str", # Optional. Created by user id - from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key - deleted date. - "models": [ - { + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { "agreement": { "description": "str", # Optional. Agreement Description. @@ -202316,57 +216269,340 @@ async def list_agents_by_openai_key( "patch": 0 # Optional. Patch version number. } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def update_agents_workspace( + self, + workspace_uuid: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Move Agents to a Workspace. + + To move all listed agents a given workspace, send a PUT request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/agents``. + + :param workspace_uuid: Workspace uuid to move agents to. Required. + :type workspace_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Agent uuids. + ], + "workspace_uuid": "str" # Optional. Workspace uuid to move agents to. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. } ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key - last updated date. - "uuid": "str" # Optional. Uuid. - }, - "parent_agents": [ - ... - ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. - "provide_citations": bool, # Optional. Whether the agent - should provide in-response citations. - "region": "str", # Optional. Region code. - "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # Optional. - Default value is "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: - The retrieval method is unknown * RETRIEVAL_METHOD_REWRITE: The - retrieval method is rewrite * RETRIEVAL_METHOD_STEP_BACK: The retrieval - method is step back * RETRIEVAL_METHOD_SUB_QUERIES: The retrieval - method is sub queries * RETRIEVAL_METHOD_NONE: The retrieval method is - none. Known values are: "RETRIEVAL_METHOD_UNKNOWN", - "RETRIEVAL_METHOD_REWRITE", "RETRIEVAL_METHOD_STEP_BACK", - "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". - "route_created_at": "2020-02-20 00:00:00", # Optional. - Creation of route date / time. - "route_created_by": "str", # Optional. - "route_name": "str", # Optional. Route name. - "route_uuid": "str", # Optional. - "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "temperature": 0.0, # Optional. - "template": { - "created_at": "2020-02-20 00:00:00", # Optional. The - agent template's creation date. - "description": "str", # Optional. Deprecated - Use - summary instead. - "guardrails": [ + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ { - "priority": 0, # Optional. Priority - of the guardrail. - "uuid": "str" # Optional. Uuid of - the guardrail. + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. } ], - "instruction": "str", # Optional. Instructions for - the agent template. - "k": 0, # Optional. The 'k' value for the agent - template. + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. "knowledge_bases": [ { "added_to_agent_at": "2020-02-20 @@ -202375,10 +216611,9 @@ async def list_agents_by_openai_key( "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "database_id": "str", # Optional. - List of knowledge bases associated with the agent template. + Knowledge bases. "embedding_model_uuid": "str", # - Optional. List of knowledge bases associated with the agent - template. + Optional. Knowledge bases. "is_public": bool, # Optional. Whether the knowledge base is public or not. "last_indexing_job": { @@ -202403,6 +216638,14 @@ async def list_agents_by_openai_key( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # @@ -202415,13 +216658,12 @@ async def list_agents_by_openai_key( "name": "str", # Optional. Name of knowledge base. "project_id": "str", # Optional. - List of knowledge bases associated with the agent template. + Knowledge bases. "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to - organize related resources.:code:`
`Requires - ``tag:read`` scope. + organize related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -202431,10 +216673,17 @@ async def list_agents_by_openai_key( for knowledge base. } ], - "long_description": "str", # Optional. The long - description of the agent template. - "max_tokens": 0, # Optional. The max_tokens setting - for the agent template. + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. "model": { "agreement": { "description": "str", # Optional. @@ -202483,135 +216732,380 @@ async def list_agents_by_openai_key( number. } }, - "name": "str", # Optional. Name of the agent - template. - "short_description": "str", # Optional. The short - description of the agent template. - "summary": "str", # Optional. The summary of the - agent template. - "tags": [ - "str" # Optional. List of tags associated - with the agent template. - ], - "temperature": 0.0, # Optional. The temperature - setting for the agent template. - "template_type": "AGENT_TEMPLATE_TYPE_STANDARD", # - Optional. Default value is "AGENT_TEMPLATE_TYPE_STANDARD". * - AGENT_TEMPLATE_TYPE_STANDARD: The standard agent template * - AGENT_TEMPLATE_TYPE_ONE_CLICK: The one click agent template. Known - values are: "AGENT_TEMPLATE_TYPE_STANDARD" and - "AGENT_TEMPLATE_TYPE_ONE_CLICK". - "top_p": 0.0, # Optional. The top_p setting for the - agent template. - "updated_at": "2020-02-20 00:00:00", # Optional. The - agent template's last updated date. - "uuid": "str" # Optional. Unique id. - }, - "top_p": 0.0, # Optional. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "url": "str", # Optional. Access your agent under this url. - "user_id": "str", # Optional. Id of user that created the - agent. - "uuid": "str", # Optional. Unique agent id. - "workspace": { - "agents": [ + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ ... ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. "created_at": "2020-02-20 00:00:00", # Optional. - Creation date. - "created_by": "str", # Optional. The id of user who - created this workspace. - "created_by_email": "str", # Optional. The email of - the user who created this workspace. - "deleted_at": "2020-02-20 00:00:00", # Optional. - Deleted date. - "description": "str", # Optional. Description of the - workspace. - "evaluation_test_cases": [ + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ { - "archived_at": "2020-02-20 00:00:00", - # Optional. Evaluations. - "created_at": "2020-02-20 00:00:00", - # Optional. Evaluations. - "created_by_user_email": "str", # - Optional. Evaluations. - "created_by_user_id": "str", # - Optional. Evaluations. - "dataset_name": "str", # Optional. - Evaluations. - "dataset_uuid": "str", # Optional. - Evaluations. "description": "str", # Optional. Evaluations. - "latest_version_number_of_runs": 0, - # Optional. Evaluations. - "metrics": [ - { - "description": "str", - # Optional. Evaluations. - "metric_name": "str", - # Optional. Evaluations. - "metric_type": - "METRIC_TYPE_UNSPECIFIED", # Optional. Default value - is "METRIC_TYPE_UNSPECIFIED". Known values are: - "METRIC_TYPE_UNSPECIFIED", - "METRIC_TYPE_GENERAL_QUALITY", and - "METRIC_TYPE_RAG_AND_TOOL". - "metric_uuid": "str", - # Optional. Evaluations. - "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default - value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known - values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". - } - ], - "name": "str", # Optional. - Evaluations. - "star_metric": { - "metric_uuid": "str", # - Optional. Evaluations. - "name": "str", # Optional. - Evaluations. - "success_threshold_pct": 0 # - Optional. The success threshold for the star metric. This - is a percentage value between 0 and 100. - }, - "test_case_uuid": "str", # Optional. - Evaluations. - "total_runs": 0, # Optional. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. Evaluations. - "updated_at": "2020-02-20 00:00:00", - # Optional. Evaluations. - "updated_by_user_email": "str", # - Optional. Evaluations. - "updated_by_user_id": "str", # - Optional. Evaluations. - "version": 0 # Optional. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. Evaluations. - } - ], - "name": "str", # Optional. Name of the workspace. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. "updated_at": "2020-02-20 00:00:00", # Optional. - Update date. - "uuid": "str" # Optional. Unique id. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. } - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. - } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -202639,15 +217133,30 @@ async def list_agents_by_openai_key( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_agents_by_openai_key_request( - uuid=uuid, - page=page, - per_page=per_page, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_update_agents_workspace_request( + workspace_uuid=workspace_uuid, + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -202707,23 +217216,17 @@ async def list_agents_by_openai_key( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def list_datacenter_regions( - self, - *, - serves_inference: Optional[bool] = None, - serves_batch: Optional[bool] = None, - **kwargs: Any + async def list_evaluation_test_cases_by_workspace( + self, workspace_uuid: str, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """List Datacenter Regions. + """List Evaluation Test Cases by Workspace. - To list all datacenter regions, send a GET request to ``/v2/gen-ai/regions``. + To list all evaluation test cases by a workspace, send a GET request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/evaluation_test_cases``. - :keyword serves_inference: Include datacenters that serve inference. Default value is None. - :paramtype serves_inference: bool - :keyword serves_batch: Include datacenters that are capable of running batch jobs. Default - value is None. - :paramtype serves_batch: bool + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -202733,17 +217236,69 @@ async def list_datacenter_regions( # response body for status code(s): 200 response == { - "regions": [ + "evaluation_test_cases": [ { - "inference_url": "str", # Optional. Url for inference - server. - "region": "str", # Optional. Region code. - "serves_batch": bool, # Optional. This datacenter is capable - of running batch jobs. - "serves_inference": bool, # Optional. This datacenter is - capable of serving inference. - "stream_inference_url": "str" # Optional. The url for the - inference streaming server. + "archived_at": "2020-02-20 00:00:00", # Optional. + "created_at": "2020-02-20 00:00:00", # Optional. + "created_by_user_email": "str", # Optional. + "created_by_user_id": "str", # Optional. + "dataset": { + "created_at": "2020-02-20 00:00:00", # Optional. + Time created at. + "dataset_name": "str", # Optional. Name of the + dataset. + "dataset_uuid": "str", # Optional. UUID of the + dataset. + "file_size": "str", # Optional. The size of the + dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does the + dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in the + dataset. + }, + "dataset_name": "str", # Optional. + "dataset_uuid": "str", # Optional. + "description": "str", # Optional. + "latest_version_number_of_runs": 0, # Optional. + "metrics": [ + { + "description": "str", # Optional. + "inverted": bool, # Optional. If true, the + metric is inverted, meaning that a lower value is better. + "metric_name": "str", # Optional. + "metric_type": "METRIC_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_TYPE_UNSPECIFIED". Known + values are: "METRIC_TYPE_UNSPECIFIED", + "METRIC_TYPE_GENERAL_QUALITY", and "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The maximum + value for the metric. + "range_min": 0.0 # Optional. The minimum + value for the metric. + } + ], + "name": "str", # Optional. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success + threshold for the star metric. This is a value that the metric must + reach to be considered successful. + "success_threshold_pct": 0 # Optional. The success + threshold for the star metric. This is a percentage value between 0 + and 100. + }, + "test_case_uuid": "str", # Optional. + "total_runs": 0, # Optional. + "updated_at": "2020-02-20 00:00:00", # Optional. + "updated_by_user_email": "str", # Optional. + "updated_by_user_id": "str", # Optional. + "version": 0 # Optional. } ] } @@ -202777,9 +217332,8 @@ async def list_datacenter_regions( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_datacenter_regions_request( - serves_inference=serves_inference, - serves_batch=serves_batch, + _request = build_genai_list_evaluation_test_cases_by_workspace_request( + workspace_uuid=workspace_uuid, headers=_headers, params=_params, ) diff --git a/src/pydo/operations/_operations.py b/src/pydo/operations/_operations.py index 00fcb8c..e7844dc 100644 --- a/src/pydo/operations/_operations.py +++ b/src/pydo/operations/_operations.py @@ -11177,6 +11177,311 @@ def build_genai_list_agents_by_anthropic_key_request( # pylint: disable=name-to ) +def build_genai_create_evaluation_dataset_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/evaluation_datasets" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header( + "content_type", content_type, "str" + ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_genai_create_evaluation_dataset_file_upload_presigned_urls_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/evaluation_datasets/file_upload_presigned_urls" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header( + "content_type", content_type, "str" + ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_genai_list_evaluation_metrics_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/evaluation_metrics" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_genai_run_evaluation_test_case_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/evaluation_runs" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header( + "content_type", content_type, "str" + ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_genai_get_evaluation_run_request( + evaluation_run_uuid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/evaluation_runs/{evaluation_run_uuid}" + path_format_arguments = { + "evaluation_run_uuid": _SERIALIZER.url( + "evaluation_run_uuid", evaluation_run_uuid, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_genai_get_evaluation_run_results_request( # pylint: disable=name-too-long + evaluation_run_uuid: str, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/evaluation_runs/{evaluation_run_uuid}/results" + path_format_arguments = { + "evaluation_run_uuid": _SERIALIZER.url( + "evaluation_run_uuid", evaluation_run_uuid, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if page is not None: + _params["page"] = _SERIALIZER.query("page", page, "int") + if per_page is not None: + _params["per_page"] = _SERIALIZER.query("per_page", per_page, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest( + method="GET", url=_url, params=_params, headers=_headers, **kwargs + ) + + +def build_genai_get_evaluation_run_prompt_results_request( # pylint: disable=name-too-long + evaluation_run_uuid: str, prompt_id: int, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/evaluation_runs/{evaluation_run_uuid}/results/{prompt_id}" + path_format_arguments = { + "evaluation_run_uuid": _SERIALIZER.url( + "evaluation_run_uuid", evaluation_run_uuid, "str" + ), + "prompt_id": _SERIALIZER.url("prompt_id", prompt_id, "int"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_genai_list_evaluation_test_cases_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/evaluation_test_cases" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_genai_create_evaluation_test_case_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/evaluation_test_cases" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header( + "content_type", content_type, "str" + ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_genai_list_evaluation_runs_by_test_case_request( # pylint: disable=name-too-long + evaluation_test_case_uuid: str, + *, + evaluation_test_case_version: Optional[int] = None, + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/v2/gen-ai/evaluation_test_cases/{evaluation_test_case_uuid}/evaluation_runs" + ) + path_format_arguments = { + "evaluation_test_case_uuid": _SERIALIZER.url( + "evaluation_test_case_uuid", evaluation_test_case_uuid, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if evaluation_test_case_version is not None: + _params["evaluation_test_case_version"] = _SERIALIZER.query( + "evaluation_test_case_version", evaluation_test_case_version, "int" + ) + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest( + method="GET", url=_url, params=_params, headers=_headers, **kwargs + ) + + +def build_genai_get_evaluation_test_case_request( # pylint: disable=name-too-long + test_case_uuid: str, + *, + evaluation_test_case_version: Optional[int] = None, + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/evaluation_test_cases/{test_case_uuid}" + path_format_arguments = { + "test_case_uuid": _SERIALIZER.url("test_case_uuid", test_case_uuid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if evaluation_test_case_version is not None: + _params["evaluation_test_case_version"] = _SERIALIZER.query( + "evaluation_test_case_version", evaluation_test_case_version, "int" + ) + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest( + method="GET", url=_url, params=_params, headers=_headers, **kwargs + ) + + +def build_genai_update_evaluation_test_case_request( # pylint: disable=name-too-long + test_case_uuid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/evaluation_test_cases/{test_case_uuid}" + path_format_arguments = { + "test_case_uuid": _SERIALIZER.url("test_case_uuid", test_case_uuid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header( + "content_type", content_type, "str" + ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + def build_genai_list_indexing_jobs_request( *, page: Optional[int] = None, per_page: Optional[int] = None, **kwargs: Any ) -> HttpRequest: @@ -11833,6 +12138,199 @@ def build_genai_list_datacenter_regions_request( # pylint: disable=name-too-lon ) +def build_genai_list_workspaces_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/workspaces" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_genai_create_workspace_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/workspaces" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header( + "content_type", content_type, "str" + ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_genai_get_workspace_request( + workspace_uuid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/workspaces/{workspace_uuid}" + path_format_arguments = { + "workspace_uuid": _SERIALIZER.url("workspace_uuid", workspace_uuid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_genai_update_workspace_request( + workspace_uuid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/workspaces/{workspace_uuid}" + path_format_arguments = { + "workspace_uuid": _SERIALIZER.url("workspace_uuid", workspace_uuid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header( + "content_type", content_type, "str" + ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_genai_delete_workspace_request( + workspace_uuid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/workspaces/{workspace_uuid}" + path_format_arguments = { + "workspace_uuid": _SERIALIZER.url("workspace_uuid", workspace_uuid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) + + +def build_genai_list_agents_by_workspace_request( # pylint: disable=name-too-long + workspace_uuid: str, + *, + only_deployed: Optional[bool] = None, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/workspaces/{workspace_uuid}/agents" + path_format_arguments = { + "workspace_uuid": _SERIALIZER.url("workspace_uuid", workspace_uuid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if only_deployed is not None: + _params["only_deployed"] = _SERIALIZER.query( + "only_deployed", only_deployed, "bool" + ) + if page is not None: + _params["page"] = _SERIALIZER.query("page", page, "int") + if per_page is not None: + _params["per_page"] = _SERIALIZER.query("per_page", per_page, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest( + method="GET", url=_url, params=_params, headers=_headers, **kwargs + ) + + +def build_genai_update_agents_workspace_request( # pylint: disable=name-too-long + workspace_uuid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/workspaces/{workspace_uuid}/agents" + path_format_arguments = { + "workspace_uuid": _SERIALIZER.url("workspace_uuid", workspace_uuid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header( + "content_type", content_type, "str" + ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_genai_list_evaluation_test_cases_by_workspace_request( # pylint: disable=name-too-long + workspace_uuid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/gen-ai/workspaces/{workspace_uuid}/evaluation_test_cases" + path_format_arguments = { + "workspace_uuid": _SERIALIZER.url("workspace_uuid", workspace_uuid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + class OneClicksOperations: """ .. warning:: @@ -13481,6 +13979,23 @@ def list( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -13515,6 +14030,10 @@ def list( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -14982,6 +15501,25 @@ def list( The version of the database engine. } ], + "disable_edge_cache": False, # Optional. + Default value is False. .. role:: raw-html-m2r(raw) :format: + html If set to ``true``"" , the app will **not** be cached at + the edge (CDN). Enable this option if you want to manage CDN + configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your + app. This setting is also recommended for apps that require + real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model + Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for + static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # + Optional. Default value is False. If set to ``true``"" , email + addresses in the app will not be obfuscated. This is useful for + apps that require email addresses to be visible (in the HTML + markup). "domains": [ { "domain": "str", # The @@ -15017,6 +15555,10 @@ def list( Default value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , + suspicious requests will go through additional security checks to + help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. @@ -16641,6 +17183,25 @@ def list( The version of the database engine. } ], + "disable_edge_cache": False, # Optional. + Default value is False. .. role:: raw-html-m2r(raw) :format: + html If set to ``true``"" , the app will **not** be cached at + the edge (CDN). Enable this option if you want to manage CDN + configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your + app. This setting is also recommended for apps that require + real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model + Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for + static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # + Optional. Default value is False. If set to ``true``"" , email + addresses in the app will not be obfuscated. This is useful for + apps that require email addresses to be visible (in the HTML + markup). "domains": [ { "domain": "str", # The @@ -16676,6 +17237,10 @@ def list( Default value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , + suspicious requests will go through additional security checks to + help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. @@ -18238,6 +18803,25 @@ def list( The version of the database engine. } ], + "disable_edge_cache": False, # Optional. + Default value is False. .. role:: raw-html-m2r(raw) :format: + html If set to ``true``"" , the app will **not** be cached at + the edge (CDN). Enable this option if you want to manage CDN + configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your + app. This setting is also recommended for apps that require + real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model + Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for + static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # + Optional. Default value is False. If set to ``true``"" , email + addresses in the app will not be obfuscated. This is useful for + apps that require email addresses to be visible (in the HTML + markup). "domains": [ { "domain": "str", # The @@ -18273,6 +18857,10 @@ def list( Default value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , + suspicious requests will go through additional security checks to + help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. @@ -19826,6 +20414,25 @@ def list( The version of the database engine. } ], + "disable_edge_cache": False, # Optional. + Default value is False. .. role:: raw-html-m2r(raw) :format: + html If set to ``true``"" , the app will **not** be cached at + the edge (CDN). Enable this option if you want to manage CDN + configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your + app. This setting is also recommended for apps that require + real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model + Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for + static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # + Optional. Default value is False. If set to ``true``"" , email + addresses in the app will not be obfuscated. This is useful for + apps that require email addresses to be visible (in the HTML + markup). "domains": [ { "domain": "str", # The @@ -19861,6 +20468,10 @@ def list( Default value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , + suspicious requests will go through additional security checks to + help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. @@ -21412,6 +22023,22 @@ def create( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -21443,6 +22070,9 @@ def create( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -22663,6 +23293,22 @@ def create( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -22697,6 +23343,10 @@ def create( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -24083,6 +24733,23 @@ def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -24117,6 +24784,10 @@ def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -25667,6 +26338,23 @@ def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -25701,6 +26389,10 @@ def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -27190,6 +27882,23 @@ def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -27224,6 +27933,10 @@ def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -28705,6 +29418,23 @@ def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -28739,6 +29469,10 @@ def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -30159,6 +30893,22 @@ def create( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -30193,6 +30943,10 @@ def create( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -31579,6 +32333,23 @@ def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -31613,6 +32384,10 @@ def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -33163,6 +33938,23 @@ def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -33197,6 +33989,10 @@ def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -34686,6 +35482,23 @@ def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -34720,6 +35533,10 @@ def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -36201,6 +37018,23 @@ def create( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -36235,6 +37069,10 @@ def create( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -37649,6 +38487,22 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -37680,6 +38534,9 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -38900,6 +39757,22 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -38934,6 +39807,10 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -40320,6 +41197,23 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -40354,6 +41248,10 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -41904,6 +42802,23 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -41938,6 +42853,10 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -43427,6 +44346,23 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -43461,6 +44397,10 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -44942,6 +45882,23 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -44976,6 +45933,10 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -46578,6 +47539,22 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -46612,6 +47589,10 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -47998,6 +48979,23 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -48032,6 +49030,10 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -49582,6 +50584,23 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -49616,6 +50635,10 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -51105,6 +52128,23 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -51139,6 +52179,10 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -52620,6 +53664,23 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -52654,6 +53715,10 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -54169,6 +55234,22 @@ def update( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -54200,6 +55281,9 @@ def update( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -55422,6 +56506,22 @@ def update( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -55456,6 +56556,10 @@ def update( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -56842,6 +57946,23 @@ def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -56876,6 +57997,10 @@ def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -58426,6 +59551,23 @@ def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -58460,6 +59602,10 @@ def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -59949,6 +61095,23 @@ def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -59983,6 +61146,10 @@ def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -61464,6 +62631,23 @@ def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -61498,6 +62682,10 @@ def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -62936,6 +64124,22 @@ def update( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -62970,6 +64174,10 @@ def update( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -64356,6 +65564,23 @@ def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -64390,6 +65615,10 @@ def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -65940,6 +67169,23 @@ def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -65974,6 +67220,10 @@ def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -67463,6 +68713,23 @@ def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -67497,6 +68764,10 @@ def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -68978,6 +70249,23 @@ def update( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -69012,6 +70300,10 @@ def update( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -70439,6 +71731,22 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -70470,6 +71778,9 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -71692,6 +73003,22 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -71726,6 +73053,10 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -73112,6 +74443,23 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -73146,6 +74494,10 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -74696,6 +76048,23 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -74730,6 +76099,10 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -76219,6 +77592,23 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -76253,6 +77643,10 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -77734,6 +79128,23 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -77768,6 +79179,10 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -79406,6 +80821,22 @@ def restart( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -79440,6 +80871,10 @@ def restart( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -80880,6 +82315,22 @@ def restart( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -80914,6 +82365,10 @@ def restart( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -82354,6 +83809,22 @@ def restart( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -82388,6 +83859,10 @@ def restart( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -84331,6 +85806,23 @@ def list_deployments( version of the database engine. } ], + "disable_edge_cache": False, # Optional. Default + value is False. .. role:: raw-html-m2r(raw) :format: html If set + to ``true``"" , the app will **not** be cached at the edge (CDN). + Enable this option if you want to manage CDN configuration + yourself"u2014whether by using an external CDN provider or by + handling static content and caching within your app. This setting is + also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over + GET, or hosting an MCP (Model Context Protocol) Server that utilizes + SSE."" :raw-html-m2r:`
` **Note:** This feature is not available + for static site components."" :raw-html-m2r:`
` For more + information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. + Default value is False. If set to ``true``"" , email addresses in the + app will not be obfuscated. This is useful for apps that require + email addresses to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for @@ -84365,6 +85857,10 @@ def list_deployments( value is "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # + Optional. Default value is False. If set to ``true``"" , suspicious + requests will go through additional security checks to help mitigate + layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be @@ -85970,6 +87466,22 @@ def create_deployment( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -86004,6 +87516,10 @@ def create_deployment( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -87445,6 +88961,22 @@ def create_deployment( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -87479,6 +89011,10 @@ def create_deployment( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -88918,6 +90454,22 @@ def create_deployment( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -88952,6 +90504,10 @@ def create_deployment( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -90473,6 +92029,22 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -90507,6 +92079,10 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -92015,6 +93591,22 @@ def cancel_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> J the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -92049,6 +93641,10 @@ def cancel_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> J "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -94380,6 +95976,22 @@ def validate_app_spec( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -94411,6 +96023,9 @@ def validate_app_spec( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -95644,6 +97259,22 @@ def validate_app_spec( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -95675,6 +97306,9 @@ def validate_app_spec( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -96930,6 +98564,22 @@ def validate_app_spec( database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -96961,6 +98611,9 @@ def validate_app_spec( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -98197,6 +99850,22 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -98228,6 +99897,9 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -99461,6 +101133,22 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON database engine. } ], + "disable_edge_cache": False, # Optional. Default value is False. .. + role:: raw-html-m2r(raw) :format: html If set to ``true``"" , the app + will **not** be cached at the edge (CDN). Enable this option if you want to + manage CDN configuration yourself"u2014whether by using an external CDN + provider or by handling static content and caching within your app. This + setting is also recommended for apps that require real-time data or serve + dynamic content, such as those using Server-Sent Events (SSE) over GET, or + hosting an MCP (Model Context Protocol) Server that utilizes SSE."" + :raw-html-m2r:`
` **Note:** This feature is not available for static site + components."" :raw-html-m2r:`
` For more information, see `Disable CDN + Cache + `_. + "disable_email_obfuscation": False, # Optional. Default value is + False. If set to ``true``"" , email addresses in the app will not be + obfuscated. This is useful for apps that require email addresses to be + visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the domain. @@ -99492,6 +101180,9 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. Default value + is False. If set to ``true``"" , suspicious requests will go through + additional security checks to help mitigate layer 7 DDoS attacks. "functions": [ { "name": "str", # The name. Must be unique across all @@ -101533,6 +103224,22 @@ def create_rollback( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -101567,6 +103274,10 @@ def create_rollback( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -103016,6 +104727,22 @@ def create_rollback( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -103050,6 +104777,10 @@ def create_rollback( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -104502,6 +106233,22 @@ def create_rollback( the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -104536,6 +106283,10 @@ def create_rollback( "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -106583,6 +108334,22 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: the database engine. } ], + "disable_edge_cache": False, # Optional. Default value is + False. .. role:: raw-html-m2r(raw) :format: html If set to + ``true``"" , the app will **not** be cached at the edge (CDN). Enable + this option if you want to manage CDN configuration yourself"u2014whether + by using an external CDN provider or by handling static content and + caching within your app. This setting is also recommended for apps that + require real-time data or serve dynamic content, such as those using + Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context + Protocol) Server that utilizes SSE."" :raw-html-m2r:`
` **Note:** This + feature is not available for static site components."" + :raw-html-m2r:`
` For more information, see `Disable CDN Cache + `_. + "disable_email_obfuscation": False, # Optional. Default + value is False. If set to ``true``"" , email addresses in the app will + not be obfuscated. This is useful for apps that require email addresses + to be visible (in the HTML markup). "domains": [ { "domain": "str", # The hostname for the @@ -106617,6 +108384,10 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and "DEDICATED_IP". }, + "enhanced_threat_control_enabled": False, # Optional. + Default value is False. If set to ``true``"" , suspicious requests will + go through additional security checks to help mitigate layer 7 DDoS + attacks. "functions": [ { "name": "str", # The name. Must be unique @@ -189548,7 +191319,7 @@ def list_agents( }, "name": "str", # Optional. Agent name. "project_id": "str", # Optional. The DigitalOcean project ID - associated with the agent.:code:`
`Requires ``project:read`` scope. + associated with the agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -189569,7 +191340,7 @@ def list_agents( "route_uuid": "str", # Optional. Route uuid. "tags": [ "str" # Optional. A set of abitrary tags to organize - your agent.:code:`
`Requires ``tag:read`` scope. + your agent. ], "temperature": 0.0, # Optional. Controls the model"u2019s creativity, specified as a number between 0 and 1. Lower values produce @@ -189628,6 +191399,14 @@ def list_agents( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # @@ -189645,8 +191424,7 @@ def list_agents( code. "tags": [ "str" # Optional. Tags to - organize related resources.:code:`
`Requires - ``tag:read`` scope. + organize related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -189741,7 +191519,9 @@ def list_agents( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. - "uuid": "str" # Optional. Unique agent id. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str" # Optional. The latest version of the + agent. } ], "links": { @@ -189895,12 +191675,11 @@ def create_agent( "open_ai_key_uuid": "str", # Optional. Optional OpenAI API key ID to use with OpenAI models. "project_id": "str", # Optional. The id of the DigitalOcean project this - agent will belong to.:code:`
`Requires ``project:update`` scope. + agent will belong to. "region": "str", # Optional. The DigitalOcean region to deploy your agent in. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:create`` scope. + "str" # Optional. Agent tag to organize related resources. ] } @@ -189952,6 +191731,8 @@ def create_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -190069,6 +191850,12 @@ def create_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -190081,7 +191868,7 @@ def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -190091,6 +191878,15 @@ def create_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -190195,8 +191991,7 @@ def create_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -190215,8 +192010,7 @@ def create_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -190268,6 +192062,13 @@ def create_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -190283,7 +192084,7 @@ def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -190368,6 +192169,7 @@ def create_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -190392,6 +192194,20 @@ def create_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -190404,6 +192220,9 @@ def create_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -190414,11 +192233,15 @@ def create_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -190427,6 +192250,10 @@ def create_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -190537,6 +192364,8 @@ def create_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -190654,6 +192483,12 @@ def create_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -190666,7 +192501,7 @@ def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -190676,6 +192511,15 @@ def create_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -190780,8 +192624,7 @@ def create_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -190800,8 +192643,7 @@ def create_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -190853,6 +192695,13 @@ def create_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -190868,7 +192717,7 @@ def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -190953,6 +192802,7 @@ def create_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -190977,6 +192827,20 @@ def create_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -190989,6 +192853,9 @@ def create_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -190999,11 +192866,15 @@ def create_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -191012,6 +192883,10 @@ def create_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -191086,12 +192961,11 @@ def create_agent( "open_ai_key_uuid": "str", # Optional. Optional OpenAI API key ID to use with OpenAI models. "project_id": "str", # Optional. The id of the DigitalOcean project this - agent will belong to.:code:`
`Requires ``project:update`` scope. + agent will belong to. "region": "str", # Optional. The DigitalOcean region to deploy your agent in. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:create`` scope. + "str" # Optional. Agent tag to organize related resources. ] } @@ -191143,6 +193017,8 @@ def create_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -191260,6 +193136,12 @@ def create_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -191272,7 +193154,7 @@ def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -191282,6 +193164,15 @@ def create_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -191386,8 +193277,7 @@ def create_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -191406,8 +193296,7 @@ def create_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -191459,6 +193348,13 @@ def create_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -191474,7 +193370,7 @@ def create_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -191559,6 +193455,7 @@ def create_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -191583,6 +193480,20 @@ def create_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -191595,6 +193506,9 @@ def create_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -191605,11 +193519,15 @@ def create_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -191618,6 +193536,10 @@ def create_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -192761,6 +194683,8 @@ def attach_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -192878,6 +194802,12 @@ def attach_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -192890,7 +194820,7 @@ def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -192900,6 +194830,15 @@ def attach_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -193004,8 +194943,7 @@ def attach_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -193024,8 +194962,7 @@ def attach_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -193077,6 +195014,13 @@ def attach_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -193092,7 +195036,7 @@ def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -193177,6 +195121,7 @@ def attach_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -193201,6 +195146,20 @@ def attach_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -193213,6 +195172,9 @@ def attach_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -193223,11 +195185,15 @@ def attach_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -193236,6 +195202,10 @@ def attach_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -193349,6 +195319,8 @@ def attach_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -193466,6 +195438,12 @@ def attach_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -193478,7 +195456,7 @@ def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -193488,6 +195466,15 @@ def attach_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -193592,8 +195579,7 @@ def attach_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -193612,8 +195598,7 @@ def attach_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -193665,6 +195650,13 @@ def attach_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -193680,7 +195672,7 @@ def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -193765,6 +195757,7 @@ def attach_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -193789,6 +195782,20 @@ def attach_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -193801,6 +195808,9 @@ def attach_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -193811,11 +195821,15 @@ def attach_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -193824,6 +195838,10 @@ def attach_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -193947,6 +195965,8 @@ def attach_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -194064,6 +196084,12 @@ def attach_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -194076,7 +196102,7 @@ def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -194086,6 +196112,15 @@ def attach_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -194190,8 +196225,7 @@ def attach_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -194210,8 +196244,7 @@ def attach_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -194263,6 +196296,13 @@ def attach_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -194278,7 +196318,7 @@ def attach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -194363,6 +196403,7 @@ def attach_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -194387,6 +196428,20 @@ def attach_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -194399,6 +196454,9 @@ def attach_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -194409,11 +196467,15 @@ def attach_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -194422,6 +196484,10 @@ def attach_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -194648,6 +196714,8 @@ def update_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -194765,6 +196833,12 @@ def update_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -194777,7 +196851,7 @@ def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -194787,6 +196861,15 @@ def update_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -194891,8 +196974,7 @@ def update_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -194911,8 +196993,7 @@ def update_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -194964,6 +197045,13 @@ def update_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -194979,7 +197067,7 @@ def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -195064,6 +197152,7 @@ def update_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -195088,6 +197177,20 @@ def update_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -195100,6 +197203,9 @@ def update_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -195110,11 +197216,15 @@ def update_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -195123,6 +197233,10 @@ def update_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -195239,6 +197353,8 @@ def update_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -195356,6 +197472,12 @@ def update_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -195368,7 +197490,7 @@ def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -195378,6 +197500,15 @@ def update_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -195482,8 +197613,7 @@ def update_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -195502,8 +197632,7 @@ def update_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -195555,6 +197684,13 @@ def update_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -195570,7 +197706,7 @@ def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -195655,6 +197791,7 @@ def update_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -195679,6 +197816,20 @@ def update_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -195691,6 +197842,9 @@ def update_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -195701,11 +197855,15 @@ def update_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -195714,6 +197872,10 @@ def update_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -195841,6 +198003,8 @@ def update_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -195958,6 +198122,12 @@ def update_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -195970,7 +198140,7 @@ def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -195980,6 +198150,15 @@ def update_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -196084,8 +198263,7 @@ def update_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -196104,8 +198282,7 @@ def update_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -196157,6 +198334,13 @@ def update_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -196172,7 +198356,7 @@ def update_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -196257,6 +198441,7 @@ def update_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -196281,6 +198466,20 @@ def update_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -196293,6 +198492,9 @@ def update_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -196303,11 +198505,15 @@ def update_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -196316,6 +198522,10 @@ def update_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -196517,6 +198727,8 @@ def detach_agent_function( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -196634,6 +198846,12 @@ def detach_agent_function( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -196646,7 +198864,7 @@ def detach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -196656,6 +198874,15 @@ def detach_agent_function( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -196760,8 +198987,7 @@ def detach_agent_function( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -196780,8 +199006,7 @@ def detach_agent_function( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -196833,6 +199058,13 @@ def detach_agent_function( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -196848,7 +199080,7 @@ def detach_agent_function( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -196933,6 +199165,7 @@ def detach_agent_function( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -196957,6 +199190,20 @@ def detach_agent_function( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -196969,6 +199216,9 @@ def detach_agent_function( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -196979,11 +199229,15 @@ def detach_agent_function( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -196992,6 +199246,10 @@ def detach_agent_function( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -197171,6 +199429,8 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -197288,6 +199548,12 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -197300,7 +199566,7 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -197310,6 +199576,15 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -197414,8 +199689,7 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -197434,8 +199708,7 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -197487,6 +199760,13 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -197502,7 +199782,7 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -197587,6 +199867,7 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -197611,6 +199892,20 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -197623,6 +199918,9 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -197633,11 +199931,15 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -197646,6 +199948,10 @@ def attach_knowledge_bases(self, agent_uuid: str, **kwargs: Any) -> JSON: Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -197828,6 +200134,8 @@ def attach_knowledge_base( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -197945,6 +200253,12 @@ def attach_knowledge_base( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -197957,7 +200271,7 @@ def attach_knowledge_base( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -197967,6 +200281,15 @@ def attach_knowledge_base( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -198071,8 +200394,7 @@ def attach_knowledge_base( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -198091,8 +200413,7 @@ def attach_knowledge_base( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -198144,6 +200465,13 @@ def attach_knowledge_base( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -198159,7 +200487,7 @@ def attach_knowledge_base( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -198244,6 +200572,7 @@ def attach_knowledge_base( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -198268,6 +200597,20 @@ def attach_knowledge_base( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -198280,6 +200623,9 @@ def attach_knowledge_base( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -198290,11 +200636,15 @@ def attach_knowledge_base( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -198303,6 +200653,10 @@ def attach_knowledge_base( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -198486,6 +200840,8 @@ def detach_knowledge_base( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -198603,6 +200959,12 @@ def detach_knowledge_base( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -198615,7 +200977,7 @@ def detach_knowledge_base( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -198625,6 +200987,15 @@ def detach_knowledge_base( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -198729,8 +201100,7 @@ def detach_knowledge_base( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -198749,8 +201119,7 @@ def detach_knowledge_base( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -198802,6 +201171,13 @@ def detach_knowledge_base( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -198817,7 +201193,7 @@ def detach_knowledge_base( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -198902,6 +201278,7 @@ def detach_knowledge_base( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -198926,6 +201303,20 @@ def detach_knowledge_base( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -198938,6 +201329,9 @@ def detach_knowledge_base( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -198948,11 +201342,15 @@ def detach_knowledge_base( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -198961,6 +201359,10 @@ def detach_knowledge_base( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -199789,6 +202191,8 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -199906,6 +202310,12 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -199918,7 +202328,7 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -199928,6 +202338,15 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -200032,8 +202451,7 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -200052,8 +202470,7 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -200105,6 +202522,13 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -200120,7 +202544,7 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -200205,6 +202629,7 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -200229,6 +202654,20 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -200241,6 +202680,9 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -200251,11 +202693,15 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -200264,6 +202710,10 @@ def get_agent(self, uuid: str, **kwargs: Any) -> JSON: Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -200410,6 +202860,8 @@ def update_agent( body = { "anthropic_key_uuid": "str", # Optional. Optional anthropic key uuid for use with anthropic models. + "conversation_logs_enabled": bool, # Optional. Optional update of + conversation logs enabled. "description": "str", # Optional. Agent description. "instruction": "str", # Optional. Agent instruction. Instructions help your agent to perform its job effectively. See `Write Effective Agent Instructions @@ -200425,7 +202877,7 @@ def update_agent( "open_ai_key_uuid": "str", # Optional. Optional OpenAI key uuid for use with OpenAI models. "project_id": "str", # Optional. The id of the DigitalOcean project this - agent will belong to.:code:`
`Requires ``project:update`` scope. + agent will belong to. "provide_citations": bool, # Optional. "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: The retrieval method is @@ -200437,8 +202889,7 @@ def update_agent( "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". "tags": [ - "str" # Optional. A set of abitrary tags to organize your - agent.:code:`
`Requires ``tag:create`` scope. + "str" # Optional. A set of abitrary tags to organize your agent. ], "temperature": 0.0, # Optional. Controls the model"u2019s creativity, specified as a number between 0 and 1. Lower values produce more predictable and @@ -200497,6 +202948,8 @@ def update_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -200614,6 +203067,12 @@ def update_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -200626,7 +203085,7 @@ def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -200636,6 +203095,15 @@ def update_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -200740,8 +203208,7 @@ def update_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -200760,8 +203227,7 @@ def update_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -200813,6 +203279,13 @@ def update_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -200828,7 +203301,7 @@ def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -200913,6 +203386,7 @@ def update_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -200937,6 +203411,20 @@ def update_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -200949,6 +203437,9 @@ def update_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -200959,11 +203450,15 @@ def update_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -200972,6 +203467,10 @@ def update_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -201085,6 +203584,8 @@ def update_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -201202,6 +203703,12 @@ def update_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -201214,7 +203721,7 @@ def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -201224,6 +203731,15 @@ def update_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -201328,8 +203844,7 @@ def update_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -201348,8 +203863,7 @@ def update_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -201401,6 +203915,13 @@ def update_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -201416,7 +203937,7 @@ def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -201501,6 +204022,7 @@ def update_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -201525,6 +204047,20 @@ def update_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -201537,6 +204073,9 @@ def update_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -201547,11 +204086,15 @@ def update_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -201560,6 +204103,10 @@ def update_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -201621,6 +204168,8 @@ def update_agent( body = { "anthropic_key_uuid": "str", # Optional. Optional anthropic key uuid for use with anthropic models. + "conversation_logs_enabled": bool, # Optional. Optional update of + conversation logs enabled. "description": "str", # Optional. Agent description. "instruction": "str", # Optional. Agent instruction. Instructions help your agent to perform its job effectively. See `Write Effective Agent Instructions @@ -201636,7 +204185,7 @@ def update_agent( "open_ai_key_uuid": "str", # Optional. Optional OpenAI key uuid for use with OpenAI models. "project_id": "str", # Optional. The id of the DigitalOcean project this - agent will belong to.:code:`
`Requires ``project:update`` scope. + agent will belong to. "provide_citations": bool, # Optional. "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: The retrieval method is @@ -201648,8 +204197,7 @@ def update_agent( "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". "tags": [ - "str" # Optional. A set of abitrary tags to organize your - agent.:code:`
`Requires ``tag:create`` scope. + "str" # Optional. A set of abitrary tags to organize your agent. ], "temperature": 0.0, # Optional. Controls the model"u2019s creativity, specified as a number between 0 and 1. Lower values produce more predictable and @@ -201708,6 +204256,8 @@ def update_agent( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -201825,6 +204375,12 @@ def update_agent( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -201837,7 +204393,7 @@ def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -201847,6 +204403,15 @@ def update_agent( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -201951,8 +204516,7 @@ def update_agent( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -201971,8 +204535,7 @@ def update_agent( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -202024,6 +204587,13 @@ def update_agent( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -202039,7 +204609,7 @@ def update_agent( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -202124,6 +204694,7 @@ def update_agent( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -202148,6 +204719,20 @@ def update_agent( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -202160,6 +204745,9 @@ def update_agent( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -202170,11 +204758,15 @@ def update_agent( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -202183,6 +204775,10 @@ def update_agent( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -202377,6 +204973,8 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -202494,6 +205092,12 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -202506,7 +205110,7 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -202516,6 +205120,15 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -202620,8 +205233,7 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -202640,8 +205252,7 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -202693,6 +205304,13 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -202708,7 +205326,7 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -202793,6 +205411,7 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -202817,6 +205436,20 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -202829,6 +205462,9 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -202839,11 +205475,15 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -202852,6 +205492,10 @@ def delete_agent(self, uuid: str, **kwargs: Any) -> JSON: Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -203034,6 +205678,8 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether + conversation logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -203159,6 +205805,13 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -203174,7 +205827,7 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -203184,6 +205837,16 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: knowledge base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo + project identifier. + "galileo_project_name": "str", # Optional. Name of + the Galileo project. + "log_stream_id": "str", # Optional. Identifier for + the log stream. + "log_stream_name": "str" # Optional. Name of the log + stream. + }, "max_tokens": 0, # Optional. Child agents. "model": { "agreement": { @@ -203298,8 +205961,7 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. Child agents. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -203319,7 +205981,7 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "route_uuid": "str", # Optional. Child agents. "tags": [ "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "temperature": 0.0, # Optional. Child agents. "template": { @@ -203375,6 +206037,14 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # @@ -203392,8 +206062,7 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: code. "tags": [ "str" # Optional. Tags to - organize related resources.:code:`
`Requires - ``tag:read`` scope. + organize related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -203486,6 +206155,8 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the + agent. "workspace": { "agents": [ ... @@ -203510,6 +206181,20 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: Optional. Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 + 00:00:00", # Optional. Time created at. + "dataset_name": "str", # + Optional. Name of the dataset. + "dataset_uuid": "str", # + Optional. UUID of the dataset. + "file_size": "str", # + Optional. The size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. + Number of rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -203522,6 +206207,9 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning + that a lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -203533,11 +206221,16 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # + Optional. The minimum value for the metric. } ], "name": "str", # Optional. @@ -203547,6 +206240,10 @@ def get_agent_children(self, uuid: str, **kwargs: Any) -> JSON: Optional. Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This + is a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -203754,6 +206451,8 @@ def update_agent_deployment_visibility( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -203871,6 +206570,12 @@ def update_agent_deployment_visibility( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -203883,7 +206588,7 @@ def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -203893,6 +206598,15 @@ def update_agent_deployment_visibility( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -203997,8 +206711,7 @@ def update_agent_deployment_visibility( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -204017,8 +206730,7 @@ def update_agent_deployment_visibility( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -204070,6 +206782,13 @@ def update_agent_deployment_visibility( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -204085,7 +206804,7 @@ def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -204170,6 +206889,7 @@ def update_agent_deployment_visibility( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -204194,6 +206914,20 @@ def update_agent_deployment_visibility( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -204206,6 +206940,9 @@ def update_agent_deployment_visibility( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -204216,11 +206953,15 @@ def update_agent_deployment_visibility( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -204229,6 +206970,10 @@ def update_agent_deployment_visibility( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -204342,6 +207087,8 @@ def update_agent_deployment_visibility( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -204459,6 +207206,12 @@ def update_agent_deployment_visibility( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -204471,7 +207224,7 @@ def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -204481,6 +207234,15 @@ def update_agent_deployment_visibility( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -204585,8 +207347,7 @@ def update_agent_deployment_visibility( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -204605,8 +207366,7 @@ def update_agent_deployment_visibility( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -204658,6 +207418,13 @@ def update_agent_deployment_visibility( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -204673,7 +207440,7 @@ def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -204758,6 +207525,7 @@ def update_agent_deployment_visibility( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -204782,6 +207550,20 @@ def update_agent_deployment_visibility( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -204794,6 +207576,9 @@ def update_agent_deployment_visibility( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -204804,11 +207589,15 @@ def update_agent_deployment_visibility( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -204817,6 +207606,10 @@ def update_agent_deployment_visibility( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -204936,6 +207729,8 @@ def update_agent_deployment_visibility( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether conversation + logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -205053,6 +207848,12 @@ def update_agent_deployment_visibility( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # + Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". Known + values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. @@ -205065,7 +207866,7 @@ def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -205075,6 +207876,15 @@ def update_agent_deployment_visibility( base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo project + identifier. + "galileo_project_name": "str", # Optional. Name of the + Galileo project. + "log_stream_id": "str", # Optional. Identifier for the log + stream. + "log_stream_name": "str" # Optional. Name of the log stream. + }, "max_tokens": 0, # Optional. An Agent. "model": { "agreement": { @@ -205179,8 +207989,7 @@ def update_agent_deployment_visibility( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. An Agent. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -205199,8 +208008,7 @@ def update_agent_deployment_visibility( "route_name": "str", # Optional. Route name. "route_uuid": "str", # Optional. An Agent. "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Agent tag to organize related resources. ], "temperature": 0.0, # Optional. An Agent. "template": { @@ -205252,6 +208060,13 @@ def update_agent_deployment_visibility( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -205267,7 +208082,7 @@ def update_agent_deployment_visibility( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -205352,6 +208167,7 @@ def update_agent_deployment_visibility( "url": "str", # Optional. Access your agent under this url. "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the agent. "workspace": { "agents": [ ... @@ -205376,6 +208192,20 @@ def update_agent_deployment_visibility( Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -205388,6 +208218,9 @@ def update_agent_deployment_visibility( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -205398,11 +208231,15 @@ def update_agent_deployment_visibility( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. } ], "name": "str", # Optional. Evaluations. @@ -205411,6 +208248,10 @@ def update_agent_deployment_visibility( Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -205649,8 +208490,7 @@ def list_agent_versions( "RETRIEVAL_METHOD_REWRITE", "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". "tags": [ - "str" # Optional. Tags associated with the - agent.:code:`
`Requires ``tag:read`` scope. + "str" # Optional. Tags associated with the agent. ], "temperature": 0.0, # Optional. Temperature setting for the agent. @@ -207024,6 +209864,8 @@ def list_agents_by_anthropic_key( "child_agents": [ ... ], + "conversation_logs_enabled": bool, # Optional. Whether + conversation logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "deployment": { @@ -207147,6 +209989,13 @@ def list_agents_by_anthropic_key( "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. @@ -207162,7 +210011,7 @@ def list_agents_by_anthropic_key( "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. + related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -207172,6 +210021,16 @@ def list_agents_by_anthropic_key( knowledge base. } ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo + project identifier. + "galileo_project_name": "str", # Optional. Name of + the Galileo project. + "log_stream_id": "str", # Optional. Identifier for + the log stream. + "log_stream_name": "str" # Optional. Name of the log + stream. + }, "max_tokens": 0, # Optional. "model": { "agreement": { @@ -207286,8 +210145,7 @@ def list_agents_by_anthropic_key( "parent_agents": [ ... ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. + "project_id": "str", # Optional. "provide_citations": bool, # Optional. Whether the agent should provide in-response citations. "region": "str", # Optional. Region code. @@ -207307,7 +210165,7 @@ def list_agents_by_anthropic_key( "route_uuid": "str", # Optional. "tags": [ "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. + resources. ], "temperature": 0.0, # Optional. "template": { @@ -207363,6 +210221,14 @@ def list_agents_by_anthropic_key( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # @@ -207380,8 +210246,7 @@ def list_agents_by_anthropic_key( code. "tags": [ "str" # Optional. Tags to - organize related resources.:code:`
`Requires - ``tag:read`` scope. + organize related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -207474,6 +210339,8 @@ def list_agents_by_anthropic_key( "user_id": "str", # Optional. Id of user that created the agent. "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the + agent. "workspace": { "agents": [ ... @@ -207498,6 +210365,20 @@ def list_agents_by_anthropic_key( Optional. Evaluations. "created_by_user_id": "str", # Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 + 00:00:00", # Optional. Time created at. + "dataset_name": "str", # + Optional. Name of the dataset. + "dataset_uuid": "str", # + Optional. UUID of the dataset. + "file_size": "str", # + Optional. The size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. + Number of rows in the dataset. + }, "dataset_name": "str", # Optional. Evaluations. "dataset_uuid": "str", # Optional. @@ -207510,6 +210391,9 @@ def list_agents_by_anthropic_key( { "description": "str", # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning + that a lower value is better. "metric_name": "str", # Optional. Evaluations. "metric_type": @@ -207521,11 +210405,16 @@ def list_agents_by_anthropic_key( "metric_uuid": "str", # Optional. Evaluations. "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". + "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # + Optional. The minimum value for the metric. } ], "name": "str", # Optional. @@ -207535,6 +210424,10 @@ def list_agents_by_anthropic_key( Optional. Evaluations. "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This + is a value that the metric must reach to be considered + successful. "success_threshold_pct": 0 # Optional. The success threshold for the star metric. This is a percentage value between 0 and 100. @@ -207666,24 +210559,24 @@ def list_agents_by_anthropic_key( return cast(JSON, deserialized) # type: ignore - @distributed_trace - def list_indexing_jobs( + @overload + def create_evaluation_dataset( self, + body: Optional[JSON] = None, *, - page: Optional[int] = None, - per_page: Optional[int] = None, + content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """List Indexing Jobs for a Knowledge Base. + """Create Evaluation Dataset. - To list all indexing jobs for a knowledge base, send a GET request to - ``/v2/gen-ai/indexing_jobs``. + To create an evaluation dataset, send a POST request to ``/v2/gen-ai/evaluation_datasets``. - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -207691,49 +210584,108 @@ def list_indexing_jobs( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "file_upload_dataset": { + "original_file_name": "str", # Optional. The original file name. + "size_in_bytes": "str", # Optional. The size of the file in bytes. + "stored_object_key": "str" # Optional. The object key the file was + stored as. + }, + "name": "str" # Optional. The name of the agent evaluation dataset. + } + # response body for status code(s): 200 response == { - "jobs": [ - { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. The indexing jobs. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. The - indexing jobs. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. The - indexing jobs. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. - } + "evaluation_dataset_uuid": "str" # Optional. Evaluation dataset uuid. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def create_evaluation_dataset( + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Create Evaluation Dataset. + + To create an evaluation dataset, send a POST request to ``/v2/gen-ai/evaluation_datasets``. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "evaluation_dataset_uuid": "str" # Optional. Evaluation dataset uuid. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def create_evaluation_dataset( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create Evaluation Dataset. + + To create an evaluation dataset, send a POST request to ``/v2/gen-ai/evaluation_datasets``. + + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "file_upload_dataset": { + "original_file_name": "str", # Optional. The original file name. + "size_in_bytes": "str", # Optional. The size of the file in bytes. + "stored_object_key": "str" # Optional. The object key the file was + stored as. }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. - } + "name": "str" # Optional. The name of the agent evaluation dataset. + } + + # response body for status code(s): 200 + response == { + "evaluation_dataset_uuid": "str" # Optional. Evaluation dataset uuid. } # response body for status code(s): 404 response == { @@ -207760,14 +210712,29 @@ def list_indexing_jobs( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_indexing_jobs_request( - page=page, - per_page=per_page, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_create_evaluation_dataset_request( + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -207827,7 +210794,7 @@ def list_indexing_jobs( return cast(JSON, deserialized) # type: ignore @overload - def create_indexing_job( + def create_evaluation_dataset_file_upload_presigned_urls( # pylint: disable=name-too-long self, body: Optional[JSON] = None, *, @@ -207835,10 +210802,10 @@ def create_indexing_job( **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Start Indexing Job for a Knowledge Base. + """Create Presigned URLs for Evaluation Dataset File Upload. - To start an indexing job for a knowledge base, send a POST request to - ``/v2/gen-ai/indexing_jobs``. + To create presigned URLs for evaluation dataset file upload, send a POST request to + ``/v2/gen-ai/evaluation_datasets/file_upload_presigned_urls``. :param body: Default value is None. :type body: JSON @@ -207854,39 +210821,31 @@ def create_indexing_job( # JSON input template you can fill out and use as your body input. body = { - "data_source_uuids": [ - "str" # Optional. List of data source ids to index, if none are - provided, all data sources will be indexed. - ], - "knowledge_base_uuid": "str" # Optional. Knowledge base id. + "files": [ + { + "file_name": "str", # Optional. Local filename. + "file_size": "str" # Optional. The size of the file in + bytes. + } + ] } # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. - } + "request_id": "str", # Optional. The ID generated for the request for + Presigned URLs. + "uploads": [ + { + "expires_at": "2020-02-20 00:00:00", # Optional. The time + the url expires at. + "object_key": "str", # Optional. The unique object key to + store the file as. + "original_file_name": "str", # Optional. The original file + name. + "presigned_url": "str" # Optional. The actual presigned URL + the client can use to upload the file directly. + } + ] } # response body for status code(s): 404 response == { @@ -207902,7 +210861,7 @@ def create_indexing_job( """ @overload - def create_indexing_job( + def create_evaluation_dataset_file_upload_presigned_urls( # pylint: disable=name-too-long self, body: Optional[IO[bytes]] = None, *, @@ -207910,10 +210869,10 @@ def create_indexing_job( **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Start Indexing Job for a Knowledge Base. + """Create Presigned URLs for Evaluation Dataset File Upload. - To start an indexing job for a knowledge base, send a POST request to - ``/v2/gen-ai/indexing_jobs``. + To create presigned URLs for evaluation dataset file upload, send a POST request to + ``/v2/gen-ai/evaluation_datasets/file_upload_presigned_urls``. :param body: Default value is None. :type body: IO[bytes] @@ -207929,30 +210888,20 @@ def create_indexing_job( # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. - } + "request_id": "str", # Optional. The ID generated for the request for + Presigned URLs. + "uploads": [ + { + "expires_at": "2020-02-20 00:00:00", # Optional. The time + the url expires at. + "object_key": "str", # Optional. The unique object key to + store the file as. + "original_file_name": "str", # Optional. The original file + name. + "presigned_url": "str" # Optional. The actual presigned URL + the client can use to upload the file directly. + } + ] } # response body for status code(s): 404 response == { @@ -207968,14 +210917,14 @@ def create_indexing_job( """ @distributed_trace - def create_indexing_job( + def create_evaluation_dataset_file_upload_presigned_urls( # pylint: disable=name-too-long self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Start Indexing Job for a Knowledge Base. + """Create Presigned URLs for Evaluation Dataset File Upload. - To start an indexing job for a knowledge base, send a POST request to - ``/v2/gen-ai/indexing_jobs``. + To create presigned URLs for evaluation dataset file upload, send a POST request to + ``/v2/gen-ai/evaluation_datasets/file_upload_presigned_urls``. :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] @@ -207988,39 +210937,31 @@ def create_indexing_job( # JSON input template you can fill out and use as your body input. body = { - "data_source_uuids": [ - "str" # Optional. List of data source ids to index, if none are - provided, all data sources will be indexed. - ], - "knowledge_base_uuid": "str" # Optional. Knowledge base id. + "files": [ + { + "file_name": "str", # Optional. Local filename. + "file_size": "str" # Optional. The size of the file in + bytes. + } + ] } # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. - } + "request_id": "str", # Optional. The ID generated for the request for + Presigned URLs. + "uploads": [ + { + "expires_at": "2020-02-20 00:00:00", # Optional. The time + the url expires at. + "object_key": "str", # Optional. The unique object key to + store the file as. + "original_file_name": "str", # Optional. The original file + name. + "presigned_url": "str" # Optional. The actual presigned URL + the client can use to upload the file directly. + } + ] } # response body for status code(s): 404 response == { @@ -208066,12 +211007,14 @@ def create_indexing_job( else: _json = None - _request = build_genai_create_indexing_job_request( - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, + _request = ( + build_genai_create_evaluation_dataset_file_upload_presigned_urls_request( + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) ) _request.url = self._client.format_url(_request.url) @@ -208129,17 +211072,12 @@ def create_indexing_job( return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_indexing_job_data_sources( - self, indexing_job_uuid: str, **kwargs: Any - ) -> JSON: + def list_evaluation_metrics(self, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """List Data Sources for Indexing Job for a Knowledge Base. + """List Evaluation Metrics. - To list all datasources for an indexing job, send a GET request to - ``/v2/gen-ai/indexing_jobs/{indexing_job_uuid}/data_sources``. + To list all evaluation metrics, send a GET request to ``/v2/gen-ai/evaluation_metrics``. - :param indexing_job_uuid: Uuid of the indexing job. Required. - :type indexing_job_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -208149,39 +211087,25 @@ def list_indexing_job_data_sources( # response body for status code(s): 200 response == { - "indexed_data_sources": [ + "metrics": [ { - "completed_at": "2020-02-20 00:00:00", # Optional. Timestamp - when data source completed indexing. - "data_source_uuid": "str", # Optional. Uuid of the indexed - data source. - "error_details": "str", # Optional. A detailed error - description. - "error_msg": "str", # Optional. A string code provinding a - hint which part of the system experienced an error. - "failed_item_count": "str", # Optional. Total count of files - that have failed. - "indexed_file_count": "str", # Optional. Total count of - files that have been indexed. - "indexed_item_count": "str", # Optional. Total count of - files that have been indexed. - "removed_item_count": "str", # Optional. Total count of - files that have been removed. - "skipped_item_count": "str", # Optional. Total count of - files that have been skipped. - "started_at": "2020-02-20 00:00:00", # Optional. Timestamp - when data source started indexing. - "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. Default - value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: - "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", - "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", - "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". - "total_bytes": "str", # Optional. Total size of files in - data source in bytes. - "total_bytes_indexed": "str", # Optional. Total size of - files in data source in bytes that have been indexed. - "total_file_count": "str" # Optional. Total file count in - the data source. + "description": "str", # Optional. + "inverted": bool, # Optional. If true, the metric is + inverted, meaning that a lower value is better. + "metric_name": "str", # Optional. + "metric_type": "METRIC_TYPE_UNSPECIFIED", # Optional. + Default value is "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values + are: "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The maximum value for the + metric. + "range_min": 0.0 # Optional. The minimum value for the + metric. } ] } @@ -208215,8 +211139,7 @@ def list_indexing_job_data_sources( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_indexing_job_data_sources_request( - indexing_job_uuid=indexing_job_uuid, + _request = build_genai_list_evaluation_metrics_request( headers=_headers, params=_params, ) @@ -208275,16 +211198,114 @@ def list_indexing_job_data_sources( return cast(JSON, deserialized) # type: ignore + @overload + def run_evaluation_test_case( + self, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Run an Evaluation Test Case. + + To run an evaluation test case, send a POST request to ``/v2/gen-ai/evaluation_runs``. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Agent UUIDs to run the test case against. + ], + "run_name": "str", # Optional. The name of the run. + "test_case_uuid": "str" # Optional. Test-case UUID to run. + } + + # response body for status code(s): 200 + response == { + "evaluation_run_uuids": [ + "str" # Optional. + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def run_evaluation_test_case( + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Run an Evaluation Test Case. + + To run an evaluation test case, send a POST request to ``/v2/gen-ai/evaluation_runs``. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "evaluation_run_uuids": [ + "str" # Optional. + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + @distributed_trace - def get_indexing_job(self, uuid: str, **kwargs: Any) -> JSON: + def run_evaluation_test_case( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """Retrieve Status of Indexing Job for a Knowledge Base. + """Run an Evaluation Test Case. - To get status of an indexing Job for a knowledge base, send a GET request to - ``/v2/gen-ai/indexing_jobs/{uuid}``. + To run an evaluation test case, send a POST request to ``/v2/gen-ai/evaluation_runs``. - :param uuid: Indexing job id. Required. - :type uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -208292,32 +211313,20 @@ def get_indexing_job(self, uuid: str, **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Agent UUIDs to run the test case against. + ], + "run_name": "str", # Optional. The name of the run. + "test_case_uuid": "str" # Optional. Test-case UUID to run. + } + # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. - } + "evaluation_run_uuids": [ + "str" # Optional. + ] } # response body for status code(s): 404 response == { @@ -208344,13 +211353,29 @@ def get_indexing_job(self, uuid: str, **kwargs: Any) -> JSON: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_get_indexing_job_request( - uuid=uuid, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_run_evaluation_test_case_request( + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -208409,28 +211434,16 @@ def get_indexing_job(self, uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore - @overload - def cancel_indexing_job( - self, - uuid: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> JSON: + @distributed_trace + def get_evaluation_run(self, evaluation_run_uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Cancel Indexing Job for a Knowledge Base. + """Retrieve Information About an Existing Evaluation Run. - To cancel an indexing job for a knowledge base, send a PUT request to - ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + To retrive information about an existing evaluation run, send a GET request to + ``/v2/gen-ai/evaluation_runs/{evaluation_run_uuid}``. - :param uuid: A unique identifier for an indexing job. Required. - :type uuid: str - :param body: Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str + :param evaluation_run_uuid: Evaluation run UUID. Required. + :type evaluation_run_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -208438,36 +211451,70 @@ def cancel_indexing_job( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "uuid": "str" # Optional. A unique identifier for an indexing job. - } - # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. + "evaluation_run": { + "agent_deleted": bool, # Optional. Whether agent is deleted. + "agent_name": "str", # Optional. Agent name. + "agent_uuid": "str", # Optional. Agent UUID. + "agent_version_hash": "str", # Optional. Version hash. + "agent_workspace_uuid": "str", # Optional. Agent workspace uuid. + "created_by_user_email": "str", # Optional. + "created_by_user_id": "str", # Optional. + "error_description": "str", # Optional. The error description. + "evaluation_run_uuid": "str", # Optional. Evaluation run UUID. + "evaluation_test_case_workspace_uuid": "str", # Optional. Evaluation + test case workspace uuid. + "finished_at": "2020-02-20 00:00:00", # Optional. Run end time. + "pass_status": bool, # Optional. The pass status of the evaluation + run based on the star metric. + "queued_at": "2020-02-20 00:00:00", # Optional. Run queued time. + "run_level_metric_results": [ + { + "error_description": "str", # Optional. Error + description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", + # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the + metric as a number. + "reasoning": "str", # Optional. Reasoning of the + metric result. + "string_value": "str" # Optional. The value of the + metric as a string. + } ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. + "run_name": "str", # Optional. Run name. + "star_metric_result": { + "error_description": "str", # Optional. Error description if + the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values + are: "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the metric as + a number. + "reasoning": "str", # Optional. Reasoning of the metric + result. + "string_value": "str" # Optional. The value of the metric as + a string. + }, + "started_at": "2020-02-20 00:00:00", # Optional. Run start time. + "status": "EVALUATION_RUN_STATUS_UNSPECIFIED", # Optional. Default + value is "EVALUATION_RUN_STATUS_UNSPECIFIED". Evaluation Run Statuses. Known + values are: "EVALUATION_RUN_STATUS_UNSPECIFIED", "EVALUATION_RUN_QUEUED", + "EVALUATION_RUN_RUNNING_DATASET", "EVALUATION_RUN_EVALUATING_RESULTS", + "EVALUATION_RUN_CANCELLING", "EVALUATION_RUN_CANCELLED", + "EVALUATION_RUN_SUCCESSFUL", "EVALUATION_RUN_PARTIALLY_SUCCESSFUL", and + "EVALUATION_RUN_FAILED". + "test_case_description": "str", # Optional. Test case description. + "test_case_name": "str", # Optional. Test case name. + "test_case_uuid": "str", # Optional. Test-case UUID. + "test_case_version": 0 # Optional. Test-case-version. } } # response body for status code(s): 404 @@ -208482,29 +211529,105 @@ def cancel_indexing_job( tickets to help identify the issue. } """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - def cancel_indexing_job( + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_get_evaluation_run_request( + evaluation_run_uuid=evaluation_run_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_evaluation_run_results( self, - uuid: str, - body: Optional[IO[bytes]] = None, + evaluation_run_uuid: str, *, - content_type: str = "application/json", + page: Optional[int] = None, + per_page: Optional[int] = None, **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Cancel Indexing Job for a Knowledge Base. + """Retrieve Results of an Evaluation Run. - To cancel an indexing job for a knowledge base, send a PUT request to - ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + To retrieve results of an evaluation run, send a GET request to + ``/v2/gen-ai/evaluation_runs/{evaluation_run_uuid}/results``. - :param uuid: A unique identifier for an indexing job. Required. - :type uuid: str - :param body: Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str + :param evaluation_run_uuid: Evaluation run UUID. Required. + :type evaluation_run_uuid: str + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -208514,30 +211637,128 @@ def cancel_indexing_job( # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. + "evaluation_run": { + "agent_deleted": bool, # Optional. Whether agent is deleted. + "agent_name": "str", # Optional. Agent name. + "agent_uuid": "str", # Optional. Agent UUID. + "agent_version_hash": "str", # Optional. Version hash. + "agent_workspace_uuid": "str", # Optional. Agent workspace uuid. + "created_by_user_email": "str", # Optional. + "created_by_user_id": "str", # Optional. + "error_description": "str", # Optional. The error description. + "evaluation_run_uuid": "str", # Optional. Evaluation run UUID. + "evaluation_test_case_workspace_uuid": "str", # Optional. Evaluation + test case workspace uuid. + "finished_at": "2020-02-20 00:00:00", # Optional. Run end time. + "pass_status": bool, # Optional. The pass status of the evaluation + run based on the star metric. + "queued_at": "2020-02-20 00:00:00", # Optional. Run queued time. + "run_level_metric_results": [ + { + "error_description": "str", # Optional. Error + description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", + # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the + metric as a number. + "reasoning": "str", # Optional. Reasoning of the + metric result. + "string_value": "str" # Optional. The value of the + metric as a string. + } ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. - } + "run_name": "str", # Optional. Run name. + "star_metric_result": { + "error_description": "str", # Optional. Error description if + the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values + are: "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the metric as + a number. + "reasoning": "str", # Optional. Reasoning of the metric + result. + "string_value": "str" # Optional. The value of the metric as + a string. + }, + "started_at": "2020-02-20 00:00:00", # Optional. Run start time. + "status": "EVALUATION_RUN_STATUS_UNSPECIFIED", # Optional. Default + value is "EVALUATION_RUN_STATUS_UNSPECIFIED". Evaluation Run Statuses. Known + values are: "EVALUATION_RUN_STATUS_UNSPECIFIED", "EVALUATION_RUN_QUEUED", + "EVALUATION_RUN_RUNNING_DATASET", "EVALUATION_RUN_EVALUATING_RESULTS", + "EVALUATION_RUN_CANCELLING", "EVALUATION_RUN_CANCELLED", + "EVALUATION_RUN_SUCCESSFUL", "EVALUATION_RUN_PARTIALLY_SUCCESSFUL", and + "EVALUATION_RUN_FAILED". + "test_case_description": "str", # Optional. Test case description. + "test_case_name": "str", # Optional. Test case name. + "test_case_uuid": "str", # Optional. Test-case UUID. + "test_case_version": 0 # Optional. Test-case-version. + }, + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + }, + "prompts": [ + { + "ground_truth": "str", # Optional. The ground truth for the + prompt. + "input": "str", # Optional. The prompt level results. + "input_tokens": "str", # Optional. The number of input + tokens used in the prompt. + "output": "str", # Optional. The prompt level results. + "output_tokens": "str", # Optional. The number of output + tokens used in the prompt. + "prompt_chunks": [ + { + "chunk_usage_pct": 0.0, # Optional. The + usage percentage of the chunk. + "chunk_used": bool, # Optional. Indicates if + the chunk was used in the prompt. + "index_uuid": "str", # Optional. The index + uuid (Knowledge Base) of the chunk. + "source_name": "str", # Optional. The source + name for the chunk, e.g., the file name or document title. + "text": "str" # Optional. Text content of + the chunk. + } + ], + "prompt_id": 0, # Optional. Prompt ID. + "prompt_level_metric_results": [ + { + "error_description": "str", # Optional. + Error description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric + name. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value + of the metric as a number. + "reasoning": "str", # Optional. Reasoning of + the metric result. + "string_value": "str" # Optional. The value + of the metric as a string. + } + ] + } + ] } # response body for status code(s): 404 response == { @@ -208551,21 +211772,100 @@ def cancel_indexing_job( tickets to help identify the issue. } """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_get_evaluation_run_results_request( + evaluation_run_uuid=evaluation_run_uuid, + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore @distributed_trace - def cancel_indexing_job( - self, uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + def get_evaluation_run_prompt_results( + self, evaluation_run_uuid: str, prompt_id: int, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Cancel Indexing Job for a Knowledge Base. + """Retrieve Results of an Evaluation Run Prompt. - To cancel an indexing job for a knowledge base, send a PUT request to - ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + To retrieve results of an evaluation run, send a GET request to + ``/v2/gen-ai/evaluation_runs/{evaluation_run_uuid}/results/{prompt_id}``. - :param uuid: A unique identifier for an indexing job. Required. - :type uuid: str - :param body: Is either a JSON type or a IO[bytes] type. Default value is None. - :type body: JSON or IO[bytes] + :param evaluation_run_uuid: Evaluation run UUID. Required. + :type evaluation_run_uuid: str + :param prompt_id: Prompt ID to get results for. Required. + :type prompt_id: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -208573,36 +211873,48 @@ def cancel_indexing_job( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "uuid": "str" # Optional. A unique identifier for an indexing job. - } - # response body for status code(s): 200 response == { - "job": { - "completed_datasources": 0, # Optional. Number of datasources - indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. + "prompt": { + "ground_truth": "str", # Optional. The ground truth for the prompt. + "input": "str", # Optional. + "input_tokens": "str", # Optional. The number of input tokens used + in the prompt. + "output": "str", # Optional. + "output_tokens": "str", # Optional. The number of output tokens used + in the prompt. + "prompt_chunks": [ + { + "chunk_usage_pct": 0.0, # Optional. The usage + percentage of the chunk. + "chunk_used": bool, # Optional. Indicates if the + chunk was used in the prompt. + "index_uuid": "str", # Optional. The index uuid + (Knowledge Base) of the chunk. + "source_name": "str", # Optional. The source name + for the chunk, e.g., the file name or document title. + "text": "str" # Optional. Text content of the chunk. + } ], - "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is - "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources being - indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str" # Optional. Unique id. + "prompt_id": 0, # Optional. Prompt ID. + "prompt_level_metric_results": [ + { + "error_description": "str", # Optional. Error + description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", + # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the + metric as a number. + "reasoning": "str", # Optional. Reasoning of the + metric result. + "string_value": "str" # Optional. The value of the + metric as a string. + } + ] } } # response body for status code(s): 404 @@ -208630,30 +211942,14 @@ def cancel_indexing_job( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) cls: ClsType[JSON] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _json = body - else: - _json = None - - _request = build_genai_cancel_indexing_job_request( - uuid=uuid, - content_type=content_type, - json=_json, - content=_content, + _request = build_genai_get_evaluation_run_prompt_results_request( + evaluation_run_uuid=evaluation_run_uuid, + prompt_id=prompt_id, headers=_headers, params=_params, ) @@ -208713,22 +212009,12 @@ def cancel_indexing_job( return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_knowledge_bases( - self, - *, - page: Optional[int] = None, - per_page: Optional[int] = None, - **kwargs: Any, - ) -> JSON: + def list_evaluation_test_cases(self, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """List Knowledge Bases. + """List Evaluation Test Cases. - To list all knowledge bases, send a GET request to ``/v2/gen-ai/knowledge_bases``. + To list all evaluation test cases, send a GET request to ``/v2/gen-ai/evaluation_test_cases``. - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -208738,71 +212024,109 @@ def list_knowledge_bases( # response body for status code(s): 200 response == { - "knowledge_bases": [ + "evaluation_test_cases": [ { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time - when the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "database_id": "str", # Optional. The knowledge bases. - "embedding_model_uuid": "str", # Optional. The knowledge - bases. - "is_public": bool, # Optional. Whether the knowledge base is - public or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. + "archived_at": "2020-02-20 00:00:00", # Optional. + Alternative way of authentication for internal usage only - should not be + exposed to public api. + "created_at": "2020-02-20 00:00:00", # Optional. Alternative + way of authentication for internal usage only - should not be exposed to + public api. + "created_by_user_email": "str", # Optional. Alternative way + of authentication for internal usage only - should not be exposed to + public api. + "created_by_user_id": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "dataset": { "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge - base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. - Default value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of - datasources being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "uuid": "str" # Optional. Unique id. + Time created at. + "dataset_name": "str", # Optional. Name of the + dataset. + "dataset_uuid": "str", # Optional. UUID of the + dataset. + "file_size": "str", # Optional. The size of the + dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does the + dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in the + dataset. }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. The knowledge bases. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "user_id": "str", # Optional. Id of user that created the - knowledge base. - "uuid": "str" # Optional. Unique id for knowledge base. - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. + "dataset_name": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "dataset_uuid": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "description": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "latest_version_number_of_runs": 0, # Optional. Alternative + way of authentication for internal usage only - should not be exposed to + public api. + "metrics": [ + { + "description": "str", # Optional. + Alternative way of authentication for internal usage only - + should not be exposed to public api. + "inverted": bool, # Optional. If true, the + metric is inverted, meaning that a lower value is better. + "metric_name": "str", # Optional. + Alternative way of authentication for internal usage only - + should not be exposed to public api. + "metric_type": "METRIC_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_TYPE_UNSPECIFIED". Known + values are: "METRIC_TYPE_UNSPECIFIED", + "METRIC_TYPE_GENERAL_QUALITY", and "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Alternative way of authentication for internal usage only - + should not be exposed to public api. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The maximum + value for the metric. + "range_min": 0.0 # Optional. The minimum + value for the metric. + } + ], + "name": "str", # Optional. Alternative way of authentication + for internal usage only - should not be exposed to public api. + "star_metric": { + "metric_uuid": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to + public api. + "name": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to + public api. + "success_threshold": 0.0, # Optional. The success + threshold for the star metric. This is a value that the metric must + reach to be considered successful. + "success_threshold_pct": 0 # Optional. The success + threshold for the star metric. This is a percentage value between 0 + and 100. + }, + "test_case_uuid": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "total_runs": 0, # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "updated_at": "2020-02-20 00:00:00", # Optional. Alternative + way of authentication for internal usage only - should not be exposed to + public api. + "updated_by_user_email": "str", # Optional. Alternative way + of authentication for internal usage only - should not be exposed to + public api. + "updated_by_user_id": "str", # Optional. Alternative way of + authentication for internal usage only - should not be exposed to public + api. + "version": 0 # Optional. Alternative way of authentication + for internal usage only - should not be exposed to public api. } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. - } + ] } # response body for status code(s): 404 response == { @@ -208834,9 +212158,7 @@ def list_knowledge_bases( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_knowledge_bases_request( - page=page, - per_page=per_page, + _request = build_genai_list_evaluation_test_cases_request( headers=_headers, params=_params, ) @@ -208896,7 +212218,7 @@ def list_knowledge_bases( return cast(JSON, deserialized) # type: ignore @overload - def create_knowledge_base( + def create_evaluation_test_case( self, body: Optional[JSON] = None, *, @@ -208904,9 +212226,9 @@ def create_knowledge_base( **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Create a Knowledge Base. + """Create Evaluation Test Case. - To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. + To create an evaluation test-case send a POST request to ``/v2/gen-ai/evaluation_test_cases``. :param body: Default value is None. :type body: JSON @@ -208922,124 +212244,28 @@ def create_knowledge_base( # JSON input template you can fill out and use as your body input. body = { - "database_id": "str", # Optional. Identifier of the DigitalOcean OpenSearch - database this knowledge base will use, optional. If not provided, we create a new - database for the knowledge base in the same region as the knowledge base. - "datasources": [ - { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. AWS S3 Data Source. - "key_id": "str", # Optional. The AWS Key ID. - "region": "str", # Optional. Region of bucket. - "secret_key": "str" # Optional. The AWS Secret Key. - }, - "bucket_name": "str", # Optional. Deprecated, moved to - data_source_details. - "bucket_region": "str", # Optional. Deprecated, moved to - data_source_details. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The - original file name. - "size_in_bytes": "str", # Optional. The size of the - file in bytes. - "stored_object_key": "str" # Optional. The object - key the file was stored as. - }, - "item_path": "str", # Optional. The data sources to use for - this knowledge base. See `Organize Data Sources - `_ - for more information on data sources best practices. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. Spaces Bucket Data - Source. - "region": "str" # Optional. Region of bucket. - }, - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to - crawl. - "crawling_option": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Options for specifying how URLs found on pages - should be handled. * UNKNOWN: Default unknown value * SCOPED: Only - include the base URL. * PATH: Crawl the base URL and linked pages - within the URL path. * DOMAIN: Crawl the base URL and linked pages - within the same domain. * SUBDOMAINS: Crawl the base URL and linked - pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", - "PATH", "DOMAIN", and "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest - and index media (images, etc.) on web pages. - } - } - ], - "embedding_model_uuid": "str", # Optional. Identifier for the `embedding - model - `_. - "name": "str", # Optional. Name of the knowledge base. - "project_id": "str", # Optional. Identifier of the DigitalOcean project this - knowledge base will belong to.:code:`
`Requires ``tag:create`` scope. - "region": "str", # Optional. The datacenter region to deploy the knowledge - base in. - "tags": [ - "str" # Optional. Tags to organize your knowledge - base..:code:`
`Requires ``tag:update`` scope. + "dataset_uuid": "str", # Optional. Dataset against which the test"u2011case + is executed. + "description": "str", # Optional. Description of the test case. + "metrics": [ + "str" # Optional. Full metric list to use for evaluation test case. ], - "vpc_uuid": "str" # Optional. The VPC to deploy the knowledge base database - in..:code:`
`Requires ``vpc:update`` scope. + "name": "str", # Optional. Name of the test case. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success threshold for the + star metric. This is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # Optional. The success threshold for the + star metric. This is a percentage value between 0 and 100. + }, + "workspace_uuid": "str" # Optional. The workspace uuid. } # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. - } + "test_case_uuid": "str" # Optional. Test"u2011case UUID. } # response body for status code(s): 404 response == { @@ -209055,7 +212281,7 @@ def create_knowledge_base( """ @overload - def create_knowledge_base( + def create_evaluation_test_case( self, body: Optional[IO[bytes]] = None, *, @@ -209063,9 +212289,9 @@ def create_knowledge_base( **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Create a Knowledge Base. + """Create Evaluation Test Case. - To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. + To create an evaluation test-case send a POST request to ``/v2/gen-ai/evaluation_test_cases``. :param body: Default value is None. :type body: IO[bytes] @@ -209081,54 +212307,7 @@ def create_knowledge_base( # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. - } + "test_case_uuid": "str" # Optional. Test"u2011case UUID. } # response body for status code(s): 404 response == { @@ -209144,13 +212323,13 @@ def create_knowledge_base( """ @distributed_trace - def create_knowledge_base( + def create_evaluation_test_case( self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a Knowledge Base. + """Create Evaluation Test Case. - To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. + To create an evaluation test-case send a POST request to ``/v2/gen-ai/evaluation_test_cases``. :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] @@ -209163,124 +212342,28 @@ def create_knowledge_base( # JSON input template you can fill out and use as your body input. body = { - "database_id": "str", # Optional. Identifier of the DigitalOcean OpenSearch - database this knowledge base will use, optional. If not provided, we create a new - database for the knowledge base in the same region as the knowledge base. - "datasources": [ - { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. AWS S3 Data Source. - "key_id": "str", # Optional. The AWS Key ID. - "region": "str", # Optional. Region of bucket. - "secret_key": "str" # Optional. The AWS Secret Key. - }, - "bucket_name": "str", # Optional. Deprecated, moved to - data_source_details. - "bucket_region": "str", # Optional. Deprecated, moved to - data_source_details. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The - original file name. - "size_in_bytes": "str", # Optional. The size of the - file in bytes. - "stored_object_key": "str" # Optional. The object - key the file was stored as. - }, - "item_path": "str", # Optional. The data sources to use for - this knowledge base. See `Organize Data Sources - `_ - for more information on data sources best practices. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. Spaces Bucket Data - Source. - "region": "str" # Optional. Region of bucket. - }, - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to - crawl. - "crawling_option": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Options for specifying how URLs found on pages - should be handled. * UNKNOWN: Default unknown value * SCOPED: Only - include the base URL. * PATH: Crawl the base URL and linked pages - within the URL path. * DOMAIN: Crawl the base URL and linked pages - within the same domain. * SUBDOMAINS: Crawl the base URL and linked - pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", - "PATH", "DOMAIN", and "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest - and index media (images, etc.) on web pages. - } - } - ], - "embedding_model_uuid": "str", # Optional. Identifier for the `embedding - model - `_. - "name": "str", # Optional. Name of the knowledge base. - "project_id": "str", # Optional. Identifier of the DigitalOcean project this - knowledge base will belong to.:code:`
`Requires ``tag:create`` scope. - "region": "str", # Optional. The datacenter region to deploy the knowledge - base in. - "tags": [ - "str" # Optional. Tags to organize your knowledge - base..:code:`
`Requires ``tag:update`` scope. + "dataset_uuid": "str", # Optional. Dataset against which the test"u2011case + is executed. + "description": "str", # Optional. Description of the test case. + "metrics": [ + "str" # Optional. Full metric list to use for evaluation test case. ], - "vpc_uuid": "str" # Optional. The VPC to deploy the knowledge base database - in..:code:`
`Requires ``vpc:update`` scope. + "name": "str", # Optional. Name of the test case. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success threshold for the + star metric. This is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # Optional. The success threshold for the + star metric. This is a percentage value between 0 and 100. + }, + "workspace_uuid": "str" # Optional. The workspace uuid. } # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. - } + "test_case_uuid": "str" # Optional. Test"u2011case UUID. } # response body for status code(s): 404 response == { @@ -209326,7 +212409,7 @@ def create_knowledge_base( else: _json = None - _request = build_genai_create_knowledge_base_request( + _request = build_genai_create_evaluation_test_case_request( content_type=content_type, json=_json, content=_content, @@ -209389,26 +212472,23 @@ def create_knowledge_base( return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_knowledge_base_data_sources( + def list_evaluation_runs_by_test_case( self, - knowledge_base_uuid: str, + evaluation_test_case_uuid: str, *, - page: Optional[int] = None, - per_page: Optional[int] = None, + evaluation_test_case_version: Optional[int] = None, **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """List Data Sources for a Knowledge Base. + """List Evaluation Runs by Test Case. - To list all data sources for a knowledge base, send a GET request to - ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. + To list all evaluation runs by test case, send a GET request to + ``/v2/gen-ai/evaluation_test_cases/{evaluation_test_case_uuid}/evaluation_runs``. - :param knowledge_base_uuid: Knowledge base id. Required. - :type knowledge_base_uuid: str - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int + :param evaluation_test_case_uuid: Evaluation run UUID. Required. + :type evaluation_test_case_uuid: str + :keyword evaluation_test_case_version: Version of the test case. Default value is None. + :paramtype evaluation_test_case_version: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -209418,96 +212498,259 @@ def list_knowledge_base_data_sources( # response body for status code(s): 200 response == { - "knowledge_base_data_sources": [ + "evaluation_runs": [ { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. AWS S3 Data Source - for Display. - "region": "str" # Optional. Region of bucket. - }, - "bucket_name": "str", # Optional. Name of storage bucket - - Deprecated, moved to data_source_details. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The - original file name. - "size_in_bytes": "str", # Optional. The size of the - file in bytes. - "stored_object_key": "str" # Optional. The object - key the file was stored as. - }, - "item_path": "str", # Optional. Path of folder or object in - bucket - Deprecated, moved to data_source_details. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge - base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. - Default value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of - datasources being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "uuid": "str" # Optional. Unique id. - }, - "region": "str", # Optional. Region code - Deprecated, moved - to data_source_details. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket - name. - "item_path": "str", # Optional. Spaces Bucket Data - Source. - "region": "str" # Optional. Region of bucket. + "agent_deleted": bool, # Optional. Whether agent is deleted. + "agent_name": "str", # Optional. Agent name. + "agent_uuid": "str", # Optional. Agent UUID. + "agent_version_hash": "str", # Optional. Version hash. + "agent_workspace_uuid": "str", # Optional. Agent workspace + uuid. + "created_by_user_email": "str", # Optional. List of + evaluation runs. + "created_by_user_id": "str", # Optional. List of evaluation + runs. + "error_description": "str", # Optional. The error + description. + "evaluation_run_uuid": "str", # Optional. Evaluation run + UUID. + "evaluation_test_case_workspace_uuid": "str", # Optional. + Evaluation test case workspace uuid. + "finished_at": "2020-02-20 00:00:00", # Optional. Run end + time. + "pass_status": bool, # Optional. The pass status of the + evaluation run based on the star metric. + "queued_at": "2020-02-20 00:00:00", # Optional. Run queued + time. + "run_level_metric_results": [ + { + "error_description": "str", # Optional. + Error description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric + name. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value + of the metric as a number. + "reasoning": "str", # Optional. Reasoning of + the metric result. + "string_value": "str" # Optional. The value + of the metric as a string. + } + ], + "run_name": "str", # Optional. Run name. + "star_metric_result": { + "error_description": "str", # Optional. Error + description if the metric could not be calculated. + "metric_name": "str", # Optional. Metric name. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", + # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "number_value": 0.0, # Optional. The value of the + metric as a number. + "reasoning": "str", # Optional. Reasoning of the + metric result. + "string_value": "str" # Optional. The value of the + metric as a string. }, - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str", # Optional. Unique id of knowledge base. - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to - crawl. - "crawling_option": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Options for specifying how URLs found on pages - should be handled. * UNKNOWN: Default unknown value * SCOPED: Only - include the base URL. * PATH: Crawl the base URL and linked pages - within the URL path. * DOMAIN: Crawl the base URL and linked pages - within the same domain. * SUBDOMAINS: Crawl the base URL and linked - pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", - "PATH", "DOMAIN", and "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest - and index media (images, etc.) on web pages. - } - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. + "started_at": "2020-02-20 00:00:00", # Optional. Run start + time. + "status": "EVALUATION_RUN_STATUS_UNSPECIFIED", # Optional. + Default value is "EVALUATION_RUN_STATUS_UNSPECIFIED". Evaluation Run + Statuses. Known values are: "EVALUATION_RUN_STATUS_UNSPECIFIED", + "EVALUATION_RUN_QUEUED", "EVALUATION_RUN_RUNNING_DATASET", + "EVALUATION_RUN_EVALUATING_RESULTS", "EVALUATION_RUN_CANCELLING", + "EVALUATION_RUN_CANCELLED", "EVALUATION_RUN_SUCCESSFUL", + "EVALUATION_RUN_PARTIALLY_SUCCESSFUL", and "EVALUATION_RUN_FAILED". + "test_case_description": "str", # Optional. Test case + description. + "test_case_name": "str", # Optional. Test case name. + "test_case_uuid": "str", # Optional. Test-case UUID. + "test_case_version": 0 # Optional. Test-case-version. } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_evaluation_runs_by_test_case_request( + evaluation_test_case_uuid=evaluation_test_case_uuid, + evaluation_test_case_version=evaluation_test_case_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_evaluation_test_case( + self, + test_case_uuid: str, + *, + evaluation_test_case_version: Optional[int] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Retrieve Information About an Existing Evaluation Test Case. + + To retrive information about an existing evaluation test case, send a GET request to + ``/v2/gen-ai/evaluation_test_case/{test_case_uuid}``. + + :param test_case_uuid: The test case uuid to retrieve. Required. + :type test_case_uuid: str + :keyword evaluation_test_case_version: Version of the test case. Default value is None. + :paramtype evaluation_test_case_version: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "evaluation_test_case": { + "archived_at": "2020-02-20 00:00:00", # Optional. + "created_at": "2020-02-20 00:00:00", # Optional. + "created_by_user_email": "str", # Optional. + "created_by_user_id": "str", # Optional. + "dataset": { + "created_at": "2020-02-20 00:00:00", # Optional. Time + created at. + "dataset_name": "str", # Optional. Name of the dataset. + "dataset_uuid": "str", # Optional. UUID of the dataset. + "file_size": "str", # Optional. The size of the dataset + uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does the dataset have + a ground truth column?. + "row_count": 0 # Optional. Number of rows in the dataset. + }, + "dataset_name": "str", # Optional. + "dataset_uuid": "str", # Optional. + "description": "str", # Optional. + "latest_version_number_of_runs": 0, # Optional. + "metrics": [ + { + "description": "str", # Optional. + "inverted": bool, # Optional. If true, the metric is + inverted, meaning that a lower value is better. + "metric_name": "str", # Optional. + "metric_type": "METRIC_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_TYPE_UNSPECIFIED". Known values + are: "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + "metric_value_type": "METRIC_VALUE_TYPE_UNSPECIFIED", + # Optional. Default value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The maximum value for + the metric. + "range_min": 0.0 # Optional. The minimum value for + the metric. + } + ], + "name": "str", # Optional. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success threshold + for the star metric. This is a value that the metric must reach to be + considered successful. + "success_threshold_pct": 0 # Optional. The success threshold + for the star metric. This is a percentage value between 0 and 100. + }, + "test_case_uuid": "str", # Optional. + "total_runs": 0, # Optional. + "updated_at": "2020-02-20 00:00:00", # Optional. + "updated_by_user_email": "str", # Optional. + "updated_by_user_id": "str", # Optional. + "version": 0 # Optional. } } # response body for status code(s): 404 @@ -209540,10 +212783,9 @@ def list_knowledge_base_data_sources( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_knowledge_base_data_sources_request( - knowledge_base_uuid=knowledge_base_uuid, - page=page, - per_page=per_page, + _request = build_genai_get_evaluation_test_case_request( + test_case_uuid=test_case_uuid, + evaluation_test_case_version=evaluation_test_case_version, headers=_headers, params=_params, ) @@ -209603,22 +212845,22 @@ def list_knowledge_base_data_sources( return cast(JSON, deserialized) # type: ignore @overload - def create_knowledge_base_data_source( + def update_evaluation_test_case( self, - knowledge_base_uuid: str, + test_case_uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Add Data Source to a Knowledge Base. + """Update an Evaluation Test Case. - To add a data source to a knowledge base, send a POST request to - ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. + To update an evaluation test-case send a PUT request to + ``/v2/gen-ai/evaluation_test_cases/{test_case_uuid}``. - :param knowledge_base_uuid: Knowledge base id. Required. - :type knowledge_base_uuid: str + :param test_case_uuid: Test-case UUID to update. Required. + :type test_case_uuid: str :param body: Default value is None. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -209633,105 +212875,31 @@ def create_knowledge_base_data_source( # JSON input template you can fill out and use as your body input. body = { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. AWS S3 Data Source. - "key_id": "str", # Optional. The AWS Key ID. - "region": "str", # Optional. Region of bucket. - "secret_key": "str" # Optional. The AWS Secret Key. + "dataset_uuid": "str", # Optional. Dataset against which the test"u2011case + is executed. + "description": "str", # Optional. Description of the test case. + "metrics": { + "metric_uuids": [ + "str" # Optional. + ] }, - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. Spaces Bucket Data Source. - "region": "str" # Optional. Region of bucket. + "name": "str", # Optional. Name of the test case. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success threshold for the + star metric. This is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # Optional. The success threshold for the + star metric. This is a percentage value between 0 and 100. }, - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to crawl. - "crawling_option": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Options for specifying how URLs found on pages should be handled. - * UNKNOWN: Default unknown value * SCOPED: Only include the base URL. * PATH: - Crawl the base URL and linked pages within the URL path. * DOMAIN: Crawl the - base URL and linked pages within the same domain. * SUBDOMAINS: Crawl the - base URL and linked pages for any subdomain. Known values are: "UNKNOWN", - "SCOPED", "PATH", "DOMAIN", and "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest and index media - (images, etc.) on web pages. - } + "test_case_uuid": "str" # Optional. Test-case UUID to update. } # response body for status code(s): 200 response == { - "knowledge_base_data_source": { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. AWS S3 Data Source for - Display. - "region": "str" # Optional. Region of bucket. - }, - "bucket_name": "str", # Optional. Name of storage bucket - - Deprecated, moved to data_source_details. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The original file - name. - "size_in_bytes": "str", # Optional. The size of the file in - bytes. - "stored_object_key": "str" # Optional. The object key the - file was stored as. - }, - "item_path": "str", # Optional. Path of folder or object in bucket - - Deprecated, moved to data_source_details. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "region": "str", # Optional. Region code - Deprecated, moved to - data_source_details. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. Spaces Bucket Data Source. - "region": "str" # Optional. Region of bucket. - }, - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str", # Optional. Unique id of knowledge base. - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to crawl. - "crawling_option": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Options for specifying how URLs found on pages should be - handled. * UNKNOWN: Default unknown value * SCOPED: Only include the - base URL. * PATH: Crawl the base URL and linked pages within the URL - path. * DOMAIN: Crawl the base URL and linked pages within the same - domain. * SUBDOMAINS: Crawl the base URL and linked pages for any - subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and - "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest and index - media (images, etc.) on web pages. - } - } + "test_case_uuid": "str", # Optional. + "version": 0 # Optional. The new verson of the test case. } # response body for status code(s): 404 response == { @@ -209747,22 +212915,22 @@ def create_knowledge_base_data_source( """ @overload - def create_knowledge_base_data_source( + def update_evaluation_test_case( self, - knowledge_base_uuid: str, + test_case_uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Add Data Source to a Knowledge Base. + """Update an Evaluation Test Case. - To add a data source to a knowledge base, send a POST request to - ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. + To update an evaluation test-case send a PUT request to + ``/v2/gen-ai/evaluation_test_cases/{test_case_uuid}``. - :param knowledge_base_uuid: Knowledge base id. Required. - :type knowledge_base_uuid: str + :param test_case_uuid: Test-case UUID to update. Required. + :type test_case_uuid: str :param body: Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -209777,76 +212945,8 @@ def create_knowledge_base_data_source( # response body for status code(s): 200 response == { - "knowledge_base_data_source": { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. AWS S3 Data Source for - Display. - "region": "str" # Optional. Region of bucket. - }, - "bucket_name": "str", # Optional. Name of storage bucket - - Deprecated, moved to data_source_details. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The original file - name. - "size_in_bytes": "str", # Optional. The size of the file in - bytes. - "stored_object_key": "str" # Optional. The object key the - file was stored as. - }, - "item_path": "str", # Optional. Path of folder or object in bucket - - Deprecated, moved to data_source_details. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "region": "str", # Optional. Region code - Deprecated, moved to - data_source_details. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. Spaces Bucket Data Source. - "region": "str" # Optional. Region of bucket. - }, - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str", # Optional. Unique id of knowledge base. - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to crawl. - "crawling_option": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Options for specifying how URLs found on pages should be - handled. * UNKNOWN: Default unknown value * SCOPED: Only include the - base URL. * PATH: Crawl the base URL and linked pages within the URL - path. * DOMAIN: Crawl the base URL and linked pages within the same - domain. * SUBDOMAINS: Crawl the base URL and linked pages for any - subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and - "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest and index - media (images, etc.) on web pages. - } - } + "test_case_uuid": "str", # Optional. + "version": 0 # Optional. The new verson of the test case. } # response body for status code(s): 404 response == { @@ -209862,20 +212962,20 @@ def create_knowledge_base_data_source( """ @distributed_trace - def create_knowledge_base_data_source( + def update_evaluation_test_case( self, - knowledge_base_uuid: str, + test_case_uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Add Data Source to a Knowledge Base. + """Update an Evaluation Test Case. - To add a data source to a knowledge base, send a POST request to - ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. + To update an evaluation test-case send a PUT request to + ``/v2/gen-ai/evaluation_test_cases/{test_case_uuid}``. - :param knowledge_base_uuid: Knowledge base id. Required. - :type knowledge_base_uuid: str + :param test_case_uuid: Test-case UUID to update. Required. + :type test_case_uuid: str :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] :return: JSON object @@ -209887,105 +212987,31 @@ def create_knowledge_base_data_source( # JSON input template you can fill out and use as your body input. body = { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. AWS S3 Data Source. - "key_id": "str", # Optional. The AWS Key ID. - "region": "str", # Optional. Region of bucket. - "secret_key": "str" # Optional. The AWS Secret Key. + "dataset_uuid": "str", # Optional. Dataset against which the test"u2011case + is executed. + "description": "str", # Optional. Description of the test case. + "metrics": { + "metric_uuids": [ + "str" # Optional. + ] }, - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. Spaces Bucket Data Source. - "region": "str" # Optional. Region of bucket. + "name": "str", # Optional. Name of the test case. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success threshold for the + star metric. This is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # Optional. The success threshold for the + star metric. This is a percentage value between 0 and 100. }, - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to crawl. - "crawling_option": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Options for specifying how URLs found on pages should be handled. - * UNKNOWN: Default unknown value * SCOPED: Only include the base URL. * PATH: - Crawl the base URL and linked pages within the URL path. * DOMAIN: Crawl the - base URL and linked pages within the same domain. * SUBDOMAINS: Crawl the - base URL and linked pages for any subdomain. Known values are: "UNKNOWN", - "SCOPED", "PATH", "DOMAIN", and "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest and index media - (images, etc.) on web pages. - } + "test_case_uuid": "str" # Optional. Test-case UUID to update. } # response body for status code(s): 200 response == { - "knowledge_base_data_source": { - "aws_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. AWS S3 Data Source for - Display. - "region": "str" # Optional. Region of bucket. - }, - "bucket_name": "str", # Optional. Name of storage bucket - - Deprecated, moved to data_source_details. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "file_upload_data_source": { - "original_file_name": "str", # Optional. The original file - name. - "size_in_bytes": "str", # Optional. The size of the file in - bytes. - "stored_object_key": "str" # Optional. The object key the - file was stored as. - }, - "item_path": "str", # Optional. Path of folder or object in bucket - - Deprecated, moved to data_source_details. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "region": "str", # Optional. Region code - Deprecated, moved to - data_source_details. - "spaces_data_source": { - "bucket_name": "str", # Optional. Spaces bucket name. - "item_path": "str", # Optional. Spaces Bucket Data Source. - "region": "str" # Optional. Region of bucket. - }, - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "uuid": "str", # Optional. Unique id of knowledge base. - "web_crawler_data_source": { - "base_url": "str", # Optional. The base url to crawl. - "crawling_option": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Options for specifying how URLs found on pages should be - handled. * UNKNOWN: Default unknown value * SCOPED: Only include the - base URL. * PATH: Crawl the base URL and linked pages within the URL - path. * DOMAIN: Crawl the base URL and linked pages within the same - domain. * SUBDOMAINS: Crawl the base URL and linked pages for any - subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and - "SUBDOMAINS". - "embed_media": bool # Optional. Whether to ingest and index - media (images, etc.) on web pages. - } - } + "test_case_uuid": "str", # Optional. + "version": 0 # Optional. The new verson of the test case. } # response body for status code(s): 404 response == { @@ -210031,8 +213057,8 @@ def create_knowledge_base_data_source( else: _json = None - _request = build_genai_create_knowledge_base_data_source_request( - knowledge_base_uuid=knowledge_base_uuid, + _request = build_genai_update_evaluation_test_case_request( + test_case_uuid=test_case_uuid, content_type=content_type, json=_json, content=_content, @@ -210095,132 +213121,23 @@ def create_knowledge_base_data_source( return cast(JSON, deserialized) # type: ignore @distributed_trace - def delete_knowledge_base_data_source( - self, knowledge_base_uuid: str, data_source_uuid: str, **kwargs: Any + def list_indexing_jobs( + self, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Delete a Data Source from a Knowledge Base. - - To delete a data source from a knowledge base, send a DELETE request to - ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources/{data_source_uuid}``. - - :param knowledge_base_uuid: Knowledge base id. Required. - :type knowledge_base_uuid: str - :param data_source_uuid: Data source id. Required. - :type data_source_uuid: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "data_source_uuid": "str", # Optional. Data source id. - "knowledge_base_uuid": "str" # Optional. Knowledge base id. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_genai_delete_knowledge_base_data_source_request( - knowledge_base_uuid=knowledge_base_uuid, - data_source_uuid=data_source_uuid, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @distributed_trace - def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: - # pylint: disable=line-too-long - """Retrieve Information About an Existing Knowledge Base. + """List Indexing Jobs for a Knowledge Base. - To retrive information about an existing knowledge base, send a GET request to - ``/v2/gen-ai/knowledge_bases/{uuid}``. + To list all indexing jobs for a knowledge base, send a GET request to + ``/v2/gen-ai/indexing_jobs``. - :param uuid: Knowledge base id. Required. - :type uuid: str + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -210230,30 +213147,17 @@ def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "database_status": "CREATING", # Optional. Default value is "CREATING". - Known values are: "CREATING", "ONLINE", "POWEROFF", "REBUILDING", "REBALANCING", - "DECOMMISSIONED", "FORKING", "MIGRATING", "RESIZING", "RESTORING", "POWERING_ON", - and "UNHEALTHY". - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # Optional. Creation date / - time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { + "jobs": [ + { "completed_datasources": 0, # Optional. Number of datasources indexed completed. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "data_source_uuids": [ - "str" # Optional. IndexingJob description. + "str" # Optional. The indexing jobs. ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. + "finished_at": "2020-02-20 00:00:00", # Optional. The + indexing jobs. "knowledge_base_uuid": "str", # Optional. Knowledge base id. "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: @@ -210261,26 +213165,34 @@ def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. + "started_at": "2020-02-20 00:00:00", # Optional. The + indexing jobs. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # Optional. Number of datasources being indexed. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. } } # response body for status code(s): 404 @@ -210313,8 +213225,9 @@ def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_get_knowledge_base_request( - uuid=uuid, + _request = build_genai_list_indexing_jobs_request( + page=page, + per_page=per_page, headers=_headers, params=_params, ) @@ -210374,21 +213287,19 @@ def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @overload - def update_knowledge_base( + def create_indexing_job( self, - uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Update a Knowledge Base. + """Start Indexing Job for a Knowledge Base. - To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + To start an indexing job for a knowledge base, send a POST request to + ``/v2/gen-ai/indexing_jobs``. - :param uuid: Knowledge base id. Required. - :type uuid: str :param body: Default value is None. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -210403,69 +213314,43 @@ def update_knowledge_base( # JSON input template you can fill out and use as your body input. body = { - "database_id": "str", # Optional. The id of the DigitalOcean database this - knowledge base will use, optiona. - "embedding_model_uuid": "str", # Optional. Identifier for the foundation - model. - "name": "str", # Optional. Knowledge base name. - "project_id": "str", # Optional. The id of the DigitalOcean project this - knowledge base will belong to.:code:`
`Requires ``project:update`` scope. - "tags": [ - "str" # Optional. Tags to organize your knowledge - base..:code:`
`Requires ``tag:create`` scope. + "data_source_uuids": [ + "str" # Optional. List of data source ids to index, if none are + provided, all data sources will be indexed. ], - "uuid": "str" # Optional. Knowledge base id. + "knowledge_base_uuid": "str" # Optional. Knowledge base id. } # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -210482,21 +213367,19 @@ def update_knowledge_base( """ @overload - def update_knowledge_base( + def create_indexing_job( self, - uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Update a Knowledge Base. + """Start Indexing Job for a Knowledge Base. - To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + To start an indexing job for a knowledge base, send a POST request to + ``/v2/gen-ai/indexing_jobs``. - :param uuid: Knowledge base id. Required. - :type uuid: str :param body: Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -210511,53 +213394,34 @@ def update_knowledge_base( # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -210574,16 +213438,15 @@ def update_knowledge_base( """ @distributed_trace - def update_knowledge_base( - self, uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + def create_indexing_job( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update a Knowledge Base. + """Start Indexing Job for a Knowledge Base. - To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + To start an indexing job for a knowledge base, send a POST request to + ``/v2/gen-ai/indexing_jobs``. - :param uuid: Knowledge base id. Required. - :type uuid: str :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] :return: JSON object @@ -210595,69 +213458,43 @@ def update_knowledge_base( # JSON input template you can fill out and use as your body input. body = { - "database_id": "str", # Optional. The id of the DigitalOcean database this - knowledge base will use, optiona. - "embedding_model_uuid": "str", # Optional. Identifier for the foundation - model. - "name": "str", # Optional. Knowledge base name. - "project_id": "str", # Optional. The id of the DigitalOcean project this - knowledge base will belong to.:code:`
`Requires ``project:update`` scope. - "tags": [ - "str" # Optional. Tags to organize your knowledge - base..:code:`
`Requires ``tag:create`` scope. + "data_source_uuids": [ + "str" # Optional. List of data source ids to index, if none are + provided, all data sources will be indexed. ], - "uuid": "str" # Optional. Knowledge base id. + "knowledge_base_uuid": "str" # Optional. Knowledge base id. } # response body for status code(s): 200 response == { - "knowledge_base": { - "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when - the knowledge base was added to the agent. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "database_id": "str", # Optional. Knowledgebase Description. - "embedding_model_uuid": "str", # Optional. Knowledgebase - Description. - "is_public": bool, # Optional. Whether the knowledge base is public - or not. - "last_indexing_job": { - "completed_datasources": 0, # Optional. Number of - datasources indexed completed. - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "data_source_uuids": [ - "str" # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # Optional. - IndexingJob description. - "knowledge_base_uuid": "str", # Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default - value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: - "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", - "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", - "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and - "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "tokens": 0, # Optional. Number of tokens. - "total_datasources": 0, # Optional. Number of datasources - being indexed. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "uuid": "str" # Optional. Unique id. - }, - "name": "str", # Optional. Name of knowledge base. - "project_id": "str", # Optional. Knowledgebase Description. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize related - resources.:code:`
`Requires ``tag:read`` scope. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user that created the knowledge - base. - "uuid": "str" # Optional. Unique id for knowledge base. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -210704,8 +213541,7 @@ def update_knowledge_base( else: _json = None - _request = build_genai_update_knowledge_base_request( - uuid=uuid, + _request = build_genai_create_indexing_job_request( content_type=content_type, json=_json, content=_content, @@ -210768,14 +213604,17 @@ def update_knowledge_base( return cast(JSON, deserialized) # type: ignore @distributed_trace - def delete_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: + def list_indexing_job_data_sources( + self, indexing_job_uuid: str, **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """Delete a Knowledge Base. + """List Data Sources for Indexing Job for a Knowledge Base. - To delete a knowledge base, send a DELETE request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + To list all datasources for an indexing job, send a GET request to + ``/v2/gen-ai/indexing_jobs/{indexing_job_uuid}/data_sources``. - :param uuid: Knowledge base id. Required. - :type uuid: str + :param indexing_job_uuid: Uuid of the indexing job. Required. + :type indexing_job_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -210785,7 +213624,41 @@ def delete_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "uuid": "str" # Optional. The id of the deleted knowledge base. + "indexed_data_sources": [ + { + "completed_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source completed indexing. + "data_source_uuid": "str", # Optional. Uuid of the indexed + data source. + "error_details": "str", # Optional. A detailed error + description. + "error_msg": "str", # Optional. A string code provinding a + hint which part of the system experienced an error. + "failed_item_count": "str", # Optional. Total count of files + that have failed. + "indexed_file_count": "str", # Optional. Total count of + files that have been indexed. + "indexed_item_count": "str", # Optional. Total count of + files that have been indexed. + "removed_item_count": "str", # Optional. Total count of + files that have been removed. + "skipped_item_count": "str", # Optional. Total count of + files that have been skipped. + "started_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source started indexing. + "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. Default + value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: + "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", + "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", + "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". + "total_bytes": "str", # Optional. Total size of files in + data source in bytes. + "total_bytes_indexed": "str", # Optional. Total size of + files in data source in bytes that have been indexed. + "total_file_count": "str" # Optional. Total file count in + the data source. + } + ] } # response body for status code(s): 404 response == { @@ -210817,8 +213690,8 @@ def delete_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_delete_knowledge_base_request( - uuid=uuid, + _request = build_genai_list_indexing_job_data_sources_request( + indexing_job_uuid=indexing_job_uuid, headers=_headers, params=_params, ) @@ -210878,37 +213751,15 @@ def delete_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_models( - self, - *, - usecases: Optional[List[str]] = None, - public_only: Optional[bool] = None, - page: Optional[int] = None, - per_page: Optional[int] = None, - **kwargs: Any, - ) -> JSON: + def get_indexing_job(self, uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """List Available Models. - - To list all models, send a GET request to ``/v2/gen-ai/models``. - - :keyword usecases: Include only models defined for the listed usecases. + """Retrieve Status of Indexing Job for a Knowledge Base. + To get status of an indexing Job for a knowledge base, send a GET request to + ``/v2/gen-ai/indexing_jobs/{uuid}``. - * MODEL_USECASE_UNKNOWN: The use case of the model is unknown - * MODEL_USECASE_AGENT: The model maybe used in an agent - * MODEL_USECASE_FINETUNED: The model maybe used for fine tuning - * MODEL_USECASE_KNOWLEDGEBASE: The model maybe used for knowledge bases (embedding models) - * MODEL_USECASE_GUARDRAIL: The model maybe used for guardrails - * MODEL_USECASE_REASONING: The model usecase for reasoning - * MODEL_USECASE_SERVERLESS: The model usecase for serverless inference. Default value is None. - :paramtype usecases: list[str] - :keyword public_only: Only include models that are publicly available. Default value is None. - :paramtype public_only: bool - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int + :param uuid: Indexing job id. Required. + :type uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -210918,192 +213769,34 @@ def list_models( # response body for status code(s): 200 response == { - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. - } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. - }, - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement Description. - "url": "str", # Optional. Agreement Description. - "uuid": "str" # Optional. Agreement Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the model, - this model is based on. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "upload_complete": bool, # Optional. Model has been fully - uploaded. - "url": "str", # Optional. Download url. - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version number. - "minor": 0, # Optional. Minor version number. - "patch": 0 # Optional. Patch version number. - } - } - ] - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_genai_list_models_request( - usecases=usecases, - public_only=public_only, - page=page, - per_page=per_page, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @distributed_trace - def list_model_api_keys( - self, - *, - page: Optional[int] = None, - per_page: Optional[int] = None, - **kwargs: Any, - ) -> JSON: - # pylint: disable=line-too-long - """List Model API Keys. - - To list all model API keys, send a GET request to ``/v2/gen-ai/models/api_keys``. - - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "api_key_infos": [ - { - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted - date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Api key infos. - "uuid": "str" # Optional. Uuid. - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. - } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -211136,9 +213829,8 @@ def list_model_api_keys( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_model_api_keys_request( - page=page, - per_page=per_page, + _request = build_genai_get_indexing_job_request( + uuid=uuid, headers=_headers, params=_params, ) @@ -211198,18 +213890,22 @@ def list_model_api_keys( return cast(JSON, deserialized) # type: ignore @overload - def create_model_api_key( + def cancel_indexing_job( self, + uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Create a Model API Key. + """Cancel Indexing Job for a Knowledge Base. - To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. + To cancel an indexing job for a knowledge base, send a PUT request to + ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + :param uuid: A unique identifier for an indexing job. Required. + :type uuid: str :param body: Default value is None. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -211224,18 +213920,39 @@ def create_model_api_key( # JSON input template you can fill out and use as your body input. body = { - "name": "str" # Optional. A human friendly name to identify the key. + "uuid": "str" # Optional. A unique identifier for an indexing job. } # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -211252,18 +213969,22 @@ def create_model_api_key( """ @overload - def create_model_api_key( + def cancel_indexing_job( self, + uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Create a Model API Key. + """Cancel Indexing Job for a Knowledge Base. - To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. + To cancel an indexing job for a knowledge base, send a PUT request to + ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + :param uuid: A unique identifier for an indexing job. Required. + :type uuid: str :param body: Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -211278,13 +213999,34 @@ def create_model_api_key( # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -211301,14 +214043,17 @@ def create_model_api_key( """ @distributed_trace - def create_model_api_key( - self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + def cancel_indexing_job( + self, uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a Model API Key. + """Cancel Indexing Job for a Knowledge Base. - To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. + To cancel an indexing job for a knowledge base, send a PUT request to + ``/v2/gen-ai/indexing_jobs/{uuid}/cancel``. + :param uuid: A unique identifier for an indexing job. Required. + :type uuid: str :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] :return: JSON object @@ -211320,18 +214065,39 @@ def create_model_api_key( # JSON input template you can fill out and use as your body input. body = { - "name": "str" # Optional. A human friendly name to identify the key. + "uuid": "str" # Optional. A unique identifier for an indexing job. } # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "job": { + "completed_datasources": 0, # Optional. Number of datasources + indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources being + indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -211378,7 +214144,8 @@ def create_model_api_key( else: _json = None - _request = build_genai_create_model_api_key_request( + _request = build_genai_cancel_indexing_job_request( + uuid=uuid, content_type=content_type, json=_json, content=_content, @@ -211440,22 +214207,208 @@ def create_model_api_key( return cast(JSON, deserialized) # type: ignore + @distributed_trace + def list_knowledge_bases( + self, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """List Knowledge Bases. + + To list all knowledge bases, send a GET request to ``/v2/gen-ai/knowledge_bases``. + + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time + when the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "database_id": "str", # Optional. The knowledge bases. + "embedding_model_uuid": "str", # Optional. The knowledge + bases. + "is_public": bool, # Optional. Whether the knowledge base is + public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. + Default value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. + Default value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of + datasources being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. The knowledge bases. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related + resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "user_id": "str", # Optional. Id of user that created the + knowledge base. + "uuid": "str" # Optional. Unique id for knowledge base. + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_knowledge_bases_request( + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + @overload - def update_model_api_key( + def create_knowledge_base( self, - api_key_uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Update API Key for a Model. + """Create a Knowledge Base. - To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str :param body: Default value is None. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -211470,19 +214423,127 @@ def update_model_api_key( # JSON input template you can fill out and use as your body input. body = { - "api_key_uuid": "str", # Optional. API key ID. - "name": "str" # Optional. Name. + "database_id": "str", # Optional. Identifier of the DigitalOcean OpenSearch + database this knowledge base will use, optional. If not provided, we create a new + database for the knowledge base in the same region as the knowledge base. + "datasources": [ + { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. AWS S3 Data Source. + "key_id": "str", # Optional. The AWS Key ID. + "region": "str", # Optional. Region of bucket. + "secret_key": "str" # Optional. The AWS Secret Key. + }, + "bucket_name": "str", # Optional. Deprecated, moved to + data_source_details. + "bucket_region": "str", # Optional. Deprecated, moved to + data_source_details. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The + original file name. + "size_in_bytes": "str", # Optional. The size of the + file in bytes. + "stored_object_key": "str" # Optional. The object + key the file was stored as. + }, + "item_path": "str", # Optional. The data sources to use for + this knowledge base. See `Organize Data Sources + `_ + for more information on data sources best practices. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. Spaces Bucket Data + Source. + "region": "str" # Optional. Region of bucket. + }, + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to + crawl. + "crawling_option": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Options for specifying how URLs found on pages + should be handled. * UNKNOWN: Default unknown value * SCOPED: Only + include the base URL. * PATH: Crawl the base URL and linked pages + within the URL path. * DOMAIN: Crawl the base URL and linked pages + within the same domain. * SUBDOMAINS: Crawl the base URL and linked + pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", + "PATH", "DOMAIN", and "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest + and index media (images, etc.) on web pages. + } + } + ], + "embedding_model_uuid": "str", # Optional. Identifier for the `embedding + model + `_. + "name": "str", # Optional. Name of the knowledge base. + "project_id": "str", # Optional. Identifier of the DigitalOcean project this + knowledge base will belong to. + "region": "str", # Optional. The datacenter region to deploy the knowledge + base in. + "tags": [ + "str" # Optional. Tags to organize your knowledge base. + ], + "vpc_uuid": "str" # Optional. The VPC to deploy the knowledge base database + in. } # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. } } # response body for status code(s): 404 @@ -211499,21 +214560,18 @@ def update_model_api_key( """ @overload - def update_model_api_key( + def create_knowledge_base( self, - api_key_uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Update API Key for a Model. + """Create a Knowledge Base. - To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str :param body: Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -211528,13 +214586,58 @@ def update_model_api_key( # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. } } # response body for status code(s): 404 @@ -211551,19 +214654,14 @@ def update_model_api_key( """ @distributed_trace - def update_model_api_key( - self, - api_key_uuid: str, - body: Optional[Union[JSON, IO[bytes]]] = None, - **kwargs: Any, + def create_knowledge_base( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update API Key for a Model. + """Create a Knowledge Base. - To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + To create a knowledge base, send a POST request to ``/v2/gen-ai/knowledge_bases``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] :return: JSON object @@ -211575,19 +214673,127 @@ def update_model_api_key( # JSON input template you can fill out and use as your body input. body = { - "api_key_uuid": "str", # Optional. API key ID. - "name": "str" # Optional. Name. + "database_id": "str", # Optional. Identifier of the DigitalOcean OpenSearch + database this knowledge base will use, optional. If not provided, we create a new + database for the knowledge base in the same region as the knowledge base. + "datasources": [ + { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. AWS S3 Data Source. + "key_id": "str", # Optional. The AWS Key ID. + "region": "str", # Optional. Region of bucket. + "secret_key": "str" # Optional. The AWS Secret Key. + }, + "bucket_name": "str", # Optional. Deprecated, moved to + data_source_details. + "bucket_region": "str", # Optional. Deprecated, moved to + data_source_details. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The + original file name. + "size_in_bytes": "str", # Optional. The size of the + file in bytes. + "stored_object_key": "str" # Optional. The object + key the file was stored as. + }, + "item_path": "str", # Optional. The data sources to use for + this knowledge base. See `Organize Data Sources + `_ + for more information on data sources best practices. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. Spaces Bucket Data + Source. + "region": "str" # Optional. Region of bucket. + }, + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to + crawl. + "crawling_option": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Options for specifying how URLs found on pages + should be handled. * UNKNOWN: Default unknown value * SCOPED: Only + include the base URL. * PATH: Crawl the base URL and linked pages + within the URL path. * DOMAIN: Crawl the base URL and linked pages + within the same domain. * SUBDOMAINS: Crawl the base URL and linked + pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", + "PATH", "DOMAIN", and "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest + and index media (images, etc.) on web pages. + } + } + ], + "embedding_model_uuid": "str", # Optional. Identifier for the `embedding + model + `_. + "name": "str", # Optional. Name of the knowledge base. + "project_id": "str", # Optional. Identifier of the DigitalOcean project this + knowledge base will belong to. + "region": "str", # Optional. The datacenter region to deploy the knowledge + base in. + "tags": [ + "str" # Optional. Tags to organize your knowledge base. + ], + "vpc_uuid": "str" # Optional. The VPC to deploy the knowledge base database + in. } # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. } } # response body for status code(s): 404 @@ -211634,8 +214840,7 @@ def update_model_api_key( else: _json = None - _request = build_genai_update_model_api_key_request( - api_key_uuid=api_key_uuid, + _request = build_genai_create_knowledge_base_request( content_type=content_type, json=_json, content=_content, @@ -211698,15 +214903,26 @@ def update_model_api_key( return cast(JSON, deserialized) # type: ignore @distributed_trace - def delete_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + def list_knowledge_base_data_sources( + self, + knowledge_base_uuid: str, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any, + ) -> JSON: # pylint: disable=line-too-long - """Delete API Key for a Model. + """List Data Sources for a Knowledge Base. - To delete an API key for a model, send a DELETE request to - ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + To list all data sources for a knowledge base, send a GET request to + ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. - :param api_key_uuid: API key for an agent. Required. - :type api_key_uuid: str + :param knowledge_base_uuid: Knowledge base id. Required. + :type knowledge_base_uuid: str + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -211716,13 +214932,135 @@ def delete_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "knowledge_base_data_sources": [ + { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. AWS S3 Data Source + for Display. + "region": "str" # Optional. Region of bucket. + }, + "bucket_name": "str", # Optional. Name of storage bucket - + Deprecated, moved to data_source_details. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The + original file name. + "size_in_bytes": "str", # Optional. The size of the + file in bytes. + "stored_object_key": "str" # Optional. The object + key the file was stored as. + }, + "item_path": "str", # Optional. Path of folder or object in + bucket - Deprecated, moved to data_source_details. + "last_datasource_indexing_job": { + "completed_at": "2020-02-20 00:00:00", # Optional. + Timestamp when data source completed indexing. + "data_source_uuid": "str", # Optional. Uuid of the + indexed data source. + "error_details": "str", # Optional. A detailed error + description. + "error_msg": "str", # Optional. A string code + provinding a hint which part of the system experienced an error. + "failed_item_count": "str", # Optional. Total count + of files that have failed. + "indexed_file_count": "str", # Optional. Total count + of files that have been indexed. + "indexed_item_count": "str", # Optional. Total count + of files that have been indexed. + "removed_item_count": "str", # Optional. Total count + of files that have been removed. + "skipped_item_count": "str", # Optional. Total count + of files that have been skipped. + "started_at": "2020-02-20 00:00:00", # Optional. + Timestamp when data source started indexing. + "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. + Default value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: + "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", + "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", + "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". + "total_bytes": "str", # Optional. Total size of + files in data source in bytes. + "total_bytes_indexed": "str", # Optional. Total size + of files in data source in bytes that have been indexed. + "total_file_count": "str" # Optional. Total file + count in the data source. + }, + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. + Default value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. + Default value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of + datasources being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "uuid": "str" # Optional. Unique id. + }, + "region": "str", # Optional. Region code - Deprecated, moved + to data_source_details. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket + name. + "item_path": "str", # Optional. Spaces Bucket Data + Source. + "region": "str" # Optional. Region of bucket. + }, + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str", # Optional. Unique id of knowledge base. + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to + crawl. + "crawling_option": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Options for specifying how URLs found on pages + should be handled. * UNKNOWN: Default unknown value * SCOPED: Only + include the base URL. * PATH: Crawl the base URL and linked pages + within the URL path. * DOMAIN: Crawl the base URL and linked pages + within the same domain. * SUBDOMAINS: Crawl the base URL and linked + pages for any subdomain. Known values are: "UNKNOWN", "SCOPED", + "PATH", "DOMAIN", and "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest + and index media (images, etc.) on web pages. + } + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. } } # response body for status code(s): 404 @@ -211755,8 +215093,10 @@ def delete_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_delete_model_api_key_request( - api_key_uuid=api_key_uuid, + _request = build_genai_list_knowledge_base_data_sources_request( + knowledge_base_uuid=knowledge_base_uuid, + page=page, + per_page=per_page, headers=_headers, params=_params, ) @@ -211815,16 +215155,28 @@ def delete_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore - @distributed_trace - def regenerate_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + @overload + def create_knowledge_base_data_source( + self, + knowledge_base_uuid: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: # pylint: disable=line-too-long - """Regenerate API Key for a Model. + """Add Data Source to a Knowledge Base. - To regenerate a model API key, send a PUT request to - ``/v2/gen-ai/models/api_keys/{api_key_uuid}/regenerate``. + To add a data source to a knowledge base, send a POST request to + ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str + :param knowledge_base_uuid: Knowledge base id. Required. + :type knowledge_base_uuid: str + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -211832,15 +215184,145 @@ def regenerate_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. AWS S3 Data Source. + "key_id": "str", # Optional. The AWS Key ID. + "region": "str", # Optional. Region of bucket. + "secret_key": "str" # Optional. The AWS Secret Key. + }, + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. Spaces Bucket Data Source. + "region": "str" # Optional. Region of bucket. + }, + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to crawl. + "crawling_option": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Options for specifying how URLs found on pages should be handled. + * UNKNOWN: Default unknown value * SCOPED: Only include the base URL. * PATH: + Crawl the base URL and linked pages within the URL path. * DOMAIN: Crawl the + base URL and linked pages within the same domain. * SUBDOMAINS: Crawl the + base URL and linked pages for any subdomain. Known values are: "UNKNOWN", + "SCOPED", "PATH", "DOMAIN", and "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest and index media + (images, etc.) on web pages. + } + } + # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Creation date. - "created_by": "str", # Optional. Created by. - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. - "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Model API Key Info. - "uuid": "str" # Optional. Uuid. + "knowledge_base_data_source": { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. AWS S3 Data Source for + Display. + "region": "str" # Optional. Region of bucket. + }, + "bucket_name": "str", # Optional. Name of storage bucket - + Deprecated, moved to data_source_details. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The original file + name. + "size_in_bytes": "str", # Optional. The size of the file in + bytes. + "stored_object_key": "str" # Optional. The object key the + file was stored as. + }, + "item_path": "str", # Optional. Path of folder or object in bucket - + Deprecated, moved to data_source_details. + "last_datasource_indexing_job": { + "completed_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source completed indexing. + "data_source_uuid": "str", # Optional. Uuid of the indexed + data source. + "error_details": "str", # Optional. A detailed error + description. + "error_msg": "str", # Optional. A string code provinding a + hint which part of the system experienced an error. + "failed_item_count": "str", # Optional. Total count of files + that have failed. + "indexed_file_count": "str", # Optional. Total count of + files that have been indexed. + "indexed_item_count": "str", # Optional. Total count of + files that have been indexed. + "removed_item_count": "str", # Optional. Total count of + files that have been removed. + "skipped_item_count": "str", # Optional. Total count of + files that have been skipped. + "started_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source started indexing. + "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. Default + value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: + "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", + "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", + "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". + "total_bytes": "str", # Optional. Total size of files in + data source in bytes. + "total_bytes_indexed": "str", # Optional. Total size of + files in data source in bytes that have been indexed. + "total_file_count": "str" # Optional. Total file count in + the data source. + }, + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "region": "str", # Optional. Region code - Deprecated, moved to + data_source_details. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. Spaces Bucket Data Source. + "region": "str" # Optional. Region of bucket. + }, + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str", # Optional. Unique id of knowledge base. + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to crawl. + "crawling_option": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Options for specifying how URLs found on pages should be + handled. * UNKNOWN: Default unknown value * SCOPED: Only include the + base URL. * PATH: Crawl the base URL and linked pages within the URL + path. * DOMAIN: Crawl the base URL and linked pages within the same + domain. * SUBDOMAINS: Crawl the base URL and linked pages for any + subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and + "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest and index + media (images, etc.) on web pages. + } } } # response body for status code(s): 404 @@ -211855,101 +215337,178 @@ def regenerate_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_genai_regenerate_model_api_key_request( - api_key_uuid=api_key_uuid, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - if response.content: - deserialized = response.json() - else: - deserialized = None + @overload + def create_knowledge_base_data_source( + self, + knowledge_base_uuid: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Add Data Source to a Knowledge Base. - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) + To add a data source to a knowledge base, send a POST request to + ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. - if response.content: - deserialized = response.json() - else: - deserialized = None + :param knowledge_base_uuid: Knowledge base id. Required. + :type knowledge_base_uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + Example: + .. code-block:: python - return cast(JSON, deserialized) # type: ignore + # response body for status code(s): 200 + response == { + "knowledge_base_data_source": { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. AWS S3 Data Source for + Display. + "region": "str" # Optional. Region of bucket. + }, + "bucket_name": "str", # Optional. Name of storage bucket - + Deprecated, moved to data_source_details. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The original file + name. + "size_in_bytes": "str", # Optional. The size of the file in + bytes. + "stored_object_key": "str" # Optional. The object key the + file was stored as. + }, + "item_path": "str", # Optional. Path of folder or object in bucket - + Deprecated, moved to data_source_details. + "last_datasource_indexing_job": { + "completed_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source completed indexing. + "data_source_uuid": "str", # Optional. Uuid of the indexed + data source. + "error_details": "str", # Optional. A detailed error + description. + "error_msg": "str", # Optional. A string code provinding a + hint which part of the system experienced an error. + "failed_item_count": "str", # Optional. Total count of files + that have failed. + "indexed_file_count": "str", # Optional. Total count of + files that have been indexed. + "indexed_item_count": "str", # Optional. Total count of + files that have been indexed. + "removed_item_count": "str", # Optional. Total count of + files that have been removed. + "skipped_item_count": "str", # Optional. Total count of + files that have been skipped. + "started_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source started indexing. + "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. Default + value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: + "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", + "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", + "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". + "total_bytes": "str", # Optional. Total size of files in + data source in bytes. + "total_bytes_indexed": "str", # Optional. Total size of + files in data source in bytes that have been indexed. + "total_file_count": "str" # Optional. Total file count in + the data source. + }, + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "region": "str", # Optional. Region code - Deprecated, moved to + data_source_details. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. Spaces Bucket Data Source. + "region": "str" # Optional. Region of bucket. + }, + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str", # Optional. Unique id of knowledge base. + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to crawl. + "crawling_option": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Options for specifying how URLs found on pages should be + handled. * UNKNOWN: Default unknown value * SCOPED: Only include the + base URL. * PATH: Crawl the base URL and linked pages within the URL + path. * DOMAIN: Crawl the base URL and linked pages within the same + domain. * SUBDOMAINS: Crawl the base URL and linked pages for any + subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and + "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest and index + media (images, etc.) on web pages. + } + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ @distributed_trace - def list_openai_api_keys( + def create_knowledge_base_data_source( self, - *, - page: Optional[int] = None, - per_page: Optional[int] = None, + knowledge_base_uuid: str, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """List OpenAI API Keys. + """Add Data Source to a Knowledge Base. - To list all OpenAI API keys, send a GET request to ``/v2/gen-ai/openai/keys``. + To add a data source to a knowledge base, send a POST request to + ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources``. - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int + :param knowledge_base_uuid: Knowledge base id. Required. + :type knowledge_base_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -211957,83 +215516,145 @@ def list_openai_api_keys( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. AWS S3 Data Source. + "key_id": "str", # Optional. The AWS Key ID. + "region": "str", # Optional. Region of bucket. + "secret_key": "str" # Optional. The AWS Secret Key. + }, + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. Spaces Bucket Data Source. + "region": "str" # Optional. Region of bucket. + }, + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to crawl. + "crawling_option": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Options for specifying how URLs found on pages should be handled. + * UNKNOWN: Default unknown value * SCOPED: Only include the base URL. * PATH: + Crawl the base URL and linked pages within the URL path. * DOMAIN: Crawl the + base URL and linked pages within the same domain. * SUBDOMAINS: Crawl the + base URL and linked pages for any subdomain. Known values are: "UNKNOWN", + "SCOPED", "PATH", "DOMAIN", and "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest and index media + (images, etc.) on web pages. + } + } + # response body for status code(s): 200 response == { - "api_key_infos": [ - { - "created_at": "2020-02-20 00:00:00", # Optional. Key - creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted - date. - "models": [ - { - "agreement": { - "description": "str", # Optional. - Agreement Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # - Optional. Creation date / time. - "inference_name": "str", # Optional. - Internally used name. - "inference_version": "str", # Optional. - Internally used version. - "is_foundational": bool, # Optional. True if - it is a foundational model provided by do. - "metadata": {}, # Optional. Additional meta - data. - "name": "str", # Optional. Name of the - model. - "parent_uuid": "str", # Optional. Unique id - of the model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # - Optional. Last modified. - "upload_complete": bool, # Optional. Model - has been fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the - model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major - version number. - "minor": 0, # Optional. Minor - version number. - "patch": 0 # Optional. Patch version - number. - } - } + "knowledge_base_data_source": { + "aws_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. AWS S3 Data Source for + Display. + "region": "str" # Optional. Region of bucket. + }, + "bucket_name": "str", # Optional. Name of storage bucket - + Deprecated, moved to data_source_details. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "file_upload_data_source": { + "original_file_name": "str", # Optional. The original file + name. + "size_in_bytes": "str", # Optional. The size of the file in + bytes. + "stored_object_key": "str" # Optional. The object key the + file was stored as. + }, + "item_path": "str", # Optional. Path of folder or object in bucket - + Deprecated, moved to data_source_details. + "last_datasource_indexing_job": { + "completed_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source completed indexing. + "data_source_uuid": "str", # Optional. Uuid of the indexed + data source. + "error_details": "str", # Optional. A detailed error + description. + "error_msg": "str", # Optional. A string code provinding a + hint which part of the system experienced an error. + "failed_item_count": "str", # Optional. Total count of files + that have failed. + "indexed_file_count": "str", # Optional. Total count of + files that have been indexed. + "indexed_item_count": "str", # Optional. Total count of + files that have been indexed. + "removed_item_count": "str", # Optional. Total count of + files that have been removed. + "skipped_item_count": "str", # Optional. Total count of + files that have been skipped. + "started_at": "2020-02-20 00:00:00", # Optional. Timestamp + when data source started indexing. + "status": "DATA_SOURCE_STATUS_UNKNOWN", # Optional. Default + value is "DATA_SOURCE_STATUS_UNKNOWN". Known values are: + "DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", + "DATA_SOURCE_STATUS_UPDATED", "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", + "DATA_SOURCE_STATUS_NOT_UPDATED", and "DATA_SOURCE_STATUS_FAILED". + "total_bytes": "str", # Optional. Total size of files in + data source in bytes. + "total_bytes_indexed": "str", # Optional. Total size of + files in data source in bytes that have been indexed. + "total_file_count": "str" # Optional. Total file count in + the data source. + }, + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last - updated date. - "uuid": "str" # Optional. Uuid. - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "region": "str", # Optional. Region code - Deprecated, moved to + data_source_details. + "spaces_data_source": { + "bucket_name": "str", # Optional. Spaces bucket name. + "item_path": "str", # Optional. Spaces Bucket Data Source. + "region": "str" # Optional. Region of bucket. + }, + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str", # Optional. Unique id of knowledge base. + "web_crawler_data_source": { + "base_url": "str", # Optional. The base url to crawl. + "crawling_option": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Options for specifying how URLs found on pages should be + handled. * UNKNOWN: Default unknown value * SCOPED: Only include the + base URL. * PATH: Crawl the base URL and linked pages within the URL + path. * DOMAIN: Crawl the base URL and linked pages within the same + domain. * SUBDOMAINS: Crawl the base URL and linked pages for any + subdomain. Known values are: "UNKNOWN", "SCOPED", "PATH", "DOMAIN", and + "SUBDOMAINS". + "embed_media": bool # Optional. Whether to ingest and index + media (images, etc.) on web pages. } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. } } # response body for status code(s): 404 @@ -212061,14 +215682,30 @@ def list_openai_api_keys( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_openai_api_keys_request( - page=page, - per_page=per_page, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_create_knowledge_base_data_source_request( + knowledge_base_uuid=knowledge_base_uuid, + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -212127,215 +215764,20 @@ def list_openai_api_keys( return cast(JSON, deserialized) # type: ignore - @overload - def create_openai_api_key( - self, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> JSON: - # pylint: disable=line-too-long - """Create OpenAI API Key. - - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. - - :param body: Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "api_key": "str", # Optional. OpenAI API key. - "name": "str" # Optional. Name of the key. - } - - # response body for status code(s): 200 - response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } - ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. - "uuid": "str" # Optional. Uuid. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @overload - def create_openai_api_key( - self, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> JSON: - # pylint: disable=line-too-long - """Create OpenAI API Key. - - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. - - :param body: Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } - ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. - "uuid": "str" # Optional. Uuid. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - @distributed_trace - def create_openai_api_key( - self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + def delete_knowledge_base_data_source( + self, knowledge_base_uuid: str, data_source_uuid: str, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create OpenAI API Key. + """Delete a Data Source from a Knowledge Base. - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + To delete a data source from a knowledge base, send a DELETE request to + ``/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources/{data_source_uuid}``. - :param body: Is either a JSON type or a IO[bytes] type. Default value is None. - :type body: JSON or IO[bytes] + :param knowledge_base_uuid: Knowledge base id. Required. + :type knowledge_base_uuid: str + :param data_source_uuid: Data source id. Required. + :type data_source_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -212343,69 +215785,10 @@ def create_openai_api_key( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "api_key": "str", # Optional. OpenAI API key. - "name": "str" # Optional. Name of the key. - } - # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } - ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. - "uuid": "str" # Optional. Uuid. - } + "data_source_uuid": "str", # Optional. Data source id. + "knowledge_base_uuid": "str" # Optional. Knowledge base id. } # response body for status code(s): 404 response == { @@ -212432,29 +215815,14 @@ def create_openai_api_key( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) cls: ClsType[JSON] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _json = body - else: - _json = None - - _request = build_genai_create_openai_api_key_request( - content_type=content_type, - json=_json, - content=_content, + _request = build_genai_delete_knowledge_base_data_source_request( + knowledge_base_uuid=knowledge_base_uuid, + data_source_uuid=data_source_uuid, headers=_headers, params=_params, ) @@ -212514,15 +215882,15 @@ def create_openai_api_key( return cast(JSON, deserialized) # type: ignore @distributed_trace - def get_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + def get_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Get OpenAI API Key. + """Retrieve Information About an Existing Knowledge Base. - To retrieve details of an OpenAI API key, send a GET request to - ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To retrive information about an existing knowledge base, send a GET request to + ``/v2/gen-ai/knowledge_bases/{uuid}``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str + :param uuid: Knowledge base id. Required. + :type uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -212532,60 +215900,62 @@ def get_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } + "database_status": "CREATING", # Optional. Default value is "CREATING". + Known values are: "CREATING", "ONLINE", "POWEROFF", "REBUILDING", "REBALANCING", + "DECOMMISSIONED", "FORKING", "MIGRATING", "RESIZING", "RESTORING", "POWERING_ON", + and "UNHEALTHY". + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. - "uuid": "str" # Optional. Uuid. + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. } } # response body for status code(s): 404 @@ -212618,8 +215988,8 @@ def get_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_get_openai_api_key_request( - api_key_uuid=api_key_uuid, + _request = build_genai_get_knowledge_base_request( + uuid=uuid, headers=_headers, params=_params, ) @@ -212679,21 +216049,21 @@ def get_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @overload - def update_openai_api_key( + def update_knowledge_base( self, - api_key_uuid: str, + uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Update OpenAI API Key. + """Update a Knowledge Base. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str + :param uuid: Knowledge base id. Required. + :type uuid: str :param body: Default value is None. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -212708,66 +216078,851 @@ def update_openai_api_key( # JSON input template you can fill out and use as your body input. body = { - "api_key": "str", # Optional. OpenAI API key. - "api_key_uuid": "str", # Optional. API key ID. - "name": "str" # Optional. Name of the key. + "database_id": "str", # Optional. The id of the DigitalOcean database this + knowledge base will use, optiona. + "embedding_model_uuid": "str", # Optional. Identifier for the foundation + model. + "name": "str", # Optional. Knowledge base name. + "project_id": "str", # Optional. The id of the DigitalOcean project this + knowledge base will belong to. + "tags": [ + "str" # Optional. Tags to organize your knowledge base. + ], + "uuid": "str" # Optional. Knowledge base id. } # response body for status code(s): 200 response == { - "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def update_knowledge_base( + self, + uuid: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update a Knowledge Base. + + To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + + :param uuid: Knowledge base id. Required. + :type uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def update_knowledge_base( + self, uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update a Knowledge Base. + + To update a knowledge base, send a PUT request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + + :param uuid: Knowledge base id. Required. + :type uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "database_id": "str", # Optional. The id of the DigitalOcean database this + knowledge base will use, optiona. + "embedding_model_uuid": "str", # Optional. Identifier for the foundation + model. + "name": "str", # Optional. Knowledge base name. + "project_id": "str", # Optional. The id of the DigitalOcean project this + knowledge base will belong to. + "tags": [ + "str" # Optional. Tags to organize your knowledge base. + ], + "uuid": "str" # Optional. Knowledge base id. + } + + # response body for status code(s): 200 + response == { + "knowledge_base": { + "added_to_agent_at": "2020-02-20 00:00:00", # Optional. Time when + the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", # Optional. Knowledgebase Description. + "embedding_model_uuid": "str", # Optional. Knowledgebase + Description. + "is_public": bool, # Optional. Whether the knowledge base is public + or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "data_source_uuids": [ + "str" # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # Optional. + IndexingJob description. + "knowledge_base_uuid": "str", # Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of datasources + being indexed. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge base. + "project_id": "str", # Optional. Knowledgebase Description. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize related resources. ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # Optional. Id of user that created the knowledge + base. + "uuid": "str" # Optional. Unique id for knowledge base. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_update_knowledge_base_request( + uuid=uuid, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def delete_knowledge_base(self, uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete a Knowledge Base. + + To delete a knowledge base, send a DELETE request to ``/v2/gen-ai/knowledge_bases/{uuid}``. + + :param uuid: Knowledge base id. Required. + :type uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "uuid": "str" # Optional. The id of the deleted knowledge base. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_delete_knowledge_base_request( + uuid=uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_models( + self, + *, + usecases: Optional[List[str]] = None, + public_only: Optional[bool] = None, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """List Available Models. + + To list all models, send a GET request to ``/v2/gen-ai/models``. + + :keyword usecases: Include only models defined for the listed usecases. + + + * MODEL_USECASE_UNKNOWN: The use case of the model is unknown + * MODEL_USECASE_AGENT: The model maybe used in an agent + * MODEL_USECASE_FINETUNED: The model maybe used for fine tuning + * MODEL_USECASE_KNOWLEDGEBASE: The model maybe used for knowledge bases (embedding models) + * MODEL_USECASE_GUARDRAIL: The model maybe used for guardrails + * MODEL_USECASE_REASONING: The model usecase for reasoning + * MODEL_USECASE_SERVERLESS: The model usecase for serverless inference. Default value is None. + :paramtype usecases: list[str] + :keyword public_only: Only include models that are publicly available. Default value is None. + :paramtype public_only: bool + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + }, + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement Description. + "url": "str", # Optional. Agreement Description. + "uuid": "str" # Optional. Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the model, + this model is based on. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "upload_complete": bool, # Optional. Model has been fully + uploaded. + "url": "str", # Optional. Download url. + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version number. + "minor": 0, # Optional. Minor version number. + "patch": 0 # Optional. Patch version number. + } + } + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_models_request( + usecases=usecases, + public_only=public_only, + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_model_api_keys( + self, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """List Model API Keys. + + To list all model API keys, send a GET request to ``/v2/gen-ai/models/api_keys``. + + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted + date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_model_api_keys_request( + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def create_model_api_key( + self, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Create a Model API Key. + + To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "name": "str" # Optional. A human friendly name to identify the key. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. + "secret_key": "str", # Optional. Model API Key Info. "uuid": "str" # Optional. Uuid. } } @@ -212785,21 +216940,18 @@ def update_openai_api_key( """ @overload - def update_openai_api_key( + def create_model_api_key( self, - api_key_uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Update OpenAI API Key. + """Create a Model API Key. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str :param body: Default value is None. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -212815,58 +216967,11 @@ def update_openai_api_key( # response body for status code(s): 200 response == { "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } - ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. + "secret_key": "str", # Optional. Model API Key Info. "uuid": "str" # Optional. Uuid. } } @@ -212884,19 +216989,14 @@ def update_openai_api_key( """ @distributed_trace - def update_openai_api_key( - self, - api_key_uuid: str, - body: Optional[Union[JSON, IO[bytes]]] = None, - **kwargs: Any, + def create_model_api_key( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update OpenAI API Key. + """Create a Model API Key. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To create a model API key, send a POST request to ``/v2/gen-ai/models/api_keys``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] :return: JSON object @@ -212908,66 +217008,17 @@ def update_openai_api_key( # JSON input template you can fill out and use as your body input. body = { - "api_key": "str", # Optional. OpenAI API key. - "api_key_uuid": "str", # Optional. API key ID. - "name": "str" # Optional. Name of the key. + "name": "str" # Optional. A human friendly name to identify the key. } # response body for status code(s): 200 response == { "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. - }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - } - ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. + "secret_key": "str", # Optional. Model API Key Info. "uuid": "str" # Optional. Uuid. } } @@ -213015,8 +217066,7 @@ def update_openai_api_key( else: _json = None - _request = build_genai_update_openai_api_key_request( - api_key_uuid=api_key_uuid, + _request = build_genai_create_model_api_key_request( content_type=content_type, json=_json, content=_content, @@ -213078,16 +217128,27 @@ def update_openai_api_key( return cast(JSON, deserialized) # type: ignore - @distributed_trace - def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + @overload + def update_model_api_key( + self, + api_key_uuid: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: # pylint: disable=line-too-long - """Delete OpenAI API Key. + """Update API Key for a Model. - To delete an OpenAI API key, send a DELETE request to - ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. :param api_key_uuid: API key ID. Required. :type api_key_uuid: str + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -213095,62 +217156,10279 @@ def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "api_key_uuid": "str", # Optional. API key ID. + "name": "str" # Optional. Name. + } + # response body for status code(s): 200 response == { "api_key_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. - "created_by": "str", # Optional. Created by user id from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. - "models": [ - { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Model API Key Info. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def update_model_api_key( + self, + api_key_uuid: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update API Key for a Model. + + To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Model API Key Info. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def update_model_api_key( + self, + api_key_uuid: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update API Key for a Model. + + To update a model API key, send a PUT request to ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "api_key_uuid": "str", # Optional. API key ID. + "name": "str" # Optional. Name. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Model API Key Info. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_update_model_api_key_request( + api_key_uuid=api_key_uuid, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def delete_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete API Key for a Model. + + To delete an API key for a model, send a DELETE request to + ``/v2/gen-ai/models/api_keys/{api_key_uuid}``. + + :param api_key_uuid: API key for an agent. Required. + :type api_key_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Model API Key Info. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_delete_model_api_key_request( + api_key_uuid=api_key_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def regenerate_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Regenerate API Key for a Model. + + To regenerate a model API key, send a PUT request to + ``/v2/gen-ai/models/api_keys/{api_key_uuid}/regenerate``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Model API Key Info. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_regenerate_model_api_key_request( + api_key_uuid=api_key_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_openai_api_keys( + self, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """List OpenAI API Keys. + + To list all OpenAI API keys, send a GET request to ``/v2/gen-ai/openai/keys``. + + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", # Optional. Key + creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted + date. + "models": [ + { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last + updated date. + "uuid": "str" # Optional. Uuid. + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_openai_api_keys_request( + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def create_openai_api_key( + self, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Create OpenAI API Key. + + To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "api_key": "str", # Optional. OpenAI API key. + "name": "str" # Optional. Name of the key. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def create_openai_api_key( + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Create OpenAI API Key. + + To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def create_openai_api_key( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create OpenAI API Key. + + To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "api_key": "str", # Optional. OpenAI API key. + "name": "str" # Optional. Name of the key. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_create_openai_api_key_request( + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get OpenAI API Key. + + To retrieve details of an OpenAI API key, send a GET request to + ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_get_openai_api_key_request( + api_key_uuid=api_key_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def update_openai_api_key( + self, + api_key_uuid: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update OpenAI API Key. + + To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "api_key": "str", # Optional. OpenAI API key. + "api_key_uuid": "str", # Optional. API key ID. + "name": "str" # Optional. Name of the key. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def update_openai_api_key( + self, + api_key_uuid: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update OpenAI API Key. + + To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def update_openai_api_key( + self, + api_key_uuid: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update OpenAI API Key. + + To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "api_key": "str", # Optional. OpenAI API key. + "api_key_uuid": "str", # Optional. API key ID. + "name": "str" # Optional. Name of the key. + } + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_update_openai_api_key_request( + api_key_uuid=api_key_uuid, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete OpenAI API Key. + + To delete an OpenAI API key, send a DELETE request to + ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "api_key_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Key creation date. + "created_by": "str", # Optional. Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated + date. + "uuid": "str" # Optional. Uuid. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_delete_openai_api_key_request( + api_key_uuid=api_key_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_agents_by_openai_key( + self, + uuid: str, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """List agents by OpenAI key. + + List Agents by OpenAI Key. + + :param uuid: Unique ID of OpenAI key. Required. + :type uuid: str + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # Optional. Key + creation date. + "created_by": "str", # Optional. Created by user id + from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key + deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key + last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api key + infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api key. + } + ], + "chatbot": { + "button_background_color": "str", # Optional. A + Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A Chatbot. + "secondary_color": "str", # Optional. A Chatbot. + "starting_message": "str" # Optional. A Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. Whether + conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. Default + value is "STATUS_UNKNOWN". Known values are: "STATUS_UNKNOWN", + "STATUS_WAITING_FOR_DEPLOYMENT", "STATUS_DEPLOYING", + "STATUS_RUNNING", "STATUS_FAILED", "STATUS_WAITING_FOR_UNDEPLOYMENT", + "STATUS_UNDEPLOYING", "STATUS_UNDEPLOYMENT_FAILED", and + "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your deployed agent + here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # Optional. + Default value is "VISIBILITY_UNKNOWN". * VISIBILITY_UNKNOWN: The + status of the deployment is unknown * VISIBILITY_DISABLED: The + deployment is disabled and will no longer service requests * + VISIBILITY_PLAYGROUND: Deprecated: No longer a valid state * + VISIBILITY_PUBLIC: The deployment is public and will service requests + from the public internet * VISIBILITY_PRIVATE: The deployment is + private and will only service requests from other agents, or through + API keys. Known values are: "VISIBILITY_UNKNOWN", + "VISIBILITY_DISABLED", "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", + and "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of agent. + "functions": [ + { + "api_key": "str", # Optional. Api key. + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "created_by": "str", # Optional. Created by + user id from DO. + "description": "str", # Optional. Agent + description. + "faas_name": "str", # Optional. + "faas_namespace": "str", # Optional. + "input_schema": {}, # Optional. Any object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any object. + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Download your + agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", # + Optional. The guardrails the agent is attached to. + "default_response": "str", # Optional. The + guardrails the agent is attached to. + "description": "str", # Optional. The + guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. The + guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any object. + "name": "str", # Optional. The guardrails + the agent is attached to. + "priority": 0, # Optional. The guardrails + the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known values + are: "GUARDRAIL_TYPE_UNKNOWN", "GUARDRAIL_TYPE_JAILBREAK", + "GUARDRAIL_TYPE_SENSITIVE_DATA", and + "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", # + Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The guardrails the + agent is attached to. + } + ], + "if_case": "str", # Optional. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See `Write + Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 00:00:00", + # Optional. Time when the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "database_id": "str", # Optional. Knowledge + bases. + "embedding_model_uuid": "str", # Optional. + Knowledge bases. + "is_public": bool, # Optional. Whether the + knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # + Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", + # Optional. IndexingJob description. + "knowledge_base_uuid": "str", # + Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", + # Optional. Default value is "BATCH_JOB_PHASE_UNKNOWN". Known + values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", + # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of + tokens. + "total_datasources": 0, # Optional. + Number of datasources being indexed. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge + base. + "project_id": "str", # Optional. Knowledge + bases. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize + related resources. + ], + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "user_id": "str", # Optional. Id of user + that created the knowledge base. + "uuid": "str" # Optional. Unique id for + knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo + project identifier. + "galileo_project_name": "str", # Optional. Name of + the Galileo project. + "log_stream_id": "str", # Optional. Identifier for + the log stream. + "log_stream_name": "str" # Optional. Name of the log + stream. + }, + "max_tokens": 0, # Optional. + "model": { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # Optional. Key + creation date. + "created_by": "str", # Optional. Created by user id + from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key + deleted date. + "models": [ + { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key + last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. + "provide_citations": bool, # Optional. Whether the agent + should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # Optional. + Default value is "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: + The retrieval method is unknown * RETRIEVAL_METHOD_REWRITE: The + retrieval method is rewrite * RETRIEVAL_METHOD_STEP_BACK: The retrieval + method is step back * RETRIEVAL_METHOD_SUB_QUERIES: The retrieval + method is sub queries * RETRIEVAL_METHOD_NONE: The retrieval method is + none. Known values are: "RETRIEVAL_METHOD_UNKNOWN", + "RETRIEVAL_METHOD_REWRITE", "RETRIEVAL_METHOD_STEP_BACK", + "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # Optional. + Creation of route date / time. + "route_created_by": "str", # Optional. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. + "tags": [ + "str" # Optional. Agent tag to organize related + resources. + ], + "temperature": 0.0, # Optional. + "template": { + "created_at": "2020-02-20 00:00:00", # Optional. The + agent template's creation date. + "description": "str", # Optional. Deprecated - Use + summary instead. + "guardrails": [ + { + "priority": 0, # Optional. Priority + of the guardrail. + "uuid": "str" # Optional. Uuid of + the guardrail. + } + ], + "instruction": "str", # Optional. Instructions for + the agent template. + "k": 0, # Optional. The 'k' value for the agent + template. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + List of knowledge bases associated with the agent template. + "embedding_model_uuid": "str", # + Optional. List of knowledge bases associated with the agent + template. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + List of knowledge bases associated with the agent template. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "long_description": "str", # Optional. The long + description of the agent template. + "max_tokens": 0, # Optional. The max_tokens setting + for the agent template. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The short + description of the agent template. + "summary": "str", # Optional. The summary of the + agent template. + "tags": [ + "str" # Optional. List of tags associated + with the agent template. + ], + "temperature": 0.0, # Optional. The temperature + setting for the agent template. + "template_type": "AGENT_TEMPLATE_TYPE_STANDARD", # + Optional. Default value is "AGENT_TEMPLATE_TYPE_STANDARD". * + AGENT_TEMPLATE_TYPE_STANDARD: The standard agent template * + AGENT_TEMPLATE_TYPE_ONE_CLICK: The one click agent template. Known + values are: "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting for the + agent template. + "updated_at": "2020-02-20 00:00:00", # Optional. The + agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "url": "str", # Optional. Access your agent under this url. + "user_id": "str", # Optional. Id of user that created the + agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the + agent. + "workspace": { + "agents": [ + ... + ], + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date. + "created_by": "str", # Optional. The id of user who + created this workspace. + "created_by_email": "str", # Optional. The email of + the user who created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. + Deleted date. + "description": "str", # Optional. Description of the + workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "created_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "created_by_user_email": "str", # + Optional. Evaluations. + "created_by_user_id": "str", # + Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 + 00:00:00", # Optional. Time created at. + "dataset_name": "str", # + Optional. Name of the dataset. + "dataset_uuid": "str", # + Optional. UUID of the dataset. + "file_size": "str", # + Optional. The size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. + Number of rows in the dataset. + }, + "dataset_name": "str", # Optional. + Evaluations. + "dataset_uuid": "str", # Optional. + Evaluations. + "description": "str", # Optional. + Evaluations. + "latest_version_number_of_runs": 0, + # Optional. Evaluations. + "metrics": [ + { + "description": "str", + # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning + that a lower value is better. + "metric_name": "str", + # Optional. Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", + "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", + # Optional. Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default + value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # + Optional. The minimum value for the metric. + } + ], + "name": "str", # Optional. + Evaluations. + "star_metric": { + "metric_uuid": "str", # + Optional. Evaluations. + "name": "str", # Optional. + Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This + is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # + Optional. The success threshold for the star metric. This + is a percentage value between 0 and 100. + }, + "test_case_uuid": "str", # Optional. + Evaluations. + "total_runs": 0, # Optional. + Evaluations. + "updated_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "updated_by_user_email": "str", # + Optional. Evaluations. + "updated_by_user_id": "str", # + Optional. Evaluations. + "version": 0 # Optional. + Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. + Update date. + "uuid": "str" # Optional. Unique id. + } + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_agents_by_openai_key_request( + uuid=uuid, + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_datacenter_regions( + self, + *, + serves_inference: Optional[bool] = None, + serves_batch: Optional[bool] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """List Datacenter Regions. + + To list all datacenter regions, send a GET request to ``/v2/gen-ai/regions``. + + :keyword serves_inference: Include datacenters that serve inference. Default value is None. + :paramtype serves_inference: bool + :keyword serves_batch: Include datacenters that are capable of running batch jobs. Default + value is None. + :paramtype serves_batch: bool + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "regions": [ + { + "inference_url": "str", # Optional. Url for inference + server. + "region": "str", # Optional. Region code. + "serves_batch": bool, # Optional. This datacenter is capable + of running batch jobs. + "serves_inference": bool, # Optional. This datacenter is + capable of serving inference. + "stream_inference_url": "str" # Optional. The url for the + inference streaming server. + } + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_datacenter_regions_request( + serves_inference=serves_inference, + serves_batch=serves_batch, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_workspaces(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """List Workspaces. + + To list all workspaces, send a GET request to ``/v2/gen-ai/workspaces``. + + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "workspaces": [ + { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", + # Optional. Key creation date. + "created_by": "str", # Optional. + Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", + # Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date. + "created_by": "str", # + Optional. Created by. + "deleted_at": "2020-02-20 + 00:00:00", # Optional. Deleted date. + "name": "str", # Optional. + Name. + "secret_key": "str", # + Optional. Api key infos. + "uuid": "str" # Optional. + Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. + Api key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A + Chatbot. + "name": "str", # Optional. Name of + chatbot. + "primary_color": "str", # Optional. + A Chatbot. + "secondary_color": "str", # + Optional. A Chatbot. + "starting_message": "str" # + Optional. A Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": + "str" # Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # + Optional. Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # + Optional. Default value is "STATUS_UNKNOWN". Known values + are: "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Access + your deployed agent here. + "uuid": "str", # Optional. Unique + id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown + * VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: + Deprecated: No longer a valid state * VISIBILITY_PUBLIC: + The deployment is public and will service requests from the + public internet * VISIBILITY_PRIVATE: The deployment is + private and will only service requests from other agents, or + through API keys. Known values are: "VISIBILITY_UNKNOWN", + "VISIBILITY_DISABLED", "VISIBILITY_PLAYGROUND", + "VISIBILITY_PUBLIC", and "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. + Description of agent. + "functions": [ + { + "api_key": "str", # + Optional. Api key. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "created_by": "str", # + Optional. Created by user id from DO. + "description": "str", # + Optional. Agent description. + "faas_name": "str", # + Optional. Agents. + "faas_namespace": "str", # + Optional. Agents. + "input_schema": {}, # + Optional. Any object. + "name": "str", # Optional. + Name. + "output_schema": {}, # + Optional. Any object. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "url": "str", # Optional. + Download your agent here. + "uuid": "str" # Optional. + Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # + Optional. The guardrails the agent is attached to. + "created_at": "2020-02-20 + 00:00:00", # Optional. The guardrails the agent is + attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # + Optional. The guardrails the agent is attached to. + "guardrail_uuid": "str", # + Optional. The guardrails the agent is attached to. + "is_attached": bool, # + Optional. The guardrails the agent is attached to. + "is_default": bool, # + Optional. The guardrails the agent is attached to. + "metadata": {}, # Optional. + Any object. + "name": "str", # Optional. + The guardrails the agent is attached to. + "priority": 0, # Optional. + The guardrails the agent is attached to. + "type": + "GUARDRAIL_TYPE_UNKNOWN", # Optional. Default value is + "GUARDRAIL_TYPE_UNKNOWN". Known values are: + "GUARDRAIL_TYPE_UNKNOWN", "GUARDRAIL_TYPE_JAILBREAK", + "GUARDRAIL_TYPE_SENSITIVE_DATA", and + "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 + 00:00:00", # Optional. The guardrails the agent is + attached to. + "uuid": "str" # Optional. + The guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent + instruction. Instructions help your agent to perform its job + effectively. See `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. Knowledge bases. + "embedding_model_uuid": + "str", # Optional. Knowledge bases. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. Knowledge bases. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # + Optional. Galileo project identifier. + "galileo_project_name": "str", # + Optional. Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. + Name of the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", + # Optional. Key creation date. + "created_by": "str", # Optional. + Created by user id from DO. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": + "str", # Optional. Agreement Description. + "url": "str", + # Optional. Agreement Description. + "uuid": "str" + # Optional. Agreement Description. + }, + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "inference_name": + "str", # Optional. Internally used name. + "inference_version": + "str", # Optional. Internally used version. + "is_foundational": + bool, # Optional. True if it is a foundational model + provided by do. + "metadata": {}, # + Optional. Additional meta data. + "name": "str", # + Optional. Name of the model. + "parent_uuid": "str", + # Optional. Unique id of the model, this model is + based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default + value is "MODEL_PROVIDER_DIGITALOCEAN". Known values + are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and + "MODEL_PROVIDER_OPENAI". + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "upload_complete": + bool, # Optional. Model has been fully uploaded. + "url": "str", # + Optional. Download url. + "usecases": [ + "str" # + Optional. Usecases of the model. + ], + "uuid": "str", # + Optional. Unique id. + "version": { + "major": 0, + # Optional. Major version number. + "minor": 0, + # Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", + # Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. + Whether the agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": + "RETRIEVAL_METHOD_UNKNOWN", # Optional. Default value is + "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: The + retrieval method is unknown * RETRIEVAL_METHOD_REWRITE: The + retrieval method is rewrite * RETRIEVAL_METHOD_STEP_BACK: The + retrieval method is step back * RETRIEVAL_METHOD_SUB_QUERIES: + The retrieval method is sub queries * RETRIEVAL_METHOD_NONE: + The retrieval method is none. Known values are: + "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. + Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to + organize related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", + # Optional. The agent template's creation date. + "description": "str", # Optional. + Deprecated - Use summary instead. + "guardrails": [ + { + "priority": 0, # + Optional. Priority of the guardrail. + "uuid": "str" # + Optional. Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value + for the agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "database_id": "str", + # Optional. List of knowledge bases associated with + the agent template. + "embedding_model_uuid": "str", # Optional. List of + knowledge bases associated with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or + not. + "last_indexing_job": + { + "completed_datasources": 0, # Optional. Number + of datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date + / time. + "data_source_uuids": [ + "str" + # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # + Optional. IndexingJob description. + "knowledge_base_uuid": "str", # Optional. + Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default + value is "BATCH_JOB_PHASE_UNKNOWN". Known values + are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, + # Optional. Number of tokens. + "total_datasources": 0, # Optional. Number of + datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last + modified. + "uuid": "str" + # Optional. Unique id. + }, + "name": "str", # + Optional. Name of knowledge base. + "project_id": "str", + # Optional. List of knowledge bases associated with + the agent template. + "region": "str", # + Optional. Region code. + "tags": [ + "str" # + Optional. Tags to organize related resources. + ], + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # + Optional. Unique id for knowledge base. + } + ], + "long_description": "str", # + Optional. The long description of the agent template. + "max_tokens": 0, # Optional. The + max_tokens setting for the agent template. + "model": { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + }, + "name": "str", # Optional. Name of + the agent template. + "short_description": "str", # + Optional. The short description of the agent template. + "summary": "str", # Optional. The + summary of the agent template. + "tags": [ + "str" # Optional. List of + tags associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * + AGENT_TEMPLATE_TYPE_STANDARD: The standard agent template + * AGENT_TEMPLATE_TYPE_ONE_CLICK: The one click agent + template. Known values are: "AGENT_TEMPLATE_TYPE_STANDARD" + and "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p + setting for the agent template. + "updated_at": "2020-02-20 00:00:00", + # Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your agent + under this url. + "user_id": "str", # Optional. Id of user + that created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The + latest version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date. + "created_by": "str", # Optional. The id of user who created + this workspace. + "created_by_email": "str", # Optional. The email of the user + who created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted + date. + "description": "str", # Optional. Description of the + workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # + Optional. Evaluations. + "created_at": "2020-02-20 00:00:00", # + Optional. Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", + # Optional. Time created at. + "dataset_name": "str", # Optional. + Name of the dataset. + "dataset_uuid": "str", # Optional. + UUID of the dataset. + "file_size": "str", # Optional. The + size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of + rows in the dataset. + }, + "dataset_name": "str", # Optional. + Evaluations. + "dataset_uuid": "str", # Optional. + Evaluations. + "description": "str", # Optional. + Evaluations. + "latest_version_number_of_runs": 0, # + Optional. Evaluations. + "metrics": [ + { + "description": "str", # + Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. + "metric_name": "str", # + Optional. Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", + and "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # + Optional. Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default + value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values + are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", "METRIC_VALUE_TYPE_STRING", + and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # Optional. + The minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. + Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This is + a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # + Optional. The success threshold for the star metric. This is + a percentage value between 0 and 100. + }, + "test_case_uuid": "str", # Optional. + Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # + Optional. Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update + date. + "uuid": "str" # Optional. Unique id. + } + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_workspaces_request( + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def create_workspace( + self, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Create a Workspace. + + To create a new workspace, send a POST request to ``/v2/gen-ai/workspaces``. The response body + contains a JSON object with the newly created workspace object. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Ids of the agents(s) to attach to the workspace. + ], + "description": "str", # Optional. Description of the workspace. + "name": "str" # Optional. Name of the workspace. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def create_workspace( + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Create a Workspace. + + To create a new workspace, send a POST request to ``/v2/gen-ai/workspaces``. The response body + contains a JSON object with the newly created workspace object. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def create_workspace( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a Workspace. + + To create a new workspace, send a POST request to ``/v2/gen-ai/workspaces``. The response body + contains a JSON object with the newly created workspace object. + + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Ids of the agents(s) to attach to the workspace. + ], + "description": "str", # Optional. Description of the workspace. + "name": "str" # Optional. Name of the workspace. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_create_workspace_request( + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_workspace(self, workspace_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve an Existing Workspace. + + To retrieve details of a workspace, GET request to ``/v2/gen-ai/workspaces/{workspace_uuid}``. + The response body is a JSON object containing the workspace. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_get_workspace_request( + workspace_uuid=workspace_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def update_workspace( + self, + workspace_uuid: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update a Workspace. + + To update a workspace, send a PUT request to ``/v2/gen-ai/workspaces/{workspace_uuid}``. The + response body is a JSON object containing the workspace. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "description": "str", # Optional. The new description of the workspace. + "name": "str", # Optional. The new name of the workspace. + "workspace_uuid": "str" # Optional. Workspace UUID. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def update_workspace( + self, + workspace_uuid: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update a Workspace. + + To update a workspace, send a PUT request to ``/v2/gen-ai/workspaces/{workspace_uuid}``. The + response body is a JSON object containing the workspace. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def update_workspace( + self, + workspace_uuid: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update a Workspace. + + To update a workspace, send a PUT request to ``/v2/gen-ai/workspaces/{workspace_uuid}``. The + response body is a JSON object containing the workspace. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "description": "str", # Optional. The new description of the workspace. + "name": "str", # Optional. The new name of the workspace. + "workspace_uuid": "str" # Optional. Workspace UUID. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_update_workspace_request( + workspace_uuid=workspace_uuid, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def delete_workspace(self, workspace_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete a Workspace. + + To delete a workspace, send a DELETE request to ``/v2/gen-ai/workspace/{workspace_uuid}``. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "workspace_uuid": "str" # Optional. Workspace. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_delete_workspace_request( + workspace_uuid=workspace_uuid, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_agents_by_workspace( + self, + workspace_uuid: str, + *, + only_deployed: Optional[bool] = None, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """List agents by Workspace. + + To list all agents by a Workspace, send a GET request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/agents``. + + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str + :keyword only_deployed: Only list agents that are deployed. Default value is None. + :paramtype only_deployed: bool + :keyword page: Page number. Default value is None. + :paramtype page: int + :keyword per_page: Items per page. Default value is None. + :paramtype per_page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # Optional. Key + creation date. + "created_by": "str", # Optional. Created by user id + from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key + deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key + last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date. + "created_by": "str", # Optional. Created by. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api key + infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api key. + } + ], + "chatbot": { + "button_background_color": "str", # Optional. A + Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A Chatbot. + "secondary_color": "str", # Optional. A Chatbot. + "starting_message": "str" # Optional. A Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. Whether + conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. Default + value is "STATUS_UNKNOWN". Known values are: "STATUS_UNKNOWN", + "STATUS_WAITING_FOR_DEPLOYMENT", "STATUS_DEPLOYING", + "STATUS_RUNNING", "STATUS_FAILED", "STATUS_WAITING_FOR_UNDEPLOYMENT", + "STATUS_UNDEPLOYING", "STATUS_UNDEPLOYMENT_FAILED", and + "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your deployed agent + here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # Optional. + Default value is "VISIBILITY_UNKNOWN". * VISIBILITY_UNKNOWN: The + status of the deployment is unknown * VISIBILITY_DISABLED: The + deployment is disabled and will no longer service requests * + VISIBILITY_PLAYGROUND: Deprecated: No longer a valid state * + VISIBILITY_PUBLIC: The deployment is public and will service requests + from the public internet * VISIBILITY_PRIVATE: The deployment is + private and will only service requests from other agents, or through + API keys. Known values are: "VISIBILITY_UNKNOWN", + "VISIBILITY_DISABLED", "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", + and "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of agent. + "functions": [ + { + "api_key": "str", # Optional. Api key. + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "created_by": "str", # Optional. Created by + user id from DO. + "description": "str", # Optional. Agent + description. + "faas_name": "str", # Optional. + "faas_namespace": "str", # Optional. + "input_schema": {}, # Optional. Any object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any object. + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Download your + agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", # + Optional. The guardrails the agent is attached to. + "default_response": "str", # Optional. The + guardrails the agent is attached to. + "description": "str", # Optional. The + guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. The + guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any object. + "name": "str", # Optional. The guardrails + the agent is attached to. + "priority": 0, # Optional. The guardrails + the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known values + are: "GUARDRAIL_TYPE_UNKNOWN", "GUARDRAIL_TYPE_JAILBREAK", + "GUARDRAIL_TYPE_SENSITIVE_DATA", and + "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", # + Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The guardrails the + agent is attached to. + } + ], + "if_case": "str", # Optional. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See `Write + Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 00:00:00", + # Optional. Time when the knowledge base was added to the agent. + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "database_id": "str", # Optional. Knowledge + bases. + "embedding_model_uuid": "str", # Optional. + Knowledge bases. + "is_public": bool, # Optional. Whether the + knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # + Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", + # Optional. IndexingJob description. + "knowledge_base_uuid": "str", # + Optional. Knowledge base id. + "phase": "BATCH_JOB_PHASE_UNKNOWN", + # Optional. Default value is "BATCH_JOB_PHASE_UNKNOWN". Known + values are: "BATCH_JOB_PHASE_UNKNOWN", + "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", + "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 00:00:00", + # Optional. IndexingJob description. + "status": "INDEX_JOB_STATUS_UNKNOWN", + # Optional. Default value is "INDEX_JOB_STATUS_UNKNOWN". + Known values are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. Number of + tokens. + "total_datasources": 0, # Optional. + Number of datasources being indexed. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "uuid": "str" # Optional. Unique id. + }, + "name": "str", # Optional. Name of knowledge + base. + "project_id": "str", # Optional. Knowledge + bases. + "region": "str", # Optional. Region code. + "tags": [ + "str" # Optional. Tags to organize + related resources. + ], + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "user_id": "str", # Optional. Id of user + that created the knowledge base. + "uuid": "str" # Optional. Unique id for + knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. Galileo + project identifier. + "galileo_project_name": "str", # Optional. Name of + the Galileo project. + "log_stream_id": "str", # Optional. Identifier for + the log stream. + "log_stream_name": "str" # Optional. Name of the log + stream. + }, + "max_tokens": 0, # Optional. + "model": { + "agreement": { + "description": "str", # Optional. Agreement + Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "inference_name": "str", # Optional. Internally used + name. + "inference_version": "str", # Optional. Internally + used version. + "is_foundational": bool, # Optional. True if it is a + foundational model provided by do. + "metadata": {}, # Optional. Additional meta data. + "name": "str", # Optional. Name of the model. + "parent_uuid": "str", # Optional. Unique id of the + model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "upload_complete": bool, # Optional. Model has been + fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major version + number. + "minor": 0, # Optional. Minor version + number. + "patch": 0 # Optional. Patch version number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # Optional. Key + creation date. + "created_by": "str", # Optional. Created by user id + from DO. + "deleted_at": "2020-02-20 00:00:00", # Optional. Key + deleted date. + "models": [ + { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key + last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. + "provide_citations": bool, # Optional. Whether the agent + should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # Optional. + Default value is "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: + The retrieval method is unknown * RETRIEVAL_METHOD_REWRITE: The + retrieval method is rewrite * RETRIEVAL_METHOD_STEP_BACK: The retrieval + method is step back * RETRIEVAL_METHOD_SUB_QUERIES: The retrieval + method is sub queries * RETRIEVAL_METHOD_NONE: The retrieval method is + none. Known values are: "RETRIEVAL_METHOD_UNKNOWN", + "RETRIEVAL_METHOD_REWRITE", "RETRIEVAL_METHOD_STEP_BACK", + "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # Optional. + Creation of route date / time. + "route_created_by": "str", # Optional. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. + "tags": [ + "str" # Optional. Agent tag to organize related + resources. + ], + "temperature": 0.0, # Optional. + "template": { + "created_at": "2020-02-20 00:00:00", # Optional. The + agent template's creation date. + "description": "str", # Optional. Deprecated - Use + summary instead. + "guardrails": [ + { + "priority": 0, # Optional. Priority + of the guardrail. + "uuid": "str" # Optional. Uuid of + the guardrail. + } + ], + "instruction": "str", # Optional. Instructions for + the agent template. + "k": 0, # Optional. The 'k' value for the agent + template. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + List of knowledge bases associated with the agent template. + "embedding_model_uuid": "str", # + Optional. List of knowledge bases associated with the agent + template. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + List of knowledge bases associated with the agent template. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "long_description": "str", # Optional. The long + description of the agent template. + "max_tokens": 0, # Optional. The max_tokens setting + for the agent template. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The short + description of the agent template. + "summary": "str", # Optional. The summary of the + agent template. + "tags": [ + "str" # Optional. List of tags associated + with the agent template. + ], + "temperature": 0.0, # Optional. The temperature + setting for the agent template. + "template_type": "AGENT_TEMPLATE_TYPE_STANDARD", # + Optional. Default value is "AGENT_TEMPLATE_TYPE_STANDARD". * + AGENT_TEMPLATE_TYPE_STANDARD: The standard agent template * + AGENT_TEMPLATE_TYPE_ONE_CLICK: The one click agent template. Known + values are: "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting for the + agent template. + "updated_at": "2020-02-20 00:00:00", # Optional. The + agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "url": "str", # Optional. Access your agent under this url. + "user_id": "str", # Optional. Id of user that created the + agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest version of the + agent. + "workspace": { + "agents": [ + ... + ], + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date. + "created_by": "str", # Optional. The id of user who + created this workspace. + "created_by_email": "str", # Optional. The email of + the user who created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. + Deleted date. + "description": "str", # Optional. Description of the + workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "created_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "created_by_user_email": "str", # + Optional. Evaluations. + "created_by_user_id": "str", # + Optional. Evaluations. + "dataset": { + "created_at": "2020-02-20 + 00:00:00", # Optional. Time created at. + "dataset_name": "str", # + Optional. Name of the dataset. + "dataset_uuid": "str", # + Optional. UUID of the dataset. + "file_size": "str", # + Optional. The size of the dataset uploaded file in bytes. + "has_ground_truth": bool, # + Optional. Does the dataset have a ground truth column?. + "row_count": 0 # Optional. + Number of rows in the dataset. + }, + "dataset_name": "str", # Optional. + Evaluations. + "dataset_uuid": "str", # Optional. + Evaluations. + "description": "str", # Optional. + Evaluations. + "latest_version_number_of_runs": 0, + # Optional. Evaluations. + "metrics": [ + { + "description": "str", + # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning + that a lower value is better. + "metric_name": "str", + # Optional. Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", + "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", + # Optional. Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default + value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known + values are: "METRIC_VALUE_TYPE_UNSPECIFIED", + "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # + Optional. The maximum value for the metric. + "range_min": 0.0 # + Optional. The minimum value for the metric. + } + ], + "name": "str", # Optional. + Evaluations. + "star_metric": { + "metric_uuid": "str", # + Optional. Evaluations. + "name": "str", # Optional. + Evaluations. + "success_threshold": 0.0, # + Optional. The success threshold for the star metric. This + is a value that the metric must reach to be considered + successful. + "success_threshold_pct": 0 # + Optional. The success threshold for the star metric. This + is a percentage value between 0 and 100. + }, + "test_case_uuid": "str", # Optional. + Evaluations. + "total_runs": 0, # Optional. + Evaluations. + "updated_at": "2020-02-20 00:00:00", + # Optional. Evaluations. + "updated_by_user_email": "str", # + Optional. Evaluations. + "updated_by_user_id": "str", # + Optional. Evaluations. + "version": 0 # Optional. + Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. + Update date. + "uuid": "str" # Optional. Unique id. + } + } + ], + "links": { + "pages": { + "first": "str", # Optional. First page. + "last": "str", # Optional. Last page. + "next": "str", # Optional. Next page. + "previous": "str" # Optional. Previous page. + } + }, + "meta": { + "page": 0, # Optional. The current page. + "pages": 0, # Optional. Total number of pages. + "total": 0 # Optional. Total amount of items over all pages. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_genai_list_agents_by_workspace_request( + workspace_uuid=workspace_uuid, + only_deployed=only_deployed, + page=page, + per_page=per_page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def update_agents_workspace( + self, + workspace_uuid: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Move Agents to a Workspace. + + To move all listed agents a given workspace, send a PUT request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/agents``. + + :param workspace_uuid: Workspace uuid to move agents to. Required. + :type workspace_uuid: str + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Agent uuids. + ], + "workspace_uuid": "str" # Optional. Workspace uuid to move agents to. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. + }, + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } + }, + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... + ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "top_p": 0.0, # Optional. Agents. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. - ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... } ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key last updated - date. - "uuid": "str" # Optional. Uuid. + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -213165,104 +227443,29 @@ def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_genai_delete_openai_api_key_request( - api_key_uuid=api_key_uuid, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) # type: ignore - - @distributed_trace - def list_agents_by_openai_key( + @overload + def update_agents_workspace( self, - uuid: str, + workspace_uuid: str, + body: Optional[IO[bytes]] = None, *, - page: Optional[int] = None, - per_page: Optional[int] = None, + content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """List agents by OpenAI key. + """Move Agents to a Workspace. - List Agents by OpenAI Key. + To move all listed agents a given workspace, send a PUT request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/agents``. - :param uuid: Unique ID of OpenAI key. Required. - :type uuid: str - :keyword page: Page number. Default value is None. - :paramtype page: int - :keyword per_page: Items per page. Default value is None. - :paramtype per_page: int + :param workspace_uuid: Workspace uuid to move agents to. Required. + :type workspace_uuid: str + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -213272,259 +227475,487 @@ def list_agents_by_openai_key( # response body for status code(s): 200 response == { - "agents": [ - { - "anthropic_api_key": { - "created_at": "2020-02-20 00:00:00", # Optional. Key - creation date. - "created_by": "str", # Optional. Created by user id - from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key - deleted date. - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key - last updated date. - "uuid": "str" # Optional. Uuid. - }, - "api_key_infos": [ - { + "workspace": { + "agents": [ + { + "anthropic_api_key": { "created_at": "2020-02-20 00:00:00", # - Optional. Creation date. - "created_by": "str", # Optional. Created by. + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. "deleted_at": "2020-02-20 00:00:00", # - Optional. Deleted date. + Optional. Key deleted date. "name": "str", # Optional. Name. - "secret_key": "str", # Optional. Api key - infos. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. "uuid": "str" # Optional. Uuid. - } - ], - "api_keys": [ - { - "api_key": "str" # Optional. Api key. - } - ], - "chatbot": { - "button_background_color": "str", # Optional. A - Chatbot. - "logo": "str", # Optional. A Chatbot. - "name": "str", # Optional. Name of chatbot. - "primary_color": "str", # Optional. A Chatbot. - "secondary_color": "str", # Optional. A Chatbot. - "starting_message": "str" # Optional. A Chatbot. - }, - "chatbot_identifiers": [ - { - "agent_chatbot_identifier": "str" # - Optional. Agent chatbot identifier. - } - ], - "child_agents": [ - ... - ], - "created_at": "2020-02-20 00:00:00", # Optional. Creation - date / time. - "deployment": { + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. + } + ], + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "name": "str", # Optional. Name. - "status": "STATUS_UNKNOWN", # Optional. Default - value is "STATUS_UNKNOWN". Known values are: "STATUS_UNKNOWN", - "STATUS_WAITING_FOR_DEPLOYMENT", "STATUS_DEPLOYING", - "STATUS_RUNNING", "STATUS_FAILED", "STATUS_WAITING_FOR_UNDEPLOYMENT", - "STATUS_UNDEPLOYING", "STATUS_UNDEPLOYMENT_FAILED", and - "STATUS_DELETED". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "url": "str", # Optional. Access your deployed agent - here. - "uuid": "str", # Optional. Unique id. - "visibility": "VISIBILITY_UNKNOWN" # Optional. - Default value is "VISIBILITY_UNKNOWN". * VISIBILITY_UNKNOWN: The - status of the deployment is unknown * VISIBILITY_DISABLED: The - deployment is disabled and will no longer service requests * - VISIBILITY_PLAYGROUND: Deprecated: No longer a valid state * - VISIBILITY_PUBLIC: The deployment is public and will service requests - from the public internet * VISIBILITY_PRIVATE: The deployment is - private and will only service requests from other agents, or through - API keys. Known values are: "VISIBILITY_UNKNOWN", - "VISIBILITY_DISABLED", "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", - and "VISIBILITY_PRIVATE". - }, - "description": "str", # Optional. Description of agent. - "functions": [ - { - "api_key": "str", # Optional. Api key. + "deployment": { "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "created_by": "str", # Optional. Created by - user id from DO. - "description": "str", # Optional. Agent - description. - "faas_name": "str", # Optional. - "faas_namespace": "str", # Optional. - "input_schema": {}, # Optional. Any object. "name": "str", # Optional. Name. - "output_schema": {}, # Optional. Any object. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "url": "str", # Optional. Download your - agent here. - "uuid": "str" # Optional. Unique id. - } - ], - "guardrails": [ - { - "agent_uuid": "str", # Optional. The - guardrails the agent is attached to. - "created_at": "2020-02-20 00:00:00", # - Optional. The guardrails the agent is attached to. - "default_response": "str", # Optional. The - guardrails the agent is attached to. - "description": "str", # Optional. The - guardrails the agent is attached to. - "guardrail_uuid": "str", # Optional. The - guardrails the agent is attached to. - "is_attached": bool, # Optional. The - guardrails the agent is attached to. - "is_default": bool, # Optional. The - guardrails the agent is attached to. - "metadata": {}, # Optional. Any object. - "name": "str", # Optional. The guardrails - the agent is attached to. - "priority": 0, # Optional. The guardrails - the agent is attached to. - "type": "GUARDRAIL_TYPE_UNKNOWN", # - Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known values - are: "GUARDRAIL_TYPE_UNKNOWN", "GUARDRAIL_TYPE_JAILBREAK", - "GUARDRAIL_TYPE_SENSITIVE_DATA", and - "GUARDRAIL_TYPE_CONTENT_MODERATION". - "updated_at": "2020-02-20 00:00:00", # - Optional. The guardrails the agent is attached to. - "uuid": "str" # Optional. The guardrails the - agent is attached to. - } - ], - "if_case": "str", # Optional. - "instruction": "str", # Optional. Agent instruction. - Instructions help your agent to perform its job effectively. See `Write - Effective Agent Instructions - `_ - for best practices. - "k": 0, # Optional. - "knowledge_bases": [ - { - "added_to_agent_at": "2020-02-20 00:00:00", - # Optional. Time when the knowledge base was added to the agent. - "created_at": "2020-02-20 00:00:00", # - Optional. Creation date / time. - "database_id": "str", # Optional. Knowledge - bases. - "embedding_model_uuid": "str", # Optional. - Knowledge bases. - "is_public": bool, # Optional. Whether the - knowledge base is public or not. - "last_indexing_job": { - "completed_datasources": 0, # - Optional. Number of datasources indexed completed. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ + { + "api_key": "str", # Optional. Api + key. "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. - "data_source_uuids": [ - "str" # Optional. - IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", - # Optional. IndexingJob description. - "knowledge_base_uuid": "str", # - Optional. Knowledge base id. - "phase": "BATCH_JOB_PHASE_UNKNOWN", - # Optional. Default value is "BATCH_JOB_PHASE_UNKNOWN". Known - values are: "BATCH_JOB_PHASE_UNKNOWN", - "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING", - "BATCH_JOB_PHASE_SUCCEEDED", "BATCH_JOB_PHASE_FAILED", - "BATCH_JOB_PHASE_ERROR", and "BATCH_JOB_PHASE_CANCELLED". - "started_at": "2020-02-20 00:00:00", - # Optional. IndexingJob description. - "tokens": 0, # Optional. Number of - tokens. - "total_datasources": 0, # Optional. - Number of datasources being indexed. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. "uuid": "str" # Optional. Unique id. + } + ], + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. + "knowledge_bases": [ + { + "added_to_agent_at": "2020-02-20 + 00:00:00", # Optional. Time when the knowledge base was + added to the agent. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "database_id": "str", # Optional. + Knowledge bases. + "embedding_model_uuid": "str", # + Optional. Knowledge bases. + "is_public": bool, # Optional. + Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, + # Optional. Number of datasources indexed completed. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "knowledge_base_uuid": "str", + # Optional. Knowledge base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value is + "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", and + "BATCH_JOB_PHASE_CANCELLED". + "started_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # Optional. + Number of tokens. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. + Unique id. + }, + "name": "str", # Optional. Name of + knowledge base. + "project_id": "str", # Optional. + Knowledge bases. + "region": "str", # Optional. Region + code. + "tags": [ + "str" # Optional. Tags to + organize related resources. + ], + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "user_id": "str", # Optional. Id of + user that created the knowledge base. + "uuid": "str" # Optional. Unique id + for knowledge base. + } + ], + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. + "model": { + "agreement": { + "description": "str", # Optional. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. }, - "name": "str", # Optional. Name of knowledge - base. - "project_id": "str", # Optional. Knowledge - bases. - "region": "str", # Optional. Region code. - "tags": [ - "str" # Optional. Tags to organize - related resources.:code:`
`Requires ``tag:read`` scope. - ], + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # Optional. + Internally used version. + "is_foundational": bool, # Optional. True if + it is a foundational model provided by do. + "metadata": {}, # Optional. Additional meta + data. + "name": "str", # Optional. Name of the + model. + "parent_uuid": "str", # Optional. Unique id + of the model, this model is based on. + "provider": "MODEL_PROVIDER_DIGITALOCEAN", # + Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known + values are: "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. - "user_id": "str", # Optional. Id of user - that created the knowledge base. - "uuid": "str" # Optional. Unique id for - knowledge base. - } - ], - "max_tokens": 0, # Optional. - "model": { - "agreement": { - "description": "str", # Optional. Agreement - Description. - "name": "str", # Optional. Agreement - Description. - "url": "str", # Optional. Agreement - Description. - "uuid": "str" # Optional. Agreement - Description. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. + ], + "uuid": "str", # Optional. Unique id. + "version": { + "major": 0, # Optional. Major + version number. + "minor": 0, # Optional. Minor + version number. + "patch": 0 # Optional. Patch version + number. + } }, - "created_at": "2020-02-20 00:00:00", # Optional. - Creation date / time. - "inference_name": "str", # Optional. Internally used - name. - "inference_version": "str", # Optional. Internally - used version. - "is_foundational": bool, # Optional. True if it is a - foundational model provided by do. - "metadata": {}, # Optional. Additional meta data. - "name": "str", # Optional. Name of the model. - "parent_uuid": "str", # Optional. Unique id of the - model, this model is based on. - "provider": "MODEL_PROVIDER_DIGITALOCEAN", # - Optional. Default value is "MODEL_PROVIDER_DIGITALOCEAN". Known - values are: "MODEL_PROVIDER_DIGITALOCEAN", - "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". - "updated_at": "2020-02-20 00:00:00", # Optional. - Last modified. - "upload_complete": bool, # Optional. Model has been - fully uploaded. - "url": "str", # Optional. Download url. - "usecases": [ - "str" # Optional. Usecases of the model. + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ + ... ], - "uuid": "str", # Optional. Unique id. - "version": { - "major": 0, # Optional. Major version - number. - "minor": 0, # Optional. Minor version - number. - "patch": 0 # Optional. Patch version number. - } - }, - "name": "str", # Optional. Agent name. - "openai_api_key": { - "created_at": "2020-02-20 00:00:00", # Optional. Key - creation date. - "created_by": "str", # Optional. Created by user id - from DO. - "deleted_at": "2020-02-20 00:00:00", # Optional. Key - deleted date. - "models": [ - { + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { "agreement": { "description": "str", # Optional. Agreement Description. @@ -213574,57 +228005,340 @@ def list_agents_by_openai_key( "patch": 0 # Optional. Patch version number. } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ + { + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. + Evaluations. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + Evaluations. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. + "updated_at": "2020-02-20 00:00:00", # Optional. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. + } + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def update_agents_workspace( + self, + workspace_uuid: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Move Agents to a Workspace. + + To move all listed agents a given workspace, send a PUT request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/agents``. + + :param workspace_uuid: Workspace uuid to move agents to. Required. + :type workspace_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "agent_uuids": [ + "str" # Optional. Agent uuids. + ], + "workspace_uuid": "str" # Optional. Workspace uuid to move agents to. + } + + # response body for status code(s): 200 + response == { + "workspace": { + "agents": [ + { + "anthropic_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "api_key_infos": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date. + "created_by": "str", # Optional. + Created by. + "deleted_at": "2020-02-20 00:00:00", + # Optional. Deleted date. + "name": "str", # Optional. Name. + "secret_key": "str", # Optional. Api + key infos. + "uuid": "str" # Optional. Uuid. + } + ], + "api_keys": [ + { + "api_key": "str" # Optional. Api + key. + } + ], + "chatbot": { + "button_background_color": "str", # + Optional. A Chatbot. + "logo": "str", # Optional. A Chatbot. + "name": "str", # Optional. Name of chatbot. + "primary_color": "str", # Optional. A + Chatbot. + "secondary_color": "str", # Optional. A + Chatbot. + "starting_message": "str" # Optional. A + Chatbot. + }, + "chatbot_identifiers": [ + { + "agent_chatbot_identifier": "str" # + Optional. Agent chatbot identifier. } ], - "name": "str", # Optional. Name. - "updated_at": "2020-02-20 00:00:00", # Optional. Key - last updated date. - "uuid": "str" # Optional. Uuid. - }, - "parent_agents": [ - ... - ], - "project_id": "str", # Optional. The project for this - agent.:code:`
`Requires ``project:read`` scope. - "provide_citations": bool, # Optional. Whether the agent - should provide in-response citations. - "region": "str", # Optional. Region code. - "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # Optional. - Default value is "RETRIEVAL_METHOD_UNKNOWN". * RETRIEVAL_METHOD_UNKNOWN: - The retrieval method is unknown * RETRIEVAL_METHOD_REWRITE: The - retrieval method is rewrite * RETRIEVAL_METHOD_STEP_BACK: The retrieval - method is step back * RETRIEVAL_METHOD_SUB_QUERIES: The retrieval - method is sub queries * RETRIEVAL_METHOD_NONE: The retrieval method is - none. Known values are: "RETRIEVAL_METHOD_UNKNOWN", - "RETRIEVAL_METHOD_REWRITE", "RETRIEVAL_METHOD_STEP_BACK", - "RETRIEVAL_METHOD_SUB_QUERIES", and "RETRIEVAL_METHOD_NONE". - "route_created_at": "2020-02-20 00:00:00", # Optional. - Creation of route date / time. - "route_created_by": "str", # Optional. - "route_name": "str", # Optional. Route name. - "route_uuid": "str", # Optional. - "tags": [ - "str" # Optional. Agent tag to organize related - resources.:code:`
`Requires ``tag:read`` scope. - ], - "temperature": 0.0, # Optional. - "template": { - "created_at": "2020-02-20 00:00:00", # Optional. The - agent template's creation date. - "description": "str", # Optional. Deprecated - Use - summary instead. - "guardrails": [ + "child_agents": [ + ... + ], + "conversation_logs_enabled": bool, # Optional. + Whether conversation logs are enabled for the agent. + "created_at": "2020-02-20 00:00:00", # Optional. + Creation date / time. + "deployment": { + "created_at": "2020-02-20 00:00:00", # + Optional. Creation date / time. + "name": "str", # Optional. Name. + "status": "STATUS_UNKNOWN", # Optional. + Default value is "STATUS_UNKNOWN". Known values are: + "STATUS_UNKNOWN", "STATUS_WAITING_FOR_DEPLOYMENT", + "STATUS_DEPLOYING", "STATUS_RUNNING", "STATUS_FAILED", + "STATUS_WAITING_FOR_UNDEPLOYMENT", "STATUS_UNDEPLOYING", + "STATUS_UNDEPLOYMENT_FAILED", and "STATUS_DELETED". + "updated_at": "2020-02-20 00:00:00", # + Optional. Last modified. + "url": "str", # Optional. Access your + deployed agent here. + "uuid": "str", # Optional. Unique id. + "visibility": "VISIBILITY_UNKNOWN" # + Optional. Default value is "VISIBILITY_UNKNOWN". * + VISIBILITY_UNKNOWN: The status of the deployment is unknown * + VISIBILITY_DISABLED: The deployment is disabled and will no + longer service requests * VISIBILITY_PLAYGROUND: Deprecated: No + longer a valid state * VISIBILITY_PUBLIC: The deployment is + public and will service requests from the public internet * + VISIBILITY_PRIVATE: The deployment is private and will only + service requests from other agents, or through API keys. Known + values are: "VISIBILITY_UNKNOWN", "VISIBILITY_DISABLED", + "VISIBILITY_PLAYGROUND", "VISIBILITY_PUBLIC", and + "VISIBILITY_PRIVATE". + }, + "description": "str", # Optional. Description of + agent. + "functions": [ { - "priority": 0, # Optional. Priority - of the guardrail. - "uuid": "str" # Optional. Uuid of - the guardrail. + "api_key": "str", # Optional. Api + key. + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "created_by": "str", # Optional. + Created by user id from DO. + "description": "str", # Optional. + Agent description. + "faas_name": "str", # Optional. + Agents. + "faas_namespace": "str", # Optional. + Agents. + "input_schema": {}, # Optional. Any + object. + "name": "str", # Optional. Name. + "output_schema": {}, # Optional. Any + object. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "url": "str", # Optional. Download + your agent here. + "uuid": "str" # Optional. Unique id. } ], - "instruction": "str", # Optional. Instructions for - the agent template. - "k": 0, # Optional. The 'k' value for the agent - template. + "guardrails": [ + { + "agent_uuid": "str", # Optional. The + guardrails the agent is attached to. + "created_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "default_response": "str", # + Optional. The guardrails the agent is attached to. + "description": "str", # Optional. + The guardrails the agent is attached to. + "guardrail_uuid": "str", # Optional. + The guardrails the agent is attached to. + "is_attached": bool, # Optional. The + guardrails the agent is attached to. + "is_default": bool, # Optional. The + guardrails the agent is attached to. + "metadata": {}, # Optional. Any + object. + "name": "str", # Optional. The + guardrails the agent is attached to. + "priority": 0, # Optional. The + guardrails the agent is attached to. + "type": "GUARDRAIL_TYPE_UNKNOWN", # + Optional. Default value is "GUARDRAIL_TYPE_UNKNOWN". Known + values are: "GUARDRAIL_TYPE_UNKNOWN", + "GUARDRAIL_TYPE_JAILBREAK", "GUARDRAIL_TYPE_SENSITIVE_DATA", + and "GUARDRAIL_TYPE_CONTENT_MODERATION". + "updated_at": "2020-02-20 00:00:00", + # Optional. The guardrails the agent is attached to. + "uuid": "str" # Optional. The + guardrails the agent is attached to. + } + ], + "if_case": "str", # Optional. Agents. + "instruction": "str", # Optional. Agent instruction. + Instructions help your agent to perform its job effectively. See + `Write Effective Agent Instructions + `_ + for best practices. + "k": 0, # Optional. Agents. "knowledge_bases": [ { "added_to_agent_at": "2020-02-20 @@ -213633,10 +228347,9 @@ def list_agents_by_openai_key( "created_at": "2020-02-20 00:00:00", # Optional. Creation date / time. "database_id": "str", # Optional. - List of knowledge bases associated with the agent template. + Knowledge bases. "embedding_model_uuid": "str", # - Optional. List of knowledge bases associated with the agent - template. + Optional. Knowledge bases. "is_public": bool, # Optional. Whether the knowledge base is public or not. "last_indexing_job": { @@ -213661,6 +228374,14 @@ def list_agents_by_openai_key( "BATCH_JOB_PHASE_CANCELLED". "started_at": "2020-02-20 00:00:00", # Optional. IndexingJob description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default value is + "INDEX_JOB_STATUS_UNKNOWN". Known values are: + "INDEX_JOB_STATUS_UNKNOWN", "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". "tokens": 0, # Optional. Number of tokens. "total_datasources": 0, # @@ -213673,13 +228394,12 @@ def list_agents_by_openai_key( "name": "str", # Optional. Name of knowledge base. "project_id": "str", # Optional. - List of knowledge bases associated with the agent template. + Knowledge bases. "region": "str", # Optional. Region code. "tags": [ "str" # Optional. Tags to - organize related resources.:code:`
`Requires - ``tag:read`` scope. + organize related resources. ], "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. @@ -213689,10 +228409,17 @@ def list_agents_by_openai_key( for knowledge base. } ], - "long_description": "str", # Optional. The long - description of the agent template. - "max_tokens": 0, # Optional. The max_tokens setting - for the agent template. + "logging_config": { + "galileo_project_id": "str", # Optional. + Galileo project identifier. + "galileo_project_name": "str", # Optional. + Name of the Galileo project. + "log_stream_id": "str", # Optional. + Identifier for the log stream. + "log_stream_name": "str" # Optional. Name of + the log stream. + }, + "max_tokens": 0, # Optional. Agents. "model": { "agreement": { "description": "str", # Optional. @@ -213741,135 +228468,380 @@ def list_agents_by_openai_key( number. } }, - "name": "str", # Optional. Name of the agent - template. - "short_description": "str", # Optional. The short - description of the agent template. - "summary": "str", # Optional. The summary of the - agent template. - "tags": [ - "str" # Optional. List of tags associated - with the agent template. - ], - "temperature": 0.0, # Optional. The temperature - setting for the agent template. - "template_type": "AGENT_TEMPLATE_TYPE_STANDARD", # - Optional. Default value is "AGENT_TEMPLATE_TYPE_STANDARD". * - AGENT_TEMPLATE_TYPE_STANDARD: The standard agent template * - AGENT_TEMPLATE_TYPE_ONE_CLICK: The one click agent template. Known - values are: "AGENT_TEMPLATE_TYPE_STANDARD" and - "AGENT_TEMPLATE_TYPE_ONE_CLICK". - "top_p": 0.0, # Optional. The top_p setting for the - agent template. - "updated_at": "2020-02-20 00:00:00", # Optional. The - agent template's last updated date. - "uuid": "str" # Optional. Unique id. - }, - "top_p": 0.0, # Optional. - "updated_at": "2020-02-20 00:00:00", # Optional. Last - modified. - "url": "str", # Optional. Access your agent under this url. - "user_id": "str", # Optional. Id of user that created the - agent. - "uuid": "str", # Optional. Unique agent id. - "workspace": { - "agents": [ + "name": "str", # Optional. Agent name. + "openai_api_key": { + "created_at": "2020-02-20 00:00:00", # + Optional. Key creation date. + "created_by": "str", # Optional. Created by + user id from DO. + "deleted_at": "2020-02-20 00:00:00", # + Optional. Key deleted date. + "models": [ + { + "agreement": { + "description": "str", + # Optional. Agreement Description. + "name": "str", # + Optional. Agreement Description. + "url": "str", # + Optional. Agreement Description. + "uuid": "str" # + Optional. Agreement Description. + }, + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "inference_name": "str", # + Optional. Internally used name. + "inference_version": "str", + # Optional. Internally used version. + "is_foundational": bool, # + Optional. True if it is a foundational model provided by + do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. + Name of the model. + "parent_uuid": "str", # + Optional. Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value + is "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", + "MODEL_PROVIDER_ANTHROPIC", and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "upload_complete": bool, # + Optional. Model has been fully uploaded. + "url": "str", # Optional. + Download url. + "usecases": [ + "str" # Optional. + Usecases of the model. + ], + "uuid": "str", # Optional. + Unique id. + "version": { + "major": 0, # + Optional. Major version number. + "minor": 0, # + Optional. Minor version number. + "patch": 0 # + Optional. Patch version number. + } + } + ], + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # + Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. + }, + "parent_agents": [ ... ], + "project_id": "str", # Optional. Agents. + "provide_citations": bool, # Optional. Whether the + agent should provide in-response citations. + "region": "str", # Optional. Region code. + "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN", # + Optional. Default value is "RETRIEVAL_METHOD_UNKNOWN". * + RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown * + RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite * + RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back * + RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries * + RETRIEVAL_METHOD_NONE: The retrieval method is none. Known values + are: "RETRIEVAL_METHOD_UNKNOWN", "RETRIEVAL_METHOD_REWRITE", + "RETRIEVAL_METHOD_STEP_BACK", "RETRIEVAL_METHOD_SUB_QUERIES", and + "RETRIEVAL_METHOD_NONE". + "route_created_at": "2020-02-20 00:00:00", # + Optional. Creation of route date / time. + "route_created_by": "str", # Optional. Agents. + "route_name": "str", # Optional. Route name. + "route_uuid": "str", # Optional. Agents. + "tags": [ + "str" # Optional. Agent tag to organize + related resources. + ], + "temperature": 0.0, # Optional. Agents. + "template": { + "created_at": "2020-02-20 00:00:00", # + Optional. The agent template's creation date. + "description": "str", # Optional. Deprecated + - Use summary instead. + "guardrails": [ + { + "priority": 0, # Optional. + Priority of the guardrail. + "uuid": "str" # Optional. + Uuid of the guardrail. + } + ], + "instruction": "str", # Optional. + Instructions for the agent template. + "k": 0, # Optional. The 'k' value for the + agent template. + "knowledge_bases": [ + { + "added_to_agent_at": + "2020-02-20 00:00:00", # Optional. Time when the + knowledge base was added to the agent. + "created_at": "2020-02-20 + 00:00:00", # Optional. Creation date / time. + "database_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "embedding_model_uuid": + "str", # Optional. List of knowledge bases associated + with the agent template. + "is_public": bool, # + Optional. Whether the knowledge base is public or not. + "last_indexing_job": { + "completed_datasources": 0, # Optional. Number of + datasources indexed completed. + "created_at": + "2020-02-20 00:00:00", # Optional. Creation date / + time. + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "knowledge_base_uuid": "str", # Optional. Knowledge + base id. + "phase": + "BATCH_JOB_PHASE_UNKNOWN", # Optional. Default value + is "BATCH_JOB_PHASE_UNKNOWN". Known values are: + "BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", + "BATCH_JOB_PHASE_RUNNING", + "BATCH_JOB_PHASE_SUCCEEDED", + "BATCH_JOB_PHASE_FAILED", "BATCH_JOB_PHASE_ERROR", + and "BATCH_JOB_PHASE_CANCELLED". + "started_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "status": + "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default + value is "INDEX_JOB_STATUS_UNKNOWN". Known values + are: "INDEX_JOB_STATUS_UNKNOWN", + "INDEX_JOB_STATUS_PARTIAL", + "INDEX_JOB_STATUS_IN_PROGRESS", + "INDEX_JOB_STATUS_COMPLETED", + "INDEX_JOB_STATUS_FAILED", + "INDEX_JOB_STATUS_NO_CHANGES", and + "INDEX_JOB_STATUS_PENDING". + "tokens": 0, # + Optional. Number of tokens. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "updated_at": + "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # + Optional. Unique id. + }, + "name": "str", # Optional. + Name of knowledge base. + "project_id": "str", # + Optional. List of knowledge bases associated with the + agent template. + "region": "str", # Optional. + Region code. + "tags": [ + "str" # Optional. + Tags to organize related resources. + ], + "updated_at": "2020-02-20 + 00:00:00", # Optional. Last modified. + "user_id": "str", # + Optional. Id of user that created the knowledge base. + "uuid": "str" # Optional. + Unique id for knowledge base. + } + ], + "long_description": "str", # Optional. The + long description of the agent template. + "max_tokens": 0, # Optional. The max_tokens + setting for the agent template. + "model": { + "agreement": { + "description": "str", # + Optional. Agreement Description. + "name": "str", # Optional. + Agreement Description. + "url": "str", # Optional. + Agreement Description. + "uuid": "str" # Optional. + Agreement Description. + }, + "created_at": "2020-02-20 00:00:00", + # Optional. Creation date / time. + "inference_name": "str", # Optional. + Internally used name. + "inference_version": "str", # + Optional. Internally used version. + "is_foundational": bool, # Optional. + True if it is a foundational model provided by do. + "metadata": {}, # Optional. + Additional meta data. + "name": "str", # Optional. Name of + the model. + "parent_uuid": "str", # Optional. + Unique id of the model, this model is based on. + "provider": + "MODEL_PROVIDER_DIGITALOCEAN", # Optional. Default value is + "MODEL_PROVIDER_DIGITALOCEAN". Known values are: + "MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", + and "MODEL_PROVIDER_OPENAI". + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "upload_complete": bool, # Optional. + Model has been fully uploaded. + "url": "str", # Optional. Download + url. + "usecases": [ + "str" # Optional. Usecases + of the model. + ], + "uuid": "str", # Optional. Unique + id. + "version": { + "major": 0, # Optional. + Major version number. + "minor": 0, # Optional. + Minor version number. + "patch": 0 # Optional. Patch + version number. + } + }, + "name": "str", # Optional. Name of the agent + template. + "short_description": "str", # Optional. The + short description of the agent template. + "summary": "str", # Optional. The summary of + the agent template. + "tags": [ + "str" # Optional. List of tags + associated with the agent template. + ], + "temperature": 0.0, # Optional. The + temperature setting for the agent template. + "template_type": + "AGENT_TEMPLATE_TYPE_STANDARD", # Optional. Default value is + "AGENT_TEMPLATE_TYPE_STANDARD". * AGENT_TEMPLATE_TYPE_STANDARD: + The standard agent template * AGENT_TEMPLATE_TYPE_ONE_CLICK: + The one click agent template. Known values are: + "AGENT_TEMPLATE_TYPE_STANDARD" and + "AGENT_TEMPLATE_TYPE_ONE_CLICK". + "top_p": 0.0, # Optional. The top_p setting + for the agent template. + "updated_at": "2020-02-20 00:00:00", # + Optional. The agent template's last updated date. + "uuid": "str" # Optional. Unique id. + }, + "top_p": 0.0, # Optional. Agents. + "updated_at": "2020-02-20 00:00:00", # Optional. + Last modified. + "url": "str", # Optional. Access your agent under + this url. + "user_id": "str", # Optional. Id of user that + created the agent. + "uuid": "str", # Optional. Unique agent id. + "version_hash": "str", # Optional. The latest + version of the agent. + "workspace": ... + } + ], + "created_at": "2020-02-20 00:00:00", # Optional. Creation date. + "created_by": "str", # Optional. The id of user who created this + workspace. + "created_by_email": "str", # Optional. The email of the user who + created this workspace. + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted date. + "description": "str", # Optional. Description of the workspace. + "evaluation_test_cases": [ + { + "archived_at": "2020-02-20 00:00:00", # Optional. + Evaluations. "created_at": "2020-02-20 00:00:00", # Optional. - Creation date. - "created_by": "str", # Optional. The id of user who - created this workspace. - "created_by_email": "str", # Optional. The email of - the user who created this workspace. - "deleted_at": "2020-02-20 00:00:00", # Optional. - Deleted date. - "description": "str", # Optional. Description of the - workspace. - "evaluation_test_cases": [ + Evaluations. + "created_by_user_email": "str", # Optional. + Evaluations. + "created_by_user_id": "str", # Optional. + Evaluations. + "dataset": { + "created_at": "2020-02-20 00:00:00", # + Optional. Time created at. + "dataset_name": "str", # Optional. Name of + the dataset. + "dataset_uuid": "str", # Optional. UUID of + the dataset. + "file_size": "str", # Optional. The size of + the dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does + the dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in + the dataset. + }, + "dataset_name": "str", # Optional. Evaluations. + "dataset_uuid": "str", # Optional. Evaluations. + "description": "str", # Optional. Evaluations. + "latest_version_number_of_runs": 0, # Optional. + Evaluations. + "metrics": [ { - "archived_at": "2020-02-20 00:00:00", - # Optional. Evaluations. - "created_at": "2020-02-20 00:00:00", - # Optional. Evaluations. - "created_by_user_email": "str", # - Optional. Evaluations. - "created_by_user_id": "str", # - Optional. Evaluations. - "dataset_name": "str", # Optional. - Evaluations. - "dataset_uuid": "str", # Optional. - Evaluations. "description": "str", # Optional. Evaluations. - "latest_version_number_of_runs": 0, - # Optional. Evaluations. - "metrics": [ - { - "description": "str", - # Optional. Evaluations. - "metric_name": "str", - # Optional. Evaluations. - "metric_type": - "METRIC_TYPE_UNSPECIFIED", # Optional. Default value - is "METRIC_TYPE_UNSPECIFIED". Known values are: - "METRIC_TYPE_UNSPECIFIED", - "METRIC_TYPE_GENERAL_QUALITY", and - "METRIC_TYPE_RAG_AND_TOOL". - "metric_uuid": "str", - # Optional. Evaluations. - "metric_value_type": - "METRIC_VALUE_TYPE_UNSPECIFIED" # Optional. Default - value is "METRIC_VALUE_TYPE_UNSPECIFIED". Known - values are: "METRIC_VALUE_TYPE_UNSPECIFIED", - "METRIC_VALUE_TYPE_NUMBER", and - "METRIC_VALUE_TYPE_STRING". - } - ], - "name": "str", # Optional. - Evaluations. - "star_metric": { - "metric_uuid": "str", # - Optional. Evaluations. - "name": "str", # Optional. - Evaluations. - "success_threshold_pct": 0 # - Optional. The success threshold for the star metric. This - is a percentage value between 0 and 100. - }, - "test_case_uuid": "str", # Optional. - Evaluations. - "total_runs": 0, # Optional. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "metric_name": "str", # Optional. Evaluations. - "updated_at": "2020-02-20 00:00:00", - # Optional. Evaluations. - "updated_by_user_email": "str", # - Optional. Evaluations. - "updated_by_user_id": "str", # - Optional. Evaluations. - "version": 0 # Optional. + "metric_type": + "METRIC_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_TYPE_UNSPECIFIED". Known values are: + "METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", and + "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. Evaluations. - } - ], - "name": "str", # Optional. Name of the workspace. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value + is "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and + "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The + maximum value for the metric. + "range_min": 0.0 # Optional. The + minimum value for the metric. + } + ], + "name": "str", # Optional. Evaluations. + "star_metric": { + "metric_uuid": "str", # Optional. + Evaluations. + "name": "str", # Optional. Evaluations. + "success_threshold": 0.0, # Optional. The + success threshold for the star metric. This is a value that the + metric must reach to be considered successful. + "success_threshold_pct": 0 # Optional. The + success threshold for the star metric. This is a percentage value + between 0 and 100. + }, + "test_case_uuid": "str", # Optional. Evaluations. + "total_runs": 0, # Optional. Evaluations. "updated_at": "2020-02-20 00:00:00", # Optional. - Update date. - "uuid": "str" # Optional. Unique id. + Evaluations. + "updated_by_user_email": "str", # Optional. + Evaluations. + "updated_by_user_id": "str", # Optional. + Evaluations. + "version": 0 # Optional. Evaluations. } - } - ], - "links": { - "pages": { - "first": "str", # Optional. First page. - "last": "str", # Optional. Last page. - "next": "str", # Optional. Next page. - "previous": "str" # Optional. Previous page. - } - }, - "meta": { - "page": 0, # Optional. The current page. - "pages": 0, # Optional. Total number of pages. - "total": 0 # Optional. Total amount of items over all pages. + ], + "name": "str", # Optional. Name of the workspace. + "updated_at": "2020-02-20 00:00:00", # Optional. Update date. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -213897,15 +228869,30 @@ def list_agents_by_openai_key( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_agents_by_openai_key_request( - uuid=uuid, - page=page, - per_page=per_page, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_genai_update_agents_workspace_request( + workspace_uuid=workspace_uuid, + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -213965,23 +228952,17 @@ def list_agents_by_openai_key( return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_datacenter_regions( - self, - *, - serves_inference: Optional[bool] = None, - serves_batch: Optional[bool] = None, - **kwargs: Any, + def list_evaluation_test_cases_by_workspace( + self, workspace_uuid: str, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """List Datacenter Regions. + """List Evaluation Test Cases by Workspace. - To list all datacenter regions, send a GET request to ``/v2/gen-ai/regions``. + To list all evaluation test cases by a workspace, send a GET request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/evaluation_test_cases``. - :keyword serves_inference: Include datacenters that serve inference. Default value is None. - :paramtype serves_inference: bool - :keyword serves_batch: Include datacenters that are capable of running batch jobs. Default - value is None. - :paramtype serves_batch: bool + :param workspace_uuid: Workspace UUID. Required. + :type workspace_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -213991,17 +228972,69 @@ def list_datacenter_regions( # response body for status code(s): 200 response == { - "regions": [ + "evaluation_test_cases": [ { - "inference_url": "str", # Optional. Url for inference - server. - "region": "str", # Optional. Region code. - "serves_batch": bool, # Optional. This datacenter is capable - of running batch jobs. - "serves_inference": bool, # Optional. This datacenter is - capable of serving inference. - "stream_inference_url": "str" # Optional. The url for the - inference streaming server. + "archived_at": "2020-02-20 00:00:00", # Optional. + "created_at": "2020-02-20 00:00:00", # Optional. + "created_by_user_email": "str", # Optional. + "created_by_user_id": "str", # Optional. + "dataset": { + "created_at": "2020-02-20 00:00:00", # Optional. + Time created at. + "dataset_name": "str", # Optional. Name of the + dataset. + "dataset_uuid": "str", # Optional. UUID of the + dataset. + "file_size": "str", # Optional. The size of the + dataset uploaded file in bytes. + "has_ground_truth": bool, # Optional. Does the + dataset have a ground truth column?. + "row_count": 0 # Optional. Number of rows in the + dataset. + }, + "dataset_name": "str", # Optional. + "dataset_uuid": "str", # Optional. + "description": "str", # Optional. + "latest_version_number_of_runs": 0, # Optional. + "metrics": [ + { + "description": "str", # Optional. + "inverted": bool, # Optional. If true, the + metric is inverted, meaning that a lower value is better. + "metric_name": "str", # Optional. + "metric_type": "METRIC_TYPE_UNSPECIFIED", # + Optional. Default value is "METRIC_TYPE_UNSPECIFIED". Known + values are: "METRIC_TYPE_UNSPECIFIED", + "METRIC_TYPE_GENERAL_QUALITY", and "METRIC_TYPE_RAG_AND_TOOL". + "metric_uuid": "str", # Optional. + "metric_value_type": + "METRIC_VALUE_TYPE_UNSPECIFIED", # Optional. Default value is + "METRIC_VALUE_TYPE_UNSPECIFIED". Known values are: + "METRIC_VALUE_TYPE_UNSPECIFIED", "METRIC_VALUE_TYPE_NUMBER", + "METRIC_VALUE_TYPE_STRING", and "METRIC_VALUE_TYPE_PERCENTAGE". + "range_max": 0.0, # Optional. The maximum + value for the metric. + "range_min": 0.0 # Optional. The minimum + value for the metric. + } + ], + "name": "str", # Optional. + "star_metric": { + "metric_uuid": "str", # Optional. + "name": "str", # Optional. + "success_threshold": 0.0, # Optional. The success + threshold for the star metric. This is a value that the metric must + reach to be considered successful. + "success_threshold_pct": 0 # Optional. The success + threshold for the star metric. This is a percentage value between 0 + and 100. + }, + "test_case_uuid": "str", # Optional. + "total_runs": 0, # Optional. + "updated_at": "2020-02-20 00:00:00", # Optional. + "updated_by_user_email": "str", # Optional. + "updated_by_user_id": "str", # Optional. + "version": 0 # Optional. } ] } @@ -214035,9 +229068,8 @@ def list_datacenter_regions( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_datacenter_regions_request( - serves_inference=serves_inference, - serves_batch=serves_batch, + _request = build_genai_list_evaluation_test_cases_by_workspace_request( + workspace_uuid=workspace_uuid, headers=_headers, params=_params, )