diff --git a/DO_OPENAPI_COMMIT_SHA.txt b/DO_OPENAPI_COMMIT_SHA.txt index 67dd5d5..8a77b22 100644 --- a/DO_OPENAPI_COMMIT_SHA.txt +++ b/DO_OPENAPI_COMMIT_SHA.txt @@ -1 +1 @@ -b768fe5 +b454b34 diff --git a/src/pydo/aio/operations/_operations.py b/src/pydo/aio/operations/_operations.py index ced5463..59e4bef 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, @@ -178290,7 +178310,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 +178331,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 +178390,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 +178415,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 +178510,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 +178666,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 +178722,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 +178841,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 +178859,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 +178869,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 +178982,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 +179001,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 +179053,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 +179075,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 +179160,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 +179185,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 +179211,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 +179224,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 +179241,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 +179355,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 +179474,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 +179492,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 +179502,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 +179615,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 +179634,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 +179686,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 +179708,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 +179793,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 +179818,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 +179844,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 +179857,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 +179874,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 +179952,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 +180008,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 +180127,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 +180145,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 +180155,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 +180268,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 +180287,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 +180339,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 +180361,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 +180446,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 +180471,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 +180497,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 +180510,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 +180527,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 +181674,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 +181793,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 +181811,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 +181821,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 +181934,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 +181953,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 +182005,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 +182027,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 +182112,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 +182137,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 +182163,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 +182176,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 +182193,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 +182310,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 +182429,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 +182447,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 +182457,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 +182570,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 +182589,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 +182641,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 +182663,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 +182748,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 +182773,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 +182799,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 +182812,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 +182829,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 +182956,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 +183075,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 +183093,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 +183103,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 +183216,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 +183235,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 +183287,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 +183309,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 +183394,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 +183419,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 +183445,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 +183458,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 +183475,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 +183705,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 +183824,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 +183842,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 +183852,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 +183965,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 +183984,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 +184036,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 +184058,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 +184143,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 +184168,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 +184194,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 +184207,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 +184224,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 +184344,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 +184463,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 +184481,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 +184491,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 +184604,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 +184623,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 +184675,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 +184697,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 +184782,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 +184807,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 +184833,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 +184846,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 +184863,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 +184994,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 +185113,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 +185131,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 +185141,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 +185254,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 +185273,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 +185325,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 +185347,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 +185432,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 +185457,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 +185483,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 +185496,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 +185513,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 +185718,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 +185837,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 +185855,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 +185865,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 +185978,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 +185997,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 +186049,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 +186071,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 +186156,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 +186181,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 +186207,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 +186220,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 +186237,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 +186420,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 +186539,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 +186557,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 +186567,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 +186680,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 +186699,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 +186751,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 +186773,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 +186858,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 +186883,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 +186909,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 +186922,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 +186939,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 +187125,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 +187244,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 +187262,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 +187272,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 +187385,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 +187404,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 +187456,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 +187478,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 +187563,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 +187588,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 +187614,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 +187627,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 +187644,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 +187831,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 +187950,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 +187968,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 +187978,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 +188091,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 +188110,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 +188162,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 +188184,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 +188269,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 +188294,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 +188320,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 +188333,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 +188350,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 +189182,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 +189301,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 +189319,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 +189329,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 +189442,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 +189461,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 +189513,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 +189535,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 +189620,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 +189645,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 +189671,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 +189684,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 +189701,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 +189851,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 +189868,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 +189880,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 +189939,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 +190058,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 +190076,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 +190086,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 +190199,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 +190218,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 +190270,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 +190292,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 +190377,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 +190402,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 +190428,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 +190441,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 +190458,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 +190575,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 +190694,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 +190712,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 +190722,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 +190835,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 +190854,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 +190906,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 +190928,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 +191013,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 +191038,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 +191064,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 +191077,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 +191094,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 +191159,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 +191176,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 +191188,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 +191247,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 +191366,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 +191384,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 +191394,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 +191507,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 +191526,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 +191578,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 +191600,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 +191685,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 +191710,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 +191736,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 +191749,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 +191766,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 +191964,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 +192083,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 +192101,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 +192111,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 +192224,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 +192243,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 +192295,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 +192317,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 +192402,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 +192427,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 +192453,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 +192466,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 +192483,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 +192669,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 +192796,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 +192818,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 +192828,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 +192952,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 +192972,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 +193028,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 +193053,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 +193146,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 +193172,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 +193198,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 +193212,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 +193231,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 +193442,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 +193561,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 +193579,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 +193589,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 +193702,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 +193721,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 +193773,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 +193795,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 +193880,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 +193905,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 +193931,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 +193944,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 +193961,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 +194078,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 +194197,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 +194215,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 +194225,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 +194338,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 +194357,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 +194409,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 +194431,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 +194516,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 +194541,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 +194567,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 +194580,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 +194597,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 +194720,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 +194839,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 +194857,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 +194867,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 +194980,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 +194999,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 +195051,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 +195073,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 +195158,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 +195183,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 +195209,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 +195222,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 +195239,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 +195481,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 +196855,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 +196980,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 +197002,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 +197012,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 +197136,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 +197156,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 +197212,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 +197237,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 +197330,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 +197356,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 +197382,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 +197396,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 +197415,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 +197550,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 +197575,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 +197703,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 +197785,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 +197793,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 +197812,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 +197852,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 +197860,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 +197879,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 +197908,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 +197928,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 +197998,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 +198063,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 +198078,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 +198130,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 +198189,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 +198304,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 +198344,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 +198425,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 +198442,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 +198520,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 +198628,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 +198763,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 +198864,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 +198933,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 +199000,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 +199015,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 +199149,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 +199209,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 +199217,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 +199235,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 +199272,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 +199280,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 +199298,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 +199314,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 +199333,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 +199400,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 +199463,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 +199489,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 +199774,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 +199836,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 +199866,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 +199906,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 +199936,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 +199953,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 +199978,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 +200048,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 +200112,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 +200138,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 +200156,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 +200216,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 +200278,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 +200305,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 +200358,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 +200385,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 +200429,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 +200449,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 +200532,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 +200595,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 +200615,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 +200681,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 +200742,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 +200760,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 +200820,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 +200881,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 +200911,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 +200960,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 +200990,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 +201034,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 +201056,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 +201135,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 +201198,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 +201414,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 +201551,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 +201577,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 +201645,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 +201664,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 +201831,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 +201894,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 +201923,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 +202084,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 +202146,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 +202175,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 +202328,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 +202507,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 +202673,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 +202755,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 +202776,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 +202806,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 +202873,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 +202891,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 +202979,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 +203040,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 +203069,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 +203931,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 +203958,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 +203980,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 +203999,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 +204057,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 +204119,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 +204147,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 +214434,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 +214466,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 +214996,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 +215338,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 +215365,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 +215385,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 +215400,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 +215459,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 +215860,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 +215943,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 +215963,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 +216059,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..de2e302 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:: @@ -189548,7 +190046,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 +190067,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 +190126,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 +190151,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 +190246,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 +190402,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 +190458,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 +190577,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 +190595,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 +190605,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 +190718,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 +190737,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 +190789,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 +190811,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 +190896,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 +190921,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 +190947,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 +190960,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 +190977,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 +191091,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 +191210,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 +191228,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 +191238,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 +191351,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 +191370,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 +191422,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 +191444,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 +191529,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 +191554,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 +191580,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 +191593,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 +191610,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 +191688,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 +191744,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 +191863,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 +191881,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 +191891,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 +192004,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 +192023,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 +192075,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 +192097,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 +192182,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 +192207,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 +192233,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 +192246,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 +192263,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 +193410,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 +193529,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 +193547,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 +193557,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 +193670,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 +193689,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 +193741,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 +193763,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 +193848,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 +193873,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 +193899,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 +193912,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 +193929,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 +194046,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 +194165,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 +194183,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 +194193,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 +194306,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 +194325,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 +194377,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 +194399,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 +194484,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 +194509,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 +194535,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 +194548,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 +194565,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 +194692,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 +194811,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 +194829,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 +194839,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 +194952,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 +194971,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 +195023,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 +195045,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 +195130,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 +195155,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 +195181,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 +195194,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 +195211,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 +195441,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 +195560,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 +195578,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 +195588,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 +195701,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 +195720,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 +195772,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 +195794,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 +195879,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 +195904,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 +195930,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 +195943,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 +195960,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 +196080,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 +196199,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 +196217,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 +196227,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 +196340,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 +196359,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 +196411,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 +196433,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 +196518,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 +196543,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 +196569,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 +196582,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 +196599,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 +196730,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 +196849,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 +196867,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 +196877,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 +196990,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 +197009,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 +197061,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 +197083,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 +197168,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 +197193,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 +197219,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 +197232,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 +197249,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 +197454,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 +197573,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 +197591,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 +197601,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 +197714,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 +197733,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 +197785,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 +197807,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 +197892,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 +197917,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 +197943,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 +197956,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 +197973,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 +198156,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 +198275,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 +198293,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 +198303,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 +198416,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 +198435,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 +198487,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 +198509,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 +198594,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 +198619,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 +198645,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 +198658,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 +198675,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 +198861,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 +198980,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 +198998,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 +199008,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 +199121,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 +199140,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 +199192,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 +199214,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 +199299,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 +199324,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 +199350,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 +199363,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 +199380,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 +199567,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 +199686,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 +199704,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 +199714,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 +199827,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 +199846,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 +199898,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 +199920,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 +200005,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 +200030,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 +200056,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 +200069,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 +200086,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 +200918,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 +201037,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 +201055,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 +201065,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 +201178,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 +201197,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 +201249,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 +201271,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 +201356,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 +201381,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 +201407,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 +201420,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 +201437,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 +201587,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 +201604,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 +201616,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 +201675,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 +201794,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 +201812,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 +201822,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 +201935,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 +201954,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 +202006,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 +202028,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 +202113,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 +202138,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 +202164,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 +202177,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 +202194,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 +202311,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 +202430,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 +202448,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 +202458,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 +202571,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 +202590,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 +202642,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 +202664,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 +202749,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 +202774,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 +202800,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 +202813,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 +202830,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 +202895,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 +202912,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 +202924,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 +202983,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 +203102,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 +203120,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 +203130,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 +203243,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 +203262,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 +203314,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 +203336,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 +203421,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 +203446,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 +203472,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 +203485,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 +203502,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 +203700,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 +203819,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 +203837,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 +203847,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 +203960,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 +203979,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 +204031,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 +204053,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 +204138,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 +204163,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 +204189,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 +204202,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 +204219,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 +204405,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 +204532,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 +204554,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 +204564,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 +204688,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 +204708,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 +204764,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 +204789,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 +204882,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 +204908,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 +204934,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 +204948,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 +204967,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 +205178,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 +205297,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 +205315,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 +205325,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 +205438,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 +205457,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 +205509,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 +205531,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 +205616,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 +205641,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 +205667,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 +205680,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 +205697,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 +205814,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 +205933,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 +205951,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 +205961,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 +206074,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 +206093,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 +206145,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 +206167,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 +206252,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 +206277,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 +206303,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 +206316,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 +206333,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 +206456,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 +206575,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 +206593,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 +206603,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 +206716,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 +206735,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 +206787,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 +206809,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 +206894,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 +206919,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 +206945,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 +206958,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 +206975,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 +207217,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 +208591,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 +208716,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 +208738,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 +208748,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 +208872,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 +208892,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 +208948,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 +208973,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 +209066,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 +209092,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 +209118,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 +209132,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 +209151,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 +209286,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 +209311,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 +209439,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 +209521,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 +209529,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 +209548,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 +209588,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 +209596,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 +209615,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 +209644,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 +209664,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 +209734,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 +209799,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 +209814,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 +209866,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 +209925,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 +210040,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 +210080,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 +210161,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 +210178,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 +210256,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 +210364,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 +210499,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 +210600,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 +210669,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 +210736,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 +210751,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 +210885,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 +210945,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 +210953,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 +210971,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 +211008,7 @@ def create_knowledge_base( """ @overload - def create_knowledge_base( + def create_evaluation_test_case( self, body: Optional[IO[bytes]] = None, *, @@ -209063,9 +211016,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 +211034,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 +211050,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 +211069,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 +211136,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 +211199,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 +211225,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 +211510,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 +211572,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 +211602,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 +211642,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 +211672,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 +211689,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 +211714,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 +211784,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 +211848,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 +211874,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 +211892,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 +211952,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 +212014,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 +212041,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 +212094,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 +212121,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 +212165,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 +212185,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 +212268,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 +212331,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 +212351,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 +212417,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 +212478,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 +212496,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 +212556,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 +212617,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 +212647,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 +212696,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 +212726,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 +212770,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 +212792,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 +212871,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 +212934,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 +213150,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 +213287,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 +213313,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 +213381,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 +213400,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 +213567,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 +213630,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 +213659,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 +213820,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 +213882,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 +213911,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 +214064,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 +214243,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 +214409,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 +214491,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 +214512,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 +214542,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 +214609,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 +214627,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 +214715,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 +214776,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 +214805,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 +215667,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 +215694,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 +215716,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 +215735,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 +215793,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 +215855,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 +215883,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 +226170,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 +226202,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 +226732,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 +227074,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 +227101,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 +227121,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 +227136,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 +227195,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 +227596,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 +227679,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 +227699,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 +227795,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, )