diff --git a/DO_OPENAPI_COMMIT_SHA.txt b/DO_OPENAPI_COMMIT_SHA.txt index a68b34d5..b8c97a26 100644 --- a/DO_OPENAPI_COMMIT_SHA.txt +++ b/DO_OPENAPI_COMMIT_SHA.txt @@ -1 +1 @@ -aa940c7 +49946b8 diff --git a/docs/source/pydo.resources.aio.inference.batches.rst b/docs/source/pydo.resources.aio.inference.batches.rst new file mode 100644 index 00000000..268fc904 --- /dev/null +++ b/docs/source/pydo.resources.aio.inference.batches.rst @@ -0,0 +1,29 @@ +pydo.resources.aio.inference.batches package +============================================ + +Submodules +---------- + +pydo.resources.aio.inference.batches.files module +------------------------------------------------- + +.. automodule:: pydo.resources.aio.inference.batches.files + :members: + :undoc-members: + :show-inheritance: + +pydo.resources.aio.inference.batches.results module +--------------------------------------------------- + +.. automodule:: pydo.resources.aio.inference.batches.results + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pydo.resources.aio.inference.batches + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pydo.resources.inference.batches.rst b/docs/source/pydo.resources.inference.batches.rst new file mode 100644 index 00000000..0e6d0d1d --- /dev/null +++ b/docs/source/pydo.resources.inference.batches.rst @@ -0,0 +1,29 @@ +pydo.resources.inference.batches package +======================================== + +Submodules +---------- + +pydo.resources.inference.batches.files module +--------------------------------------------- + +.. automodule:: pydo.resources.inference.batches.files + :members: + :undoc-members: + :show-inheritance: + +pydo.resources.inference.batches.results module +----------------------------------------------- + +.. automodule:: pydo.resources.inference.batches.results + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pydo.resources.inference.batches + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pydo.types.batches.rst b/docs/source/pydo.types.batches.rst new file mode 100644 index 00000000..61f0ae47 --- /dev/null +++ b/docs/source/pydo.types.batches.rst @@ -0,0 +1,10 @@ +pydo.types.batches package +========================== + +Module contents +--------------- + +.. automodule:: pydo.types.batches + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pydo.types.create.rst b/docs/source/pydo.types.create.rst new file mode 100644 index 00000000..28922f82 --- /dev/null +++ b/docs/source/pydo.types.create.rst @@ -0,0 +1,10 @@ +pydo.types.create package +========================= + +Module contents +--------------- + +.. automodule:: pydo.types.create + :members: + :undoc-members: + :show-inheritance: diff --git a/src/pydo/aio/operations/_operations.py b/src/pydo/aio/operations/_operations.py index aa723ce3..817722cb 100644 --- a/src/pydo/aio/operations/_operations.py +++ b/src/pydo/aio/operations/_operations.py @@ -269,6 +269,7 @@ build_genai_create_knowledge_base_data_source_request, build_genai_create_knowledge_base_request, build_genai_create_model_api_key_request, + build_genai_create_model_router_request, build_genai_create_oauth2_dropbox_tokens_request, build_genai_create_openai_api_key_request, build_genai_create_scheduled_indexing_request, @@ -279,6 +280,7 @@ build_genai_delete_knowledge_base_data_source_request, build_genai_delete_knowledge_base_request, build_genai_delete_model_api_key_request, + build_genai_delete_model_router_request, build_genai_delete_openai_api_key_request, build_genai_delete_scheduled_indexing_request, build_genai_delete_workspace_request, @@ -297,6 +299,7 @@ build_genai_get_indexing_job_details_signed_url_request, build_genai_get_indexing_job_request, build_genai_get_knowledge_base_request, + build_genai_get_model_router_request, build_genai_get_oauth2_url_request, build_genai_get_openai_api_key_request, build_genai_get_scheduled_indexing_request, @@ -319,6 +322,9 @@ build_genai_list_knowledge_base_data_sources_request, build_genai_list_knowledge_bases_request, build_genai_list_model_api_keys_request, + build_genai_list_model_router_presets_request, + build_genai_list_model_router_task_presets_request, + build_genai_list_model_routers_request, build_genai_list_models_request, build_genai_list_openai_api_keys_request, build_genai_list_workspaces_request, @@ -337,6 +343,7 @@ build_genai_update_knowledge_base_data_source_request, build_genai_update_knowledge_base_request, build_genai_update_model_api_key_request, + build_genai_update_model_router_request, build_genai_update_openai_api_key_request, build_genai_update_workspace_request, build_image_actions_get_request, @@ -351,13 +358,20 @@ build_images_post_account_transfer_create_request, build_images_post_account_transfer_decline_request, build_images_update_request, + build_inference_cancel_batch_request, build_inference_create_async_invoke_request, + build_inference_create_batch_file_request, + build_inference_create_batch_request, build_inference_create_chat_completion_request, build_inference_create_embedding_request, build_inference_create_image_request, build_inference_create_messages_request, build_inference_create_response_request, + build_inference_get_batch_request, + build_inference_get_batch_results_request, + build_inference_list_batches_request, build_inference_list_models_request, + build_inference_upload_batch_file_request, build_invoices_get_by_uuid_request, build_invoices_get_csv_by_uuid_request, build_invoices_get_pdf_by_uuid_request, @@ -4010,8 +4024,9 @@ async def list( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -4309,21 +4324,6 @@ async def list( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -4525,17 +4525,24 @@ async def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -5103,7 +5110,9 @@ async def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -5113,7 +5122,7 @@ async def list( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -5546,8 +5555,10 @@ async def list( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -5858,21 +5869,6 @@ async def list( }, "jobs": [ { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -6086,17 +6082,24 @@ async def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 + target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target + number of requests per second per instance + for the component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -6692,7 +6695,9 @@ async def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. Default value is @@ -6702,7 +6707,7 @@ async def list( }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -7239,8 +7244,10 @@ async def list( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -7551,21 +7558,6 @@ async def list( }, "jobs": [ { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -7779,17 +7771,24 @@ async def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 + target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target + number of requests per second per instance + for the component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -8385,7 +8384,9 @@ async def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. Default value is @@ -8395,7 +8396,7 @@ async def list( }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -8870,8 +8871,10 @@ async def list( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -9182,21 +9185,6 @@ async def list( }, "jobs": [ { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -9410,17 +9398,24 @@ async def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 + target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target + number of requests per second per instance + for the component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -10016,7 +10011,9 @@ async def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. Default value is @@ -10026,7 +10023,7 @@ async def list( }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -10492,8 +10489,10 @@ async def list( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -10804,21 +10803,6 @@ async def list( }, "jobs": [ { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -11032,17 +11016,24 @@ async def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 + target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target + number of requests per second per instance + for the component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -11638,7 +11629,9 @@ async def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. Default value is @@ -11648,7 +11641,7 @@ async def list( }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -12109,7 +12102,8 @@ async def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -12380,21 +12374,6 @@ async def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -12575,18 +12554,23 @@ async def create( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -13093,8 +13077,9 @@ async def create( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -13103,8 +13088,7 @@ async def create( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -13393,8 +13377,8 @@ async def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -13679,21 +13663,6 @@ async def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -13884,18 +13853,23 @@ async def create( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -14427,8 +14401,9 @@ async def create( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -14437,8 +14412,7 @@ async def create( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -14846,8 +14820,9 @@ async def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -15145,21 +15120,6 @@ async def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -15361,17 +15321,24 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -15939,7 +15906,9 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -15949,7 +15918,7 @@ async def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -16460,8 +16429,9 @@ async def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -16759,21 +16729,6 @@ async def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -16975,17 +16930,24 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -17553,7 +17515,9 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -17563,7 +17527,7 @@ async def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -18013,8 +17977,9 @@ async def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -18312,21 +18277,6 @@ async def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -18528,17 +18478,24 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -19106,7 +19063,9 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -19116,7 +19075,7 @@ async def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -19558,8 +19517,9 @@ async def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -19857,21 +19817,6 @@ async def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -20073,17 +20018,24 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -20651,7 +20603,9 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -20661,7 +20615,7 @@ async def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -21048,8 +21002,8 @@ async def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -21334,21 +21288,6 @@ async def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -21539,18 +21478,23 @@ async def create( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -22082,8 +22026,9 @@ async def create( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -22092,8 +22037,7 @@ async def create( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -22501,8 +22445,9 @@ async def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -22800,21 +22745,6 @@ async def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -23016,17 +22946,24 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -23594,7 +23531,9 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -23604,7 +23543,7 @@ async def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -24115,8 +24054,9 @@ async def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -24414,21 +24354,6 @@ async def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -24630,17 +24555,24 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -25208,7 +25140,9 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -25218,7 +25152,7 @@ async def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -25668,8 +25602,9 @@ async def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -25967,21 +25902,6 @@ async def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -26183,17 +26103,24 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -26761,7 +26688,9 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -26771,7 +26700,7 @@ async def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -27213,8 +27142,9 @@ async def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -27512,21 +27442,6 @@ async def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -27728,17 +27643,24 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -28306,7 +28228,9 @@ async def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -28316,7 +28240,7 @@ async def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -28693,7 +28617,8 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -28964,21 +28889,6 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -29159,18 +29069,23 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -29677,8 +29592,9 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -29687,8 +29603,7 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -29977,8 +29892,8 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -30263,21 +30178,6 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -30468,18 +30368,23 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -31011,8 +30916,9 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -31021,8 +30927,7 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -31430,8 +31335,9 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -31729,21 +31635,6 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -31945,17 +31836,24 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -32523,7 +32421,9 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -32533,7 +32433,7 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -33044,8 +32944,9 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -33343,21 +33244,6 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -33559,17 +33445,24 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -34137,7 +34030,9 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -34147,7 +34042,7 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -34597,8 +34492,9 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -34896,21 +34792,6 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -35112,17 +34993,24 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -35690,7 +35578,9 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -35700,7 +35590,7 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -36142,8 +36032,9 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -36441,21 +36332,6 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -36657,17 +36533,24 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -37235,7 +37118,9 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -37245,7 +37130,7 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -37814,8 +37699,8 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -38100,21 +37985,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -38305,18 +38175,23 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -38848,8 +38723,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -38858,8 +38734,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -39267,8 +39142,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -39566,21 +39442,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -39782,17 +39643,24 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -40360,7 +40228,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -40370,7 +40240,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -40881,8 +40751,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -41180,21 +41051,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -41396,17 +41252,24 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -41974,7 +41837,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -41984,7 +41849,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -42434,8 +42299,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -42733,21 +42599,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -42949,17 +42800,24 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -43527,7 +43385,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -43537,7 +43397,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -43979,8 +43839,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -44278,21 +44139,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -44494,17 +44340,24 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -45072,7 +44925,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -45082,7 +44937,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -45560,7 +45415,8 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -45831,21 +45687,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -46026,18 +45867,23 @@ async def update( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -46544,8 +46390,9 @@ async def update( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -46554,8 +46401,7 @@ async def update( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -46846,8 +46692,8 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -47132,21 +46978,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -47337,18 +47168,23 @@ async def update( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -47880,8 +47716,9 @@ async def update( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -47890,8 +47727,7 @@ async def update( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -48299,8 +48135,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -48598,21 +48435,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -48814,17 +48636,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -49392,7 +49221,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -49402,7 +49233,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -49913,8 +49744,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -50212,21 +50044,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -50428,17 +50245,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -51006,7 +50830,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -51016,7 +50842,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -51466,8 +51292,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -51765,21 +51592,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -51981,17 +51793,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -52559,7 +52378,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -52569,7 +52390,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -53011,8 +52832,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -53310,21 +53132,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -53526,17 +53333,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -54104,7 +53918,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -54114,7 +53930,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -54519,8 +54335,8 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -54805,21 +54621,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -55010,18 +54811,23 @@ async def update( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -55553,8 +55359,9 @@ async def update( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -55563,8 +55370,7 @@ async def update( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -55972,8 +55778,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -56271,21 +56078,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -56487,17 +56279,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -57065,7 +56864,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -57075,7 +56876,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -57586,8 +57387,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -57885,21 +57687,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -58101,17 +57888,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -58679,7 +58473,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -58689,7 +58485,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -59139,8 +58935,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -59438,21 +59235,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -59654,17 +59436,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -60232,7 +60021,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -60242,7 +60033,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -60684,8 +60475,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -60983,21 +60775,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -61199,17 +60976,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -61777,7 +61561,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -61787,7 +61573,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -62179,7 +61965,8 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -62450,21 +62237,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -62645,18 +62417,23 @@ async def update( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -63163,8 +62940,9 @@ async def update( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -63173,8 +62951,7 @@ async def update( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -63465,8 +63242,8 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -63751,21 +63528,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -63956,18 +63718,23 @@ async def update( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -64499,8 +64266,9 @@ async def update( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -64509,8 +64277,7 @@ async def update( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -64918,8 +64685,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -65217,21 +64985,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -65433,17 +65186,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -66011,7 +65771,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -66021,7 +65783,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -66532,8 +66294,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -66831,21 +66594,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -67047,17 +66795,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -67625,7 +67380,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -67635,7 +67392,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -68085,8 +67842,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -68384,21 +68142,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -68600,17 +68343,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -69178,7 +68928,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -69188,7 +68940,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -69630,8 +69382,9 @@ async def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -69929,21 +69682,6 @@ async def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -70145,17 +69883,24 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -70723,7 +70468,9 @@ async def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -70733,7 +70480,7 @@ async def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -71338,8 +71085,8 @@ async def restart( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -71624,21 +71371,6 @@ async def restart( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -71829,18 +71561,23 @@ async def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -72372,8 +72109,9 @@ async def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -72382,8 +72120,7 @@ async def restart( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -72842,8 +72579,8 @@ async def restart( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -73128,21 +72865,6 @@ async def restart( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -73333,18 +73055,23 @@ async def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -73876,8 +73603,9 @@ async def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -73886,8 +73614,7 @@ async def restart( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -74346,8 +74073,8 @@ async def restart( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -74632,21 +74359,6 @@ async def restart( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -74837,18 +74549,23 @@ async def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -75380,8 +75097,9 @@ async def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -75390,8 +75108,7 @@ async def restart( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -76375,8 +76092,9 @@ async def list_deployments( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -76674,21 +76392,6 @@ async def list_deployments( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -76890,17 +76593,24 @@ async def list_deployments( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -77468,7 +77178,9 @@ async def list_deployments( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -77478,7 +77190,7 @@ async def list_deployments( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -78042,8 +77754,8 @@ async def create_deployment( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -78328,21 +78040,6 @@ async def create_deployment( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -78533,18 +78230,23 @@ async def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -79076,8 +78778,9 @@ async def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -79086,8 +78789,7 @@ async def create_deployment( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -79547,8 +79249,8 @@ async def create_deployment( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -79833,21 +79535,6 @@ async def create_deployment( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -80038,18 +79725,23 @@ async def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -80581,8 +80273,9 @@ async def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -80591,8 +80284,7 @@ async def create_deployment( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -81050,8 +80742,8 @@ async def create_deployment( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -81336,21 +81028,6 @@ async def create_deployment( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -81541,18 +81218,23 @@ async def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -82084,8 +81766,9 @@ async def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -82094,8 +81777,7 @@ async def create_deployment( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -82637,8 +82319,8 @@ async def get_deployment( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -82923,21 +82605,6 @@ async def get_deployment( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -83128,18 +82795,23 @@ async def get_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -83671,8 +83343,9 @@ async def get_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -83681,8 +83354,7 @@ async def get_deployment( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -84211,8 +83883,8 @@ async def cancel_deployment( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -84497,21 +84169,6 @@ async def cancel_deployment( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -84702,18 +84359,23 @@ async def cancel_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -85245,8 +84907,9 @@ async def cancel_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -85255,8 +84918,7 @@ async def cancel_deployment( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -87069,8 +86731,10 @@ async def list_events( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -87381,21 +87045,6 @@ async def list_events( }, "jobs": [ { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -87609,17 +87258,24 @@ async def list_events( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 + target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target + number of requests per second per instance + for the component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -88215,7 +87871,9 @@ async def list_events( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. Default value is @@ -88225,7 +87883,7 @@ async def list_events( }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -88823,8 +88481,9 @@ async def get_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -89122,21 +88781,6 @@ async def get_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -89338,17 +88982,24 @@ async def get_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -89916,7 +89567,9 @@ async def get_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -89926,7 +89579,7 @@ async def get_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -90507,8 +90160,9 @@ async def cancel_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -90806,21 +90460,6 @@ async def cancel_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -91022,17 +90661,24 @@ async def cancel_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -91600,7 +91246,9 @@ async def cancel_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -91610,7 +91258,7 @@ async def cancel_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -92548,7 +92196,8 @@ async def validate_app_spec( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -92819,21 +92468,6 @@ async def validate_app_spec( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -93014,18 +92648,23 @@ async def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -93532,8 +93171,9 @@ async def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -93542,8 +93182,7 @@ async def validate_app_spec( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -93841,7 +93480,8 @@ async def validate_app_spec( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -94112,21 +93752,6 @@ async def validate_app_spec( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -94307,18 +93932,23 @@ async def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -94825,8 +94455,9 @@ async def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -94835,8 +94466,7 @@ async def validate_app_spec( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -95156,7 +94786,8 @@ async def validate_app_spec( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -95427,21 +95058,6 @@ async def validate_app_spec( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -95622,18 +95238,23 @@ async def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -96140,8 +95761,9 @@ async def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -96150,8 +95772,7 @@ async def validate_app_spec( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -96454,7 +96075,8 @@ async def validate_app_spec( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -96725,21 +96347,6 @@ async def validate_app_spec( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -96920,18 +96527,23 @@ async def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -97438,8 +97050,9 @@ async def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -97448,8 +97061,7 @@ async def validate_app_spec( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -97747,7 +97359,8 @@ async def validate_app_spec( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -98018,21 +97631,6 @@ async def validate_app_spec( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -98213,18 +97811,23 @@ async def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -98731,8 +98334,9 @@ async def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -98741,8 +98345,7 @@ async def validate_app_spec( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -99069,7 +98672,8 @@ async def list_alerts(self, app_id: str, **kwargs: Any) -> JSON: "DOMAIN_LIVE", "AUTOSCALE_FAILED", "AUTOSCALE_SUCCEEDED", "FUNCTIONS_ACTIVATION_COUNT", "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # Optional. Default value is "UNSPECIFIED_WINDOW". Known values are: @@ -99266,8 +98870,9 @@ async def assign_alert_destinations( "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", "AUTOSCALE_FAILED", "AUTOSCALE_SUCCEEDED", "FUNCTIONS_ACTIVATION_COUNT", "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # Optional. Default value is "UNSPECIFIED_WINDOW". Known values are: "UNSPECIFIED_WINDOW", @@ -99371,8 +98976,9 @@ async def assign_alert_destinations( "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", "AUTOSCALE_FAILED", "AUTOSCALE_SUCCEEDED", "FUNCTIONS_ACTIVATION_COUNT", "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # Optional. Default value is "UNSPECIFIED_WINDOW". Known values are: "UNSPECIFIED_WINDOW", @@ -99481,8 +99087,9 @@ async def assign_alert_destinations( "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", "AUTOSCALE_FAILED", "AUTOSCALE_SUCCEEDED", "FUNCTIONS_ACTIVATION_COUNT", "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # Optional. Default value is "UNSPECIFIED_WINDOW". Known values are: "UNSPECIFIED_WINDOW", @@ -99852,8 +99459,8 @@ async def create_rollback( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -100138,21 +99745,6 @@ async def create_rollback( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -100343,18 +99935,23 @@ async def create_rollback( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -100886,8 +100483,9 @@ async def create_rollback( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -100896,8 +100494,7 @@ async def create_rollback( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -101365,8 +100962,8 @@ async def create_rollback( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -101651,21 +101248,6 @@ async def create_rollback( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -101856,18 +101438,23 @@ async def create_rollback( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -102399,8 +101986,9 @@ async def create_rollback( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -102409,8 +101997,7 @@ async def create_rollback( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -102881,8 +102468,8 @@ async def create_rollback( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -103167,21 +102754,6 @@ async def create_rollback( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -103372,18 +102944,23 @@ async def create_rollback( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -103915,8 +103492,9 @@ async def create_rollback( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -103925,8 +103503,7 @@ async def create_rollback( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -104992,8 +104569,8 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -105278,21 +104855,6 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -105483,18 +105045,23 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -106026,8 +105593,9 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -106036,8 +105604,7 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -238800,8 +238367,180 @@ async def regenerate_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JS return cast(JSON, deserialized) # type: ignore + @distributed_trace_async + async def list_model_routers( + self, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List Model Routers. + + To list model routers, send a GET request to ``/v2/gen-ai/models/routers``. + + :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. + }, + "model_routers": [ + { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback + models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # + Optional. Short task description. + "name": "str" # Optional. + Task name. + }, + "models": [ + "str" # Optional. Models + assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. + One of: none, cheapest, fastest. Known values are: + "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task + slug. + } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "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_model_routers_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_oauth2_dropbox_tokens( + async def create_model_router( self, body: Optional[JSON] = None, *, @@ -238809,11 +238548,9 @@ async def create_oauth2_dropbox_tokens( **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Get Oauth2 Dropbox Tokens. + """Create a Model Router. - To obtain the refresh token, needed for creation of data sources, send a GET request to - ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the - field 'code'. + To create a model router, send a POST request to ``/v2/gen-ai/models/routers``. :param body: Default value is None. :type body: JSON @@ -238829,14 +238566,70 @@ async def create_oauth2_dropbox_tokens( # JSON input template you can fill out and use as your body input. body = { - "code": "str", # Optional. The oauth2 code from google. - "redirect_url": "str" # Optional. Redirect url. + "description": "str", # Optional. Model router description. + "fallback_models": [ + "str" # Optional. Fallback models. + ], + "name": "str", # Optional. Model router name. + "policies": [ + { + "custom_task": { + "description": "str", # Optional. Short task + description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: none, cheapest, + fastest. Known values are: "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ], + "regions": [ + "str" # Optional. Target regions for the router. + ] } # response body for status code(s): 200 response == { - "refresh_token": "str", # Optional. The refresh token. - "token": "str" # Optional. The access token. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. + } } # response body for status code(s): 404 response == { @@ -238852,7 +238645,7 @@ async def create_oauth2_dropbox_tokens( """ @overload - async def create_oauth2_dropbox_tokens( + async def create_model_router( self, body: Optional[IO[bytes]] = None, *, @@ -238860,11 +238653,9 @@ async def create_oauth2_dropbox_tokens( **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Get Oauth2 Dropbox Tokens. + """Create a Model Router. - To obtain the refresh token, needed for creation of data sources, send a GET request to - ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the - field 'code'. + To create a model router, send a POST request to ``/v2/gen-ai/models/routers``. :param body: Default value is None. :type body: IO[bytes] @@ -238880,8 +238671,41 @@ async def create_oauth2_dropbox_tokens( # response body for status code(s): 200 response == { - "refresh_token": "str", # Optional. The refresh token. - "token": "str" # Optional. The access token. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. + } } # response body for status code(s): 404 response == { @@ -238897,15 +238721,13 @@ async def create_oauth2_dropbox_tokens( """ @distributed_trace_async - async def create_oauth2_dropbox_tokens( + async def create_model_router( self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Get Oauth2 Dropbox Tokens. + """Create a Model Router. - To obtain the refresh token, needed for creation of data sources, send a GET request to - ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the - field 'code'. + To create a model router, send a POST request to ``/v2/gen-ai/models/routers``. :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] @@ -238918,14 +238740,70 @@ async def create_oauth2_dropbox_tokens( # JSON input template you can fill out and use as your body input. body = { - "code": "str", # Optional. The oauth2 code from google. - "redirect_url": "str" # Optional. Redirect url. + "description": "str", # Optional. Model router description. + "fallback_models": [ + "str" # Optional. Fallback models. + ], + "name": "str", # Optional. Model router name. + "policies": [ + { + "custom_task": { + "description": "str", # Optional. Short task + description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: none, cheapest, + fastest. Known values are: "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ], + "regions": [ + "str" # Optional. Target regions for the router. + ] } # response body for status code(s): 200 response == { - "refresh_token": "str", # Optional. The refresh token. - "token": "str" # Optional. The access token. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. + } } # response body for status code(s): 404 response == { @@ -238971,7 +238849,7 @@ async def create_oauth2_dropbox_tokens( else: _json = None - _request = build_genai_create_oauth2_dropbox_tokens_request( + _request = build_genai_create_model_router_request( content_type=content_type, json=_json, content=_content, @@ -239034,23 +238912,22 @@ async def create_oauth2_dropbox_tokens( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def get_oauth2_url( + async def list_model_router_presets( self, *, - type: Optional[str] = None, - redirect_url: Optional[str] = None, + page: Optional[int] = None, + per_page: Optional[int] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Get Oauth2 URL. + """List Model Router Presets. - To generate an Oauth2-URL for use with your localhost, send a GET request to - ``/v2/gen-ai/oauth2/url``. Pass 'http://localhost:3000 as redirect_url. + To list model router presets, send a GET request to ``/v2/gen-ai/models/routers/presets``. - :keyword type: Type "google" / "dropbox". Default value is None. - :paramtype type: str - :keyword redirect_url: The redirect url. Default value is None. - :paramtype redirect_url: 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: @@ -239060,7 +238937,57 @@ async def get_oauth2_url( # response body for status code(s): 200 response == { - "url": "str" # Optional. The oauth2 url. + "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. + }, + "presets": [ + { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback + models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # + Optional. Short task description. + "name": "str" # Optional. + Task name. + }, + "models": [ + "str" # Optional. Models + assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. + One of: none, cheapest, fastest. Known values are: + "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task + slug. + } + ] + }, + "display_name": "str", # Optional. Display name for UI + surfaces. + "long_description": "str", # Optional. Long description for + details views. + "short_description": "str", # Optional. Short description + for list views. + "slug": "str" # Optional. Stable slug for routing usage. + } + ] } # response body for status code(s): 404 response == { @@ -239092,9 +239019,9 @@ async def get_oauth2_url( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_get_oauth2_url_request( - type=type, - redirect_url=redirect_url, + _request = build_genai_list_model_router_presets_request( + page=page, + per_page=per_page, headers=_headers, params=_params, ) @@ -239154,7 +239081,7 @@ async def get_oauth2_url( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def list_openai_api_keys( + async def list_model_router_task_presets( self, *, page: Optional[int] = None, @@ -239162,9 +239089,10 @@ async def list_openai_api_keys( **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """List OpenAI API Keys. + """List Model Router Task Presets. - To list all OpenAI API keys, send a GET request to ``/v2/gen-ai/openai/keys``. + To list model router task presets, send a GET request to + ``/v2/gen-ai/models/routers/tasks/presets``. :keyword page: Page number. Default value is None. :paramtype page: int @@ -239179,76 +239107,6 @@ async def list_openai_api_keys( # 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. - "kb_default_chunk_size": 0, # Optional. - Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum - chunk size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum - chunking size token limits if model supports KNOWLEDGEBASE - usecase. - "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. @@ -239261,7 +239119,27 @@ async def list_openai_api_keys( "page": 0, # Optional. The current page. "pages": 0, # Optional. Total number of pages. "total": 0 # Optional. Total amount of items over all pages. - } + }, + "tasks": [ + { + "category": "str", # Optional. Higher-level grouping used by + the UI. + "description": "str", # Optional. Task description. + "models": [ + "str" # Optional. Default models assigned to this + task. + ], + "name": "str", # Optional. Display name. + "selection_policy": { + "prefer": "str" # Optional. One of: none, cheapest, + fastest. Known values are: "none", "cheapest", and "fastest". + }, + "tags": [ + "str" # Optional. Lightweight labels for filtering. + ], + "task_slug": "str" # Optional. Task slug. + } + ] } # response body for status code(s): 404 response == { @@ -239293,7 +239171,7 @@ async def list_openai_api_keys( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_openai_api_keys_request( + _request = build_genai_list_model_router_task_presets_request( page=page, per_page=per_page, headers=_headers, @@ -239354,19 +239232,167 @@ async def list_openai_api_keys( return cast(JSON, deserialized) # type: ignore + @distributed_trace_async + async def get_model_router(self, uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve an Existing Model Router. + + To retrieve details of a model router, send a GET request to + ``/v2/gen-ai/models/routers/{uuid}``. + + :param uuid: Model router 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 == { + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "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_model_router_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 + @overload - async def create_openai_api_key( + async def update_model_router( self, + uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create OpenAI API Key. + """Update a Model Router. - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + To update a model router, send a PUT request to ``/v2/gen-ai/models/routers/{uuid}``. + :param uuid: Model router 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. @@ -239381,72 +239407,70 @@ async def create_openai_api_key( # 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. + "description": "str", # Optional. Model router description. + "fallback_models": [ + "str" # Optional. Fallback models. + ], + "name": "str", # Optional. Model router name. + "policies": [ + { + "custom_task": { + "description": "str", # Optional. Short task + description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: none, cheapest, + fastest. Known values are: "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ], + "regions": [ + "str" # Optional. Target regions for the router. + ], + "uuid": "str" # Optional. Model router 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. } - } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. ], - "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. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -239463,18 +239487,21 @@ async def create_openai_api_key( """ @overload - async def create_openai_api_key( + async def update_model_router( self, + uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create OpenAI API Key. + """Update a Model Router. - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + To update a model router, send a PUT request to ``/v2/gen-ai/models/routers/{uuid}``. + :param uuid: Model router 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. @@ -239489,66 +239516,40 @@ async def create_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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. } - } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. ], - "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. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -239565,14 +239566,16 @@ async def create_openai_api_key( """ @distributed_trace_async - async def create_openai_api_key( - self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + async def update_model_router( + self, uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create OpenAI API Key. + """Update a Model Router. - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + To update a model router, send a PUT request to ``/v2/gen-ai/models/routers/{uuid}``. + :param uuid: Model router 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 @@ -239584,72 +239587,70 @@ async def create_openai_api_key( # 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. + "description": "str", # Optional. Model router description. + "fallback_models": [ + "str" # Optional. Fallback models. + ], + "name": "str", # Optional. Model router name. + "policies": [ + { + "custom_task": { + "description": "str", # Optional. Short task + description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: none, cheapest, + fastest. Known values are: "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ], + "regions": [ + "str" # Optional. Target regions for the router. + ], + "uuid": "str" # Optional. Model router 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. } - } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. ], - "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. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -239696,7 +239697,8 @@ async def create_openai_api_key( else: _json = None - _request = build_genai_create_openai_api_key_request( + _request = build_genai_update_model_router_request( + uuid=uuid, content_type=content_type, json=_json, content=_content, @@ -239759,15 +239761,14 @@ 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 delete_model_router(self, uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Get OpenAI API Key. + """Delete a Model Router. - To retrieve details of an OpenAI API key, send a GET request to - ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To delete a model router, send a DELETE request to ``/v2/gen-ai/models/routers/{uuid}``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str + :param uuid: Model router id. Required. + :type uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -239777,67 +239778,7 @@ 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } + "uuid": "str" # Optional. The id of the deleted model router. } # response body for status code(s): 404 response == { @@ -239869,8 +239810,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_delete_model_router_request( + uuid=uuid, headers=_headers, params=_params, ) @@ -239930,21 +239871,20 @@ 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 create_oauth2_dropbox_tokens( 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. + """Get Oauth2 Dropbox Tokens. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To obtain the refresh token, needed for creation of data sources, send a GET request to + ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the + field 'code'. - :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. @@ -239959,74 +239899,14 @@ 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. + "code": "str", # Optional. The oauth2 code from google. + "redirect_url": "str" # Optional. Redirect url. } # 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } + "refresh_token": "str", # Optional. The refresh token. + "token": "str" # Optional. The access token. } # response body for status code(s): 404 response == { @@ -240042,21 +239922,20 @@ async def update_openai_api_key( """ @overload - async def update_openai_api_key( + async def create_oauth2_dropbox_tokens( 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. + """Get Oauth2 Dropbox Tokens. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To obtain the refresh token, needed for creation of data sources, send a GET request to + ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the + field 'code'. - :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. @@ -240071,67 +239950,8 @@ 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } + "refresh_token": "str", # Optional. The refresh token. + "token": "str" # Optional. The access token. } # response body for status code(s): 404 response == { @@ -240147,19 +239967,16 @@ 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_oauth2_dropbox_tokens( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update OpenAI API Key. + """Get Oauth2 Dropbox Tokens. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To obtain the refresh token, needed for creation of data sources, send a GET request to + ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the + field 'code'. - :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 @@ -240171,74 +239988,14 @@ 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. + "code": "str", # Optional. The oauth2 code from google. + "redirect_url": "str" # Optional. Redirect url. } # 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } + "refresh_token": "str", # Optional. The refresh token. + "token": "str" # Optional. The access token. } # response body for status code(s): 404 response == { @@ -240284,8 +240041,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_oauth2_dropbox_tokens_request( content_type=content_type, json=_json, content=_content, @@ -240348,15 +240104,23 @@ 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: + async def get_oauth2_url( + self, + *, + type: Optional[str] = None, + redirect_url: Optional[str] = None, + **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """Delete OpenAI API Key. + """Get Oauth2 URL. - To delete an OpenAI API key, send a DELETE request to - ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To generate an Oauth2-URL for use with your localhost, send a GET request to + ``/v2/gen-ai/oauth2/url``. Pass 'http://localhost:3000 as redirect_url. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str + :keyword type: Type "google" / "dropbox". Default value is None. + :paramtype type: str + :keyword redirect_url: The redirect url. Default value is None. + :paramtype redirect_url: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -240366,67 +240130,7 @@ async def delete_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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } + "url": "str" # Optional. The oauth2 url. } # response body for status code(s): 404 response == { @@ -240458,8 +240162,9 @@ async def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_delete_openai_api_key_request( - api_key_uuid=api_key_uuid, + _request = build_genai_get_oauth2_url_request( + type=type, + redirect_url=redirect_url, headers=_headers, params=_params, ) @@ -240519,21 +240224,18 @@ async def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def list_agents_by_openai_key( + async def list_openai_api_keys( 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 OpenAI API Keys. - List Agents by OpenAI Key. + To list all OpenAI API keys, send a GET request to ``/v2/gen-ai/openai/keys``. - :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. @@ -240547,882 +240249,74 @@ async def list_agents_by_openai_key( # response body for status code(s): 200 response == { - "agents": [ + "api_key_infos": [ { - "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. 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. Api key - infos. - "uuid": "str" # Optional. Uuid. - } - ], - "api_keys": [ - { - "api_key": "str" # Optional. Api key. + 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. + "kb_default_chunk_size": 0, # Optional. + Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum + chunk size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum + chunking size token limits if model supports KNOWLEDGEBASE + usecase. + "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. + } } ], - "chatbot": { - "allowed_domains": [ - "str" # Optional. A 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", "STATUS_DELETED", - and "STATUS_BUILDING". - "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_jobs": [ - { - "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", - "DATA_SOURCE_STATUS_FAILED", and - "DATA_SOURCE_STATUS_CANCELLED". - "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. - } - ], - "data_source_uuids": [ - "str" # Optional. - IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", - # Optional. IndexingJob description. - "is_report_available": bool, # - Optional. Boolean value to determine if the indexing job - details are available. - "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", "INDEX_JOB_STATUS_PENDING", - and "INDEX_JOB_STATUS_CANCELLED". - "tokens": 0, # Optional. Number of - tokens [This field is deprecated]. - "total_datasources": 0, # Optional. - Number of datasources being indexed. - "total_tokens": "str", # Optional. - Total Tokens Consumed By the Indexing Job. - "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. - "reranking_config": { - "enabled": bool, # Optional. Whether - reranking is enabled for retrieval. - "model": "str" # Optional. Reranker - model internal name. - }, - "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. - "insights_enabled": bool, # Optional. Whether - insights are enabled. - "insights_enabled_at": "2020-02-20 00:00:00", # - Optional. Timestamp when insights were enabled. - "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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } - }, - "model_provider_key": { - "api_key_uuid": "str", # Optional. API key ID. - "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. - "kb_default_chunk_size": 0, # - Optional. Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. - Maximum chunk size limit of model. - "kb_min_chunk_size": 0, # Optional. - Minimum chunking size token limits if model supports - KNOWLEDGEBASE usecase. - "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 key. - "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. Key - last updated date. - }, - "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. - "kb_default_chunk_size": 0, # - Optional. Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. - Maximum chunk size limit of model. - "kb_min_chunk_size": 0, # Optional. - Minimum chunking size token limits if model supports - KNOWLEDGEBASE usecase. - "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_jobs": [ - { - "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", - "DATA_SOURCE_STATUS_FAILED", and - "DATA_SOURCE_STATUS_CANCELLED". - "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. - } - ], - "data_source_uuids": [ - "str" # Optional. - IndexingJob description. - ], - "finished_at": "2020-02-20 - 00:00:00", # Optional. IndexingJob description. - "is_report_available": bool, - # Optional. Boolean value to determine if the indexing - job details are available. - "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", - "INDEX_JOB_STATUS_PENDING", and - "INDEX_JOB_STATUS_CANCELLED". - "tokens": 0, # Optional. - Number of tokens [This field is deprecated]. - "total_datasources": 0, # - Optional. Number of datasources being indexed. - "total_tokens": "str", # - Optional. Total Tokens Consumed By the Indexing Job. - "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. - "reranking_config": { - "enabled": bool, # Optional. - Whether reranking is enabled for retrieval. - "model": "str" # Optional. - Reranker model internal name. - }, - "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. - "kb_default_chunk_size": 0, # Optional. - Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum - chunk size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum - chunking size token limits if model supports KNOWLEDGEBASE - usecase. - "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. - "vpc_egress_ips": [ - "str" # Optional. VPC Egress IPs. - ], - "vpc_uuid": "str", # Optional. - "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": [ - { - "category": - "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default - value is "METRIC_CATEGORY_UNSPECIFIED". Known values - are: "METRIC_CATEGORY_UNSPECIFIED", - "METRIC_CATEGORY_CORRECTNESS", - "METRIC_CATEGORY_USER_OUTCOMES", - "METRIC_CATEGORY_SAFETY_AND_SECURITY", - "METRIC_CATEGORY_CONTEXT_QUALITY", and - "METRIC_CATEGORY_MODEL_FIT". - "description": "str", - # Optional. Evaluations. - "inverted": bool, # - Optional. If true, the metric is inverted, meaning - that a lower value is better. - "is_metric_goal": - bool, # Optional. Evaluations. - "metric_name": "str", - # Optional. Evaluations. - "metric_rank": 0, # - 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. - } + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last + updated date. + "uuid": "str" # Optional. Uuid. } ], "links": { @@ -241469,8 +240363,7 @@ async def list_agents_by_openai_key( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_agents_by_openai_key_request( - uuid=uuid, + _request = build_genai_list_openai_api_keys_request( page=page, per_page=per_page, headers=_headers, @@ -241531,24 +240424,24 @@ async def list_agents_by_openai_key( return cast(JSON, deserialized) # type: ignore - @distributed_trace_async - async def list_datacenter_regions( + @overload + async def create_openai_api_key( self, + body: Optional[JSON] = None, *, - serves_inference: Optional[bool] = None, - serves_batch: Optional[bool] = None, + content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """List Datacenter Regions. + """Create OpenAI API Key. - To list all datacenter regions, send a GET request to ``/v2/gen-ai/regions``. + To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. - :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 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: @@ -241556,21 +240449,75 @@ async def list_datacenter_regions( 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 == { - "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. - } - ] + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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 == { @@ -241584,102 +240531,23 @@ async def list_datacenter_regions( 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 @overload - async def create_scheduled_indexing( + async def create_openai_api_key( self, - body: Optional[JSON] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create scheduled indexing for knowledge base. + """Create OpenAI API Key. - To create scheduled indexing for a knowledge base, send a POST request to - ``/v2/gen-ai/scheduled-indexing``. + 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. + :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 @@ -241689,42 +240557,68 @@ async def create_scheduled_indexing( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "days": [ - 0 # Optional. Days for execution (day is represented same as in a - cron expression, e.g. Monday begins with 1 ). - ], - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid for which the - schedule is created. - "time": "str" # Optional. Time of execution (HH:MM) UTC. - } - # response body for status code(s): 200 response == { - "indexing_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Created at - timestamp. - "days": [ - 0 # Optional. Days for execution (day is represented same as - in a cron expression, e.g. Monday begins with 1 ). + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + } + } ], - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at - timestamp (if soft deleted). - "is_active": bool, # Optional. Whether the schedule is currently - active. - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid - associated with this schedule. - "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the - schedule was executed. - "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled - run. - "time": "str", # Optional. Scheduled time of execution (HH:MM:SS - format). - "updated_at": "2020-02-20 00:00:00", # Optional. Updated at - timestamp. - "uuid": "str" # Optional. Unique identifier for the scheduled - indexing entry. + "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 @@ -241740,25 +240634,17 @@ async def create_scheduled_indexing( } """ - @overload - async def create_scheduled_indexing( - self, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any + @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 scheduled indexing for knowledge base. + """Create OpenAI API Key. - To create scheduled indexing for a knowledge base, send a POST request to - ``/v2/gen-ai/scheduled-indexing``. + 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 + :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: @@ -241766,31 +240652,74 @@ async def create_scheduled_indexing( 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 == { - "indexing_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Created at - timestamp. - "days": [ - 0 # Optional. Days for execution (day is represented same as - in a cron expression, e.g. Monday begins with 1 ). + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + } + } ], - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at - timestamp (if soft deleted). - "is_active": bool, # Optional. Whether the schedule is currently - active. - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid - associated with this schedule. - "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the - schedule was executed. - "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled - run. - "time": "str", # Optional. Scheduled time of execution (HH:MM:SS - format). - "updated_at": "2020-02-20 00:00:00", # Optional. Updated at - timestamp. - "uuid": "str" # Optional. Unique identifier for the scheduled - indexing entry. + "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 @@ -241805,19 +240734,110 @@ async def create_scheduled_indexing( 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 create_scheduled_indexing( - self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any - ) -> JSON: + async def get_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Create scheduled indexing for knowledge base. + """Get OpenAI API Key. - To create scheduled indexing for a knowledge base, send a POST request to - ``/v2/gen-ai/scheduled-indexing``. + To retrieve details of an OpenAI API key, send a GET request to + ``/v2/gen-ai/openai/keys/{api_key_uuid}``. - :param body: Is either a JSON type or a IO[bytes] type. Default value is None. - :type body: JSON or IO[bytes] + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -241825,42 +240845,68 @@ async def create_scheduled_indexing( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "days": [ - 0 # Optional. Days for execution (day is represented same as in a - cron expression, e.g. Monday begins with 1 ). - ], - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid for which the - schedule is created. - "time": "str" # Optional. Time of execution (HH:MM) UTC. - } - # response body for status code(s): 200 response == { - "indexing_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Created at - timestamp. - "days": [ - 0 # Optional. Days for execution (day is represented same as - in a cron expression, e.g. Monday begins with 1 ). + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + } + } ], - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at - timestamp (if soft deleted). - "is_active": bool, # Optional. Whether the schedule is currently - active. - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid - associated with this schedule. - "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the - schedule was executed. - "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled - run. - "time": "str", # Optional. Scheduled time of execution (HH:MM:SS - format). - "updated_at": "2020-02-20 00:00:00", # Optional. Updated at - timestamp. - "uuid": "str" # Optional. Unique identifier for the scheduled - indexing entry. + "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 @@ -241888,29 +240934,13 @@ async def create_scheduled_indexing( } 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_scheduled_indexing_request( - content_type=content_type, - json=_json, - content=_content, + _request = build_genai_get_openai_api_key_request( + api_key_uuid=api_key_uuid, headers=_headers, params=_params, ) @@ -241969,18 +240999,239 @@ async def create_scheduled_indexing( 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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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 get_scheduled_indexing( - self, knowledge_base_uuid: str, **kwargs: Any + 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 - """Get Scheduled Indexing for Knowledge Base. + """Update OpenAI API Key. - Get Scheduled Indexing for knowledge base using knoweldge base uuid, send a GET request to - ``/v2/gen-ai/scheduled-indexing/knowledge-base/{knowledge_base_uuid}``. + To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. - :param knowledge_base_uuid: UUID of the scheduled indexing entry. Required. - :type knowledge_base_uuid: str + :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: @@ -241988,31 +241239,75 @@ async def get_scheduled_indexing( 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 == { - "indexing_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Created at - timestamp. - "days": [ - 0 # Optional. Days for execution (day is represented same as - in a cron expression, e.g. Monday begins with 1 ). + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + } + } ], - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at - timestamp (if soft deleted). - "is_active": bool, # Optional. Whether the schedule is currently - active. - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid - associated with this schedule. - "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the - schedule was executed. - "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled - run. - "time": "str", # Optional. Scheduled time of execution (HH:MM:SS - format). - "updated_at": "2020-02-20 00:00:00", # Optional. Updated at - timestamp. - "uuid": "str" # Optional. Unique identifier for the scheduled - indexing entry. + "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 @@ -242040,13 +241335,30 @@ async def get_scheduled_indexing( } 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_scheduled_indexing_request( - knowledge_base_uuid=knowledge_base_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_update_openai_api_key_request( + api_key_uuid=api_key_uuid, + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -242106,15 +241418,15 @@ async def get_scheduled_indexing( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def delete_scheduled_indexing(self, uuid: str, **kwargs: Any) -> JSON: + async def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Delete Scheduled Indexing. + """Delete OpenAI API Key. - Delete Scheduled Indexing for knowledge base, send a DELETE request to - ``/v2/gen-ai/scheduled-indexing/{uuid}``. + To delete an OpenAI API key, send a DELETE request to + ``/v2/gen-ai/openai/keys/{api_key_uuid}``. - :param uuid: UUID of the scheduled indexing. Required. - :type uuid: str + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -242124,29 +241436,66 @@ async def delete_scheduled_indexing(self, uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "indexing_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Created at - timestamp. - "days": [ - 0 # Optional. Days for execution (day is represented same as - in a cron expression, e.g. Monday begins with 1 ). + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + } + } ], - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at - timestamp (if soft deleted). - "is_active": bool, # Optional. Whether the schedule is currently - active. - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid - associated with this schedule. - "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the - schedule was executed. - "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled - run. - "time": "str", # Optional. Scheduled time of execution (HH:MM:SS - format). - "updated_at": "2020-02-20 00:00:00", # Optional. Updated at - timestamp. - "uuid": "str" # Optional. Unique identifier for the scheduled - indexing entry. + "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 @@ -242179,8 +241528,8 @@ async def delete_scheduled_indexing(self, uuid: str, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_delete_scheduled_indexing_request( - uuid=uuid, + _request = build_genai_delete_openai_api_key_request( + api_key_uuid=api_key_uuid, headers=_headers, params=_params, ) @@ -242240,12 +241589,25 @@ async def delete_scheduled_indexing(self, uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def list_workspaces(self, **kwargs: Any) -> JSON: + 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 Workspaces. + """List agents by OpenAI key. - To list all workspaces, send a GET request to ``/v2/gen-ai/workspaces``. + 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: @@ -242255,328 +241617,353 @@ async def list_workspaces(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "workspaces": [ + "agents": [ { - "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": [ { - "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": { - "allowed_domains": [ - "str" # Optional. A 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", "STATUS_DELETED", and - "STATUS_BUILDING". - "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_jobs": [ - { - "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", - "DATA_SOURCE_STATUS_FAILED", and - "DATA_SOURCE_STATUS_CANCELLED". - "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. - } - ], - "data_source_uuids": - [ - "str" # - Optional. IndexingJob description. - ], - "finished_at": - "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "is_report_available": bool, # Optional. Boolean - value to determine if the indexing job details are - available. - "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". + 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": { + "allowed_domains": [ + "str" # Optional. A 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", "STATUS_DELETED", + and "STATUS_BUILDING". + "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_jobs": [ + { + "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. IndexingJob - description. + "2020-02-20 00:00:00", # Optional. Timestamp when + data source started indexing. "status": - "INDEX_JOB_STATUS_UNKNOWN", # Optional. Default - value is "INDEX_JOB_STATUS_UNKNOWN". Known values - are: "INDEX_JOB_STATUS_UNKNOWN", - "INDEX_JOB_STATUS_PARTIAL", - "INDEX_JOB_STATUS_IN_PROGRESS", - "INDEX_JOB_STATUS_COMPLETED", - "INDEX_JOB_STATUS_FAILED", - "INDEX_JOB_STATUS_NO_CHANGES", - "INDEX_JOB_STATUS_PENDING", and - "INDEX_JOB_STATUS_CANCELLED". - "tokens": 0, # - Optional. Number of tokens [This field is - deprecated]. - "total_datasources": - 0, # Optional. Number of datasources being indexed. - "total_tokens": - "str", # Optional. Total Tokens Consumed By the - Indexing Job. - "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. - "reranking_config": { - "enabled": bool, # - Optional. Whether reranking is enabled for retrieval. - "model": "str" # - Optional. Reranker model internal name. - }, - "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. - "insights_enabled": bool, # - Optional. Whether insights are enabled. - "insights_enabled_at": "2020-02-20 - 00:00:00", # Optional. Timestamp when insights were enabled. - "log_stream_id": "str", # Optional. - Identifier for the log stream. - "log_stream_name": "str" # Optional. - Name of the log stream. + "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", + "DATA_SOURCE_STATUS_FAILED", and + "DATA_SOURCE_STATUS_CANCELLED". + "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. + } + ], + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", + # Optional. IndexingJob description. + "is_report_available": bool, # + Optional. Boolean value to determine if the indexing job + details are available. + "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", "INDEX_JOB_STATUS_PENDING", + and "INDEX_JOB_STATUS_CANCELLED". + "tokens": 0, # Optional. Number of + tokens [This field is deprecated]. + "total_datasources": 0, # Optional. + Number of datasources being indexed. + "total_tokens": "str", # Optional. + Total Tokens Consumed By the Indexing Job. + "updated_at": "2020-02-20 00:00:00", + # Optional. Last modified. + "uuid": "str" # Optional. Unique id. }, - "max_tokens": 0, # Optional. Agents. - "model": { + "name": "str", # Optional. Name of knowledge + base. + "project_id": "str", # Optional. Knowledge + bases. + "region": "str", # Optional. Region code. + "reranking_config": { + "enabled": bool, # Optional. Whether + reranking is enabled for retrieval. + "model": "str" # Optional. Reranker + model internal name. + }, + "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. + "insights_enabled": bool, # Optional. Whether + insights are enabled. + "insights_enabled_at": "2020-02-20 00:00:00", # + Optional. Timestamp when insights were enabled. + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + } + }, + "model_provider_key": { + "api_key_uuid": "str", # Optional. API key ID. + "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. @@ -242633,576 +242020,625 @@ async def list_workspaces(self, **kwargs: Any) -> JSON: "patch": 0 # Optional. Patch version number. } - }, - "model_provider_key": { - "api_key_uuid": "str", # Optional. - API key ID. + } + ], + "name": "str", # Optional. Name of the key. + "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. Key + last updated date. + }, + "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. 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": - 0, # Optional. Maximum chunk size limit of model. - "kb_min_chunk_size": - 0, # Optional. Minimum chunking size token limits if - model supports KNOWLEDGEBASE usecase. - "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. - } - } - ], + # 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. + "kb_default_chunk_size": 0, # + Optional. Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. + Maximum chunk size limit of model. + "kb_min_chunk_size": 0, # Optional. + Minimum chunking size token limits if model supports + KNOWLEDGEBASE usecase. + "metadata": {}, # Optional. + Additional meta data. "name": "str", # Optional. Name of - the key. + 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. Key last updated date. - }, - "name": "str", # Optional. Agent name. - "openai_api_key": { + "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. 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": - 0, # Optional. Maximum chunk size limit of model. - "kb_min_chunk_size": - 0, # Optional. Minimum chunking size token limits if - model supports KNOWLEDGEBASE usecase. - "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. + # 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_jobs": [ + { + "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", + "DATA_SOURCE_STATUS_FAILED", and + "DATA_SOURCE_STATUS_CANCELLED". + "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. } - } + ], + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "is_report_available": bool, + # Optional. Boolean value to determine if the indexing + job details are available. + "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", + "INDEX_JOB_STATUS_PENDING", and + "INDEX_JOB_STATUS_CANCELLED". + "tokens": 0, # Optional. + Number of tokens [This field is deprecated]. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "total_tokens": "str", # + Optional. Total Tokens Consumed By the Indexing Job. + "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. + "reranking_config": { + "enabled": bool, # Optional. + Whether reranking is enabled for retrieval. + "model": "str" # Optional. + Reranker model internal name. + }, + "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. + # 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. }, - "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. + "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. + "kb_default_chunk_size": 0, # Optional. + Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum + chunk size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum + chunking size token limits if model supports KNOWLEDGEBASE + usecase. + "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. ], - "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_jobs": [ - { - "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", - "DATA_SOURCE_STATUS_FAILED", and - "DATA_SOURCE_STATUS_CANCELLED". - "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. - } - ], - "data_source_uuids": [ - "str" - # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # - Optional. IndexingJob description. - "is_report_available": bool, # Optional. Boolean - value to determine if the indexing job details - are available. - "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", - "INDEX_JOB_STATUS_PENDING", and - "INDEX_JOB_STATUS_CANCELLED". - "tokens": 0, - # Optional. Number of tokens [This field is - deprecated]. - "total_datasources": 0, # Optional. Number of - datasources being indexed. - "total_tokens": "str", # Optional. Total Tokens - Consumed By the Indexing Job. - "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. - "reranking_config": { - "enabled": - bool, # Optional. Whether reranking is enabled - for retrieval. - "model": - "str" # Optional. Reranker model internal name. - }, - "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. - "kb_default_chunk_size": 0, - # Optional. Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # - Optional. Maximum chunk size limit of model. - "kb_min_chunk_size": 0, # - Optional. Minimum chunking size token limits if model - supports KNOWLEDGEBASE usecase. - "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. - "vpc_egress_ips": [ - "str" # Optional. VPC Egress IPs. - ], - "vpc_uuid": "str", # Optional. Agents. - "workspace": ... - } + "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. + "vpc_egress_ips": [ + "str" # Optional. VPC Egress IPs. ], - "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": { + "vpc_uuid": "str", # Optional. + "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. Time created at. + # 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. - Name of the dataset. + Evaluations. "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": [ - { - "category": - "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default value - is "METRIC_CATEGORY_UNSPECIFIED". Known values are: - "METRIC_CATEGORY_UNSPECIFIED", - "METRIC_CATEGORY_CORRECTNESS", - "METRIC_CATEGORY_USER_OUTCOMES", - "METRIC_CATEGORY_SAFETY_AND_SECURITY", - "METRIC_CATEGORY_CONTEXT_QUALITY", and - "METRIC_CATEGORY_MODEL_FIT". - "description": "str", # - Optional. Evaluations. - "inverted": bool, # - Optional. If true, the metric is inverted, meaning that a - lower value is better. - "is_metric_goal": bool, # - Optional. Evaluations. - "metric_name": "str", # - Optional. Evaluations. - "metric_rank": 0, # - 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". + Evaluations. + "description": "str", # Optional. + Evaluations. + "latest_version_number_of_runs": 0, + # Optional. Evaluations. + "metrics": [ + { + "category": + "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default + value is "METRIC_CATEGORY_UNSPECIFIED". Known values + are: "METRIC_CATEGORY_UNSPECIFIED", + "METRIC_CATEGORY_CORRECTNESS", + "METRIC_CATEGORY_USER_OUTCOMES", + "METRIC_CATEGORY_SAFETY_AND_SECURITY", + "METRIC_CATEGORY_CONTEXT_QUALITY", and + "METRIC_CATEGORY_MODEL_FIT". + "description": "str", + # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning + that a lower value is better. + "is_metric_goal": + bool, # Optional. Evaluations. + "metric_name": "str", + # Optional. Evaluations. + "metric_rank": 0, # + 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. - "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. + "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. - "name": "str", # Optional. + "total_runs": 0, # 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. + "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. } ] } @@ -243236,7 +242672,9 @@ async def list_workspaces(self, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_workspaces_request( + _request = build_genai_list_datacenter_regions_request( + serves_inference=serves_inference, + serves_batch=serves_batch, headers=_headers, params=_params, ) @@ -243296,7 +242734,7 @@ async def list_workspaces(self, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @overload - async def create_workspace( + async def create_scheduled_indexing( self, body: Optional[JSON] = None, *, @@ -243304,10 +242742,10 @@ async def create_workspace( **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a Workspace. + """Create scheduled indexing for knowledge base. - 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. + To create scheduled indexing for a knowledge base, send a POST request to + ``/v2/gen-ai/scheduled-indexing``. :param body: Default value is None. :type body: JSON @@ -243323,568 +242761,741 @@ async def create_workspace( # 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. + "days": [ + 0 # Optional. Days for execution (day is represented same as in a + cron expression, e.g. Monday begins with 1 ). ], - "description": "str", # Optional. Description of the workspace. - "name": "str" # Optional. Name of the workspace. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid for which the + schedule is created. + "time": "str" # Optional. Time of execution (HH:MM) UTC. } # 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": { - "allowed_domains": [ - "str" # Optional. A 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", "STATUS_DELETED", and - "STATUS_BUILDING". - "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_jobs": [ - { - "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", - "DATA_SOURCE_STATUS_FAILED", and - "DATA_SOURCE_STATUS_CANCELLED". - "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. - } - ], - "data_source_uuids": [ - "str" # Optional. - IndexingJob description. - ], - "finished_at": "2020-02-20 - 00:00:00", # Optional. IndexingJob description. - "is_report_available": bool, - # Optional. Boolean value to determine if the indexing - job details are available. - "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", - "INDEX_JOB_STATUS_PENDING", and - "INDEX_JOB_STATUS_CANCELLED". - "tokens": 0, # Optional. - Number of tokens [This field is deprecated]. - "total_datasources": 0, # - Optional. Number of datasources being indexed. - "total_tokens": "str", # - Optional. Total Tokens Consumed By the Indexing Job. - "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. - "reranking_config": { - "enabled": bool, # Optional. - Whether reranking is enabled for retrieval. - "model": "str" # Optional. - Reranker model internal name. - }, - "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. - "insights_enabled": bool, # Optional. - Whether insights are enabled. - "insights_enabled_at": "2020-02-20 00:00:00", - # Optional. Timestamp when insights were enabled. - "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. - "kb_default_chunk_size": 0, # Optional. - Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum - chunk size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum - chunking size token limits if model supports KNOWLEDGEBASE - usecase. - "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. - } - }, - "model_provider_key": { - "api_key_uuid": "str", # Optional. API key - ID. - "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": [ + "indexing_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Created at + timestamp. + "days": [ + 0 # Optional. Days for execution (day is represented same as + in a cron expression, e.g. Monday begins with 1 ). + ], + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at + timestamp (if soft deleted). + "is_active": bool, # Optional. Whether the schedule is currently + active. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid + associated with this schedule. + "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the + schedule was executed. + "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled + run. + "time": "str", # Optional. Scheduled time of execution (HH:MM:SS + format). + "updated_at": "2020-02-20 00:00:00", # Optional. Updated at + timestamp. + "uuid": "str" # Optional. Unique identifier for the scheduled + indexing entry. + } + } + # 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_scheduled_indexing( + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create scheduled indexing for knowledge base. + + To create scheduled indexing for a knowledge base, send a POST request to + ``/v2/gen-ai/scheduled-indexing``. + + :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 == { + "indexing_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Created at + timestamp. + "days": [ + 0 # Optional. Days for execution (day is represented same as + in a cron expression, e.g. Monday begins with 1 ). + ], + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at + timestamp (if soft deleted). + "is_active": bool, # Optional. Whether the schedule is currently + active. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid + associated with this schedule. + "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the + schedule was executed. + "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled + run. + "time": "str", # Optional. Scheduled time of execution (HH:MM:SS + format). + "updated_at": "2020-02-20 00:00:00", # Optional. Updated at + timestamp. + "uuid": "str" # Optional. Unique identifier for the scheduled + indexing entry. + } + } + # 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_scheduled_indexing( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create scheduled indexing for knowledge base. + + To create scheduled indexing for a knowledge base, send a POST request to + ``/v2/gen-ai/scheduled-indexing``. + + :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 = { + "days": [ + 0 # Optional. Days for execution (day is represented same as in a + cron expression, e.g. Monday begins with 1 ). + ], + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid for which the + schedule is created. + "time": "str" # Optional. Time of execution (HH:MM) UTC. + } + + # response body for status code(s): 200 + response == { + "indexing_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Created at + timestamp. + "days": [ + 0 # Optional. Days for execution (day is represented same as + in a cron expression, e.g. Monday begins with 1 ). + ], + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at + timestamp (if soft deleted). + "is_active": bool, # Optional. Whether the schedule is currently + active. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid + associated with this schedule. + "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the + schedule was executed. + "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled + run. + "time": "str", # Optional. Scheduled time of execution (HH:MM:SS + format). + "updated_at": "2020-02-20 00:00:00", # Optional. Updated at + timestamp. + "uuid": "str" # Optional. Unique identifier for the scheduled + indexing entry. + } + } + # 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_scheduled_indexing_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_scheduled_indexing( + self, knowledge_base_uuid: str, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Get Scheduled Indexing for Knowledge Base. + + Get Scheduled Indexing for knowledge base using knoweldge base uuid, send a GET request to + ``/v2/gen-ai/scheduled-indexing/knowledge-base/{knowledge_base_uuid}``. + + :param knowledge_base_uuid: UUID of the scheduled indexing entry. Required. + :type knowledge_base_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "indexing_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Created at + timestamp. + "days": [ + 0 # Optional. Days for execution (day is represented same as + in a cron expression, e.g. Monday begins with 1 ). + ], + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at + timestamp (if soft deleted). + "is_active": bool, # Optional. Whether the schedule is currently + active. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid + associated with this schedule. + "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the + schedule was executed. + "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled + run. + "time": "str", # Optional. Scheduled time of execution (HH:MM:SS + format). + "updated_at": "2020-02-20 00:00:00", # Optional. Updated at + timestamp. + "uuid": "str" # Optional. Unique identifier for the scheduled + indexing entry. + } + } + # 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_scheduled_indexing_request( + knowledge_base_uuid=knowledge_base_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 delete_scheduled_indexing(self, uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete Scheduled Indexing. + + Delete Scheduled Indexing for knowledge base, send a DELETE request to + ``/v2/gen-ai/scheduled-indexing/{uuid}``. + + :param uuid: UUID of the scheduled indexing. 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 == { + "indexing_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Created at + timestamp. + "days": [ + 0 # Optional. Days for execution (day is represented same as + in a cron expression, e.g. Monday begins with 1 ). + ], + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at + timestamp (if soft deleted). + "is_active": bool, # Optional. Whether the schedule is currently + active. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid + associated with this schedule. + "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the + schedule was executed. + "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled + run. + "time": "str", # Optional. Scheduled time of execution (HH:MM:SS + format). + "updated_at": "2020-02-20 00:00:00", # Optional. Updated at + timestamp. + "uuid": "str" # Optional. Unique identifier for the scheduled + indexing entry. + } + } + # 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_scheduled_indexing_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_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": [ { - "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. - "kb_default_chunk_size": 0, - # Optional. Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # - Optional. Maximum chunk size limit of model. - "kb_min_chunk_size": 0, # - Optional. Minimum chunking size token limits if model - supports KNOWLEDGEBASE usecase. - "metadata": {}, # Optional. - Additional meta data. + 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 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. + "secret_key": "str", # + Optional. Api key infos. + "uuid": "str" # Optional. + Uuid. } ], - "name": "str", # Optional. Name of the key. - "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. Key last updated date. - }, - "name": "str", # Optional. Agent name. - "openai_api_key": { + "api_keys": [ + { + "api_key": "str" # Optional. + Api key. + } + ], + "chatbot": { + "allowed_domains": [ + "str" # Optional. A 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. 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": [ + 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", "STATUS_DELETED", and + "STATUS_BUILDING". + "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": [ { - "agreement": { - "description": "str", - # Optional. Agreement Description. - "name": "str", # - Optional. Agreement Description. - "url": "str", # - Optional. Agreement Description. - "uuid": "str" # - Optional. Agreement Description. - }, + "api_key": "str", # + Optional. Api key. "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. - "kb_default_chunk_size": 0, - # Optional. Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # - Optional. Maximum chunk size limit of model. - "kb_min_chunk_size": 0, # - Optional. Minimum chunking size token limits if model - supports KNOWLEDGEBASE usecase. - "metadata": {}, # Optional. - Additional meta data. + "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 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". + Name. + "output_schema": {}, # + Optional. Any object. "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. + Download your agent here. + "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": [ { + "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. - Priority of the guardrail. + 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. - Uuid of the guardrail. + The guardrails the agent is attached to. } ], - "instruction": "str", # Optional. - Instructions for the agent template. - "k": 0, # Optional. The 'k' value for the - agent template. + "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": @@ -243893,11 +243504,9 @@ async def create_workspace( "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. + Optional. Knowledge bases. "embedding_model_uuid": - "str", # Optional. List of knowledge bases associated - with the agent template. + "str", # Optional. Knowledge bases. "is_public": bool, # Optional. Whether the knowledge base is public or not. "last_indexing_job": { @@ -244001,8 +243610,7 @@ async def create_workspace( "name": "str", # Optional. Name of knowledge base. "project_id": "str", # - Optional. List of knowledge bases associated with the - agent template. + Optional. Knowledge bases. "region": "str", # Optional. Region code. "reranking_config": { @@ -244023,10 +243631,21 @@ async def create_workspace( 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. + "logging_config": { + "galileo_project_id": "str", # + Optional. Galileo project identifier. + "galileo_project_name": "str", # + Optional. Name of the Galileo project. + "insights_enabled": bool, # + Optional. Whether insights are enabled. + "insights_enabled_at": "2020-02-20 + 00:00:00", # Optional. Timestamp when insights were enabled. + "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", # @@ -244085,151 +243704,577 @@ async def create_workspace( 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. - "vpc_egress_ips": [ - "str" # Optional. VPC Egress IPs. - ], - "vpc_uuid": "str", # Optional. Agents. - "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": [ - { - "category": - "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default value is - "METRIC_CATEGORY_UNSPECIFIED". Known values are: - "METRIC_CATEGORY_UNSPECIFIED", "METRIC_CATEGORY_CORRECTNESS", - "METRIC_CATEGORY_USER_OUTCOMES", - "METRIC_CATEGORY_SAFETY_AND_SECURITY", - "METRIC_CATEGORY_CONTEXT_QUALITY", and - "METRIC_CATEGORY_MODEL_FIT". - "description": "str", # Optional. - Evaluations. - "inverted": bool, # Optional. If - true, the metric is inverted, meaning that a lower value is - better. - "is_metric_goal": bool, # Optional. - Evaluations. - "metric_name": "str", # Optional. - Evaluations. - "metric_rank": 0, # 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. + "model_provider_key": { + "api_key_uuid": "str", # Optional. + API key ID. + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": + 0, # Optional. Maximum chunk size limit of model. + "kb_min_chunk_size": + 0, # Optional. Minimum chunking size token limits if + model supports KNOWLEDGEBASE usecase. + "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 key. + "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. Key last updated date. + }, + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": + 0, # Optional. Maximum chunk size limit of model. + "kb_min_chunk_size": + 0, # Optional. Minimum chunking size token limits if + model supports KNOWLEDGEBASE usecase. + "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_jobs": [ + { + "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", + "DATA_SOURCE_STATUS_FAILED", and + "DATA_SOURCE_STATUS_CANCELLED". + "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. + } + ], + "data_source_uuids": [ + "str" + # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # + Optional. IndexingJob description. + "is_report_available": bool, # Optional. Boolean + value to determine if the indexing job details + are available. + "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", + "INDEX_JOB_STATUS_PENDING", and + "INDEX_JOB_STATUS_CANCELLED". + "tokens": 0, + # Optional. Number of tokens [This field is + deprecated]. + "total_datasources": 0, # Optional. Number of + datasources being indexed. + "total_tokens": "str", # Optional. Total Tokens + Consumed By the Indexing Job. + "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. + "reranking_config": { + "enabled": + bool, # Optional. Whether reranking is enabled + for retrieval. + "model": + "str" # Optional. Reranker model internal name. + }, + "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. + "kb_default_chunk_size": 0, + # Optional. Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # + Optional. Maximum chunk size limit of model. + "kb_min_chunk_size": 0, # + Optional. Minimum chunking size token limits if model + supports KNOWLEDGEBASE usecase. + "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. + "vpc_egress_ips": [ + "str" # Optional. VPC Egress IPs. + ], + "vpc_uuid": "str", # Optional. Agents. + "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": [ + { + "category": + "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default value + is "METRIC_CATEGORY_UNSPECIFIED". Known values are: + "METRIC_CATEGORY_UNSPECIFIED", + "METRIC_CATEGORY_CORRECTNESS", + "METRIC_CATEGORY_USER_OUTCOMES", + "METRIC_CATEGORY_SAFETY_AND_SECURITY", + "METRIC_CATEGORY_CONTEXT_QUALITY", and + "METRIC_CATEGORY_MODEL_FIT". + "description": "str", # + Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. + "is_metric_goal": bool, # + Optional. Evaluations. + "metric_name": "str", # + Optional. Evaluations. + "metric_rank": 0, # + 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. - "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. - } + "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 == { @@ -244243,11 +244288,87 @@ async def create_workspace( 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[IO[bytes]] = None, + body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any @@ -244259,8 +244380,8 @@ async def create_workspace( 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. + :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 @@ -244270,6 +244391,15 @@ async def create_workspace( 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": { @@ -245184,9 +245314,13 @@ async def create_workspace( } """ - @distributed_trace_async + @overload async def create_workspace( - self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any ) -> JSON: # pylint: disable=line-too-long """Create a Workspace. @@ -245194,8 +245328,11 @@ async def create_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] + :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: @@ -245203,15 +245340,6 @@ async def create_workspace( 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": { @@ -246125,110 +246253,19 @@ async def create_workspace( 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: + async def create_workspace( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """Retrieve an Existing Workspace. + """Create a 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. + 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 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: @@ -246236,6 +246273,15 @@ async def get_workspace(self, workspace_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. 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": { @@ -247162,13 +247208,29 @@ async def get_workspace(self, workspace_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_workspace_request( - workspace_uuid=workspace_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_create_workspace_request( + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -247227,28 +247289,16 @@ async def get_workspace(self, workspace_uuid: str, **kwargs: Any) -> JSON: 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: + @distributed_trace_async + async def get_workspace(self, workspace_uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Update a Workspace. + """Retrieve an Existing 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. + 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 - :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: @@ -247256,13 +247306,6 @@ async def update_workspace( 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": { @@ -248176,12 +248219,89 @@ async def update_workspace( 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[IO[bytes]] = None, + body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any @@ -248195,8 +248315,958 @@ async def update_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. + :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": { + "allowed_domains": [ + "str" # Optional. A 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", "STATUS_DELETED", and + "STATUS_BUILDING". + "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_jobs": [ + { + "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", + "DATA_SOURCE_STATUS_FAILED", and + "DATA_SOURCE_STATUS_CANCELLED". + "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. + } + ], + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "is_report_available": bool, + # Optional. Boolean value to determine if the indexing + job details are available. + "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", + "INDEX_JOB_STATUS_PENDING", and + "INDEX_JOB_STATUS_CANCELLED". + "tokens": 0, # Optional. + Number of tokens [This field is deprecated]. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "total_tokens": "str", # + Optional. Total Tokens Consumed By the Indexing Job. + "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. + "reranking_config": { + "enabled": bool, # Optional. + Whether reranking is enabled for retrieval. + "model": "str" # Optional. + Reranker model internal name. + }, + "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. + "insights_enabled": bool, # Optional. + Whether insights are enabled. + "insights_enabled_at": "2020-02-20 00:00:00", + # Optional. Timestamp when insights were enabled. + "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. + "kb_default_chunk_size": 0, # Optional. + Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum + chunk size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum + chunking size token limits if model supports KNOWLEDGEBASE + usecase. + "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. + } + }, + "model_provider_key": { + "api_key_uuid": "str", # Optional. API key + ID. + "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. + "kb_default_chunk_size": 0, + # Optional. Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # + Optional. Maximum chunk size limit of model. + "kb_min_chunk_size": 0, # + Optional. Minimum chunking size token limits if model + supports KNOWLEDGEBASE usecase. + "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 key. + "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. Key last updated date. + }, + "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. + "kb_default_chunk_size": 0, + # Optional. Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # + Optional. Maximum chunk size limit of model. + "kb_min_chunk_size": 0, # + Optional. Minimum chunking size token limits if model + supports KNOWLEDGEBASE usecase. + "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_jobs": [ + { + "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", + "DATA_SOURCE_STATUS_FAILED", and + "DATA_SOURCE_STATUS_CANCELLED". + "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. + } + ], + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "is_report_available": bool, # Optional. Boolean + value to determine if the indexing job details are + available. + "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", + "INDEX_JOB_STATUS_PENDING", and + "INDEX_JOB_STATUS_CANCELLED". + "tokens": 0, # + Optional. Number of tokens [This field is + deprecated]. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "total_tokens": + "str", # Optional. Total Tokens Consumed By the + Indexing Job. + "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. + "reranking_config": { + "enabled": bool, # + Optional. Whether reranking is enabled for retrieval. + "model": "str" # + Optional. Reranker model internal name. + }, + "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. + "kb_default_chunk_size": 0, # + Optional. Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. + Maximum chunk size limit of model. + "kb_min_chunk_size": 0, # Optional. + Minimum chunking size token limits if model supports + KNOWLEDGEBASE usecase. + "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. + "vpc_egress_ips": [ + "str" # Optional. VPC Egress IPs. + ], + "vpc_uuid": "str", # Optional. Agents. + "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": [ + { + "category": + "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default value is + "METRIC_CATEGORY_UNSPECIFIED". Known values are: + "METRIC_CATEGORY_UNSPECIFIED", "METRIC_CATEGORY_CORRECTNESS", + "METRIC_CATEGORY_USER_OUTCOMES", + "METRIC_CATEGORY_SAFETY_AND_SECURITY", + "METRIC_CATEGORY_CONTEXT_QUALITY", and + "METRIC_CATEGORY_MODEL_FIT". + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "is_metric_goal": bool, # Optional. + Evaluations. + "metric_name": "str", # Optional. + Evaluations. + "metric_rank": 0, # 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 @@ -254114,16 +255184,1886 @@ async def update_agents_workspace( "uuid": "str" # Optional. Unique id. } } - # response body for status code(s): 404 + # 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_agents_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 list_evaluation_test_cases_by_workspace( + self, workspace_uuid: str, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List Evaluation Test Cases by Workspace. + + To list all evaluation test cases by a workspace, send a GET request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/evaluation_test_cases``. + + :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 == { + "evaluation_test_cases": [ + { + "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": [ + { + "category": "METRIC_CATEGORY_UNSPECIFIED", # + Optional. Default value is "METRIC_CATEGORY_UNSPECIFIED". Known + values are: "METRIC_CATEGORY_UNSPECIFIED", + "METRIC_CATEGORY_CORRECTNESS", "METRIC_CATEGORY_USER_OUTCOMES", + "METRIC_CATEGORY_SAFETY_AND_SECURITY", + "METRIC_CATEGORY_CONTEXT_QUALITY", and + "METRIC_CATEGORY_MODEL_FIT". + "description": "str", # Optional. + "inverted": bool, # Optional. If true, the + metric is inverted, meaning that a lower value is better. + "is_metric_goal": bool, # Optional. + "metric_name": "str", # Optional. + "metric_rank": 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. + "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 + 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_test_cases_by_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 + + +class InferenceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~pydo.aio.GeneratedClient`'s + :attr:`inference` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = ( + input_args.pop(0) if input_args else kwargs.pop("deserializer") + ) + + @overload + async def create_chat_completion( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a model response for the given chat conversation. + + Creates a model response for the given chat conversation. + + :param body: Required. + :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 = { + "messages": [ + { + "role": "str", # The role of the message author. Required. + Known values are: "system", "developer", "user", "assistant", and "tool". + "content": "str", # Optional. The contents of the message. + "reasoning_content": "str", # Optional. The reasoning + content generated by the model (assistant messages only). + "refusal": "str", # Optional. The refusal message generated + by the model (assistant messages only). + "tool_call_id": "str", # Optional. Tool call that this + message is responding to (tool messages only). + "tool_calls": [ + { + "function": { + "arguments": "str", # The arguments + to call the function with, as generated by the model in JSON + format. Required. + "name": "str" # The name of the + function to call. Required. + }, + "id": "str", # The ID of the tool call. + Required. + "type": "str" # The type of the tool. + Currently, only function is supported. Required. "function" + } + ] + } + ], + "model": "str", # Model ID used to generate the response. Required. + "frequency_penalty": 0, # Optional. Default value is 0. Number between -2.0 + and 2.0. Positive values penalize new tokens based on their existing frequency in + the text so far, decreasing the model's likelihood to repeat the same line + verbatim. + "logit_bias": { + "str": 0 # Optional. Modify the likelihood of specified tokens + appearing in the completion. Accepts a JSON object that maps tokens + (specified by their token ID in the tokenizer) to an associated bias value + from -100 to 100. Mathematically, the bias is added to the logits generated + by the model prior to sampling. The exact effect will vary per model, but + values between -1 and 1 should decrease or increase likelihood of selection; + values like -100 or 100 should result in a ban or exclusive selection of the + relevant token. + }, + "logprobs": False, # Optional. Default value is False. Whether to return log + probabilities of the output tokens or not. If true, returns the log probabilities + of each output token returned in the content of message. + "max_completion_tokens": 0, # Optional. The maximum number of completion + tokens that may be used over the course of the run. The run will make a best + effort to use only the number of completion tokens specified, across multiple + turns of the run. + "max_tokens": 0, # Optional. The maximum number of tokens that can be + generated in the completion. The token count of your prompt plus max_tokens + cannot exceed the model's context length. + "metadata": { + "str": "str" # Optional. Set of 16 key-value pairs that can be + attached to an object. This can be useful for storing additional information + about the object in a structured format. Keys are strings with a maximum + length of 64 characters. Values are strings with a maximum length of 512 + characters. + }, + "n": 1, # Optional. Default value is 1. How many chat completion choices to + generate for each input message. Note that you will be charged based on the + number of generated tokens across all of the choices. Keep n as 1 to minimize + costs. + "presence_penalty": 0, # Optional. Default value is 0. Number between -2.0 + and 2.0. Positive values penalize new tokens based on whether they appear in the + text so far, increasing the model's likelihood to talk about new topics. + "reasoning_effort": "str", # Optional. Constrains effort on reasoning for + reasoning models. Reducing reasoning effort can result in faster responses and + fewer tokens used on reasoning in a response. Known values are: "none", + "minimal", "low", "medium", "high", and "xhigh". + "seed": 0, # Optional. If specified, the system will make a best effort to + sample deterministically, such that repeated requests with the same seed and + parameters should return the same result. Determinism is not guaranteed. + "stop": {}, + "stream": False, # Optional. Default value is False. If set to true, the + model response data will be streamed to the client as it is generated using + server-sent events. + "stream_options": { + "include_usage": bool # Optional. If set, an additional chunk will + be streamed before the data [DONE] message. The usage field on this chunk + shows the token usage statistics for the entire request, and the choices + field will always be an empty array. + }, + "temperature": 0.0, # Optional. What sampling temperature to use, between 0 + and 2. Higher values like 0.8 will make the output more random, while lower + values like 0.2 will make it more focused and deterministic. We generally + recommend altering this or top_p but not both. + "tool_choice": {}, + "tools": [ + { + "function": { + "name": "str", # The name of the function to be + called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, + with a maximum length of 64. Required. + "description": "str", # Optional. A description of + what the function does, used by the model to choose when and how to + call the function. + "parameters": { + "str": {} # Optional. The parameters the + function accepts, described as a JSON Schema object. + } + }, + "type": "str" # The type of the tool. Currently, only + function is supported. Required. "function" + } + ], + "top_logprobs": 0, # Optional. An integer between 0 and 20 specifying the + number of most likely tokens to return at each token position, each with an + associated log probability. logprobs must be set to true if this parameter is + used. + "top_p": 0.0, # Optional. An alternative to sampling with temperature, + called nucleus sampling, where the model considers the results of the tokens with + top_p probability mass. So 0.1 means only the tokens comprising the top 10% + probability mass are considered. We generally recommend altering this or + temperature but not both. + "user": "str" # Optional. A unique identifier representing your end-user, + which can help DigitalOcean to monitor and detect abuse. + } + + # response body for status code(s): 200 + response == { + "choices": [ + { + "finish_reason": "str", # The reason the model stopped + generating tokens. stop if the model hit a natural stop point or a + provided stop sequence, length if the maximum number of tokens specified + in the request was reached, tool_calls if the model called a tool. + Required. Known values are: "stop", "length", "tool_calls", and + "content_filter". + "index": 0, # The index of the choice in the list of + choices. Required. + "logprobs": { + "content": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ], + "refusal": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ] + }, + "message": { + "content": "str", # The contents of the message. + Required. + "reasoning_content": "str", # The reasoning content + generated by the model. Required. + "refusal": "str", # The refusal message generated by + the model. Required. + "role": "str", # The role of the author of this + message. Required. "assistant" + "tool_calls": [ + { + "function": { + "arguments": "str", # The + arguments to call the function with. Required. + "name": "str" # The name of + the function to call. Required. + }, + "id": "str", # The ID of the tool + call. Required. + "type": "str" # The type of the + tool. Required. "function" + } + ] + } + } + ], + "created": 0, # The Unix timestamp (in seconds) of when the chat completion + was created. Required. + "id": "str", # A unique identifier for the chat completion. Required. + "model": "str", # The model used for the chat completion. Required. + "object": "str", # The object type, which is always chat.completion. + Required. "chat.completion" + "usage": { + "cache_created_input_tokens": 0, # Default value is 0. Number of + prompt tokens written to cache. Required. + "cache_creation": { + "ephemeral_1h_input_tokens": 0, # Default value is 0. Number + of prompt tokens written to 1h cache. Required. + "ephemeral_5m_input_tokens": 0 # Default value is 0. Number + of prompt tokens written to 5m cache. Required. + }, + "cache_read_input_tokens": 0, # Default value is 0. Number of prompt + tokens read from cache. Required. + "completion_tokens": 0, # Default value is 0. Number of tokens in + the generated completion. Required. + "prompt_tokens": 0, # Default value is 0. Number of tokens in the + prompt. Required. + "total_tokens": 0 # Default value is 0. Total number of tokens used + in the request (prompt + completion). Required. + } + } + """ + + @overload + async def create_chat_completion( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a model response for the given chat conversation. + + Creates a model response for the given chat conversation. + + :param body: Required. + :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 == { + "choices": [ + { + "finish_reason": "str", # The reason the model stopped + generating tokens. stop if the model hit a natural stop point or a + provided stop sequence, length if the maximum number of tokens specified + in the request was reached, tool_calls if the model called a tool. + Required. Known values are: "stop", "length", "tool_calls", and + "content_filter". + "index": 0, # The index of the choice in the list of + choices. Required. + "logprobs": { + "content": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ], + "refusal": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ] + }, + "message": { + "content": "str", # The contents of the message. + Required. + "reasoning_content": "str", # The reasoning content + generated by the model. Required. + "refusal": "str", # The refusal message generated by + the model. Required. + "role": "str", # The role of the author of this + message. Required. "assistant" + "tool_calls": [ + { + "function": { + "arguments": "str", # The + arguments to call the function with. Required. + "name": "str" # The name of + the function to call. Required. + }, + "id": "str", # The ID of the tool + call. Required. + "type": "str" # The type of the + tool. Required. "function" + } + ] + } + } + ], + "created": 0, # The Unix timestamp (in seconds) of when the chat completion + was created. Required. + "id": "str", # A unique identifier for the chat completion. Required. + "model": "str", # The model used for the chat completion. Required. + "object": "str", # The object type, which is always chat.completion. + Required. "chat.completion" + "usage": { + "cache_created_input_tokens": 0, # Default value is 0. Number of + prompt tokens written to cache. Required. + "cache_creation": { + "ephemeral_1h_input_tokens": 0, # Default value is 0. Number + of prompt tokens written to 1h cache. Required. + "ephemeral_5m_input_tokens": 0 # Default value is 0. Number + of prompt tokens written to 5m cache. Required. + }, + "cache_read_input_tokens": 0, # Default value is 0. Number of prompt + tokens read from cache. Required. + "completion_tokens": 0, # Default value is 0. Number of tokens in + the generated completion. Required. + "prompt_tokens": 0, # Default value is 0. Number of tokens in the + prompt. Required. + "total_tokens": 0 # Default value is 0. Total number of tokens used + in the request (prompt + completion). Required. + } + } + """ + + @distributed_trace_async + async def create_chat_completion( + self, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a model response for the given chat conversation. + + Creates a model response for the given chat conversation. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :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 = { + "messages": [ + { + "role": "str", # The role of the message author. Required. + Known values are: "system", "developer", "user", "assistant", and "tool". + "content": "str", # Optional. The contents of the message. + "reasoning_content": "str", # Optional. The reasoning + content generated by the model (assistant messages only). + "refusal": "str", # Optional. The refusal message generated + by the model (assistant messages only). + "tool_call_id": "str", # Optional. Tool call that this + message is responding to (tool messages only). + "tool_calls": [ + { + "function": { + "arguments": "str", # The arguments + to call the function with, as generated by the model in JSON + format. Required. + "name": "str" # The name of the + function to call. Required. + }, + "id": "str", # The ID of the tool call. + Required. + "type": "str" # The type of the tool. + Currently, only function is supported. Required. "function" + } + ] + } + ], + "model": "str", # Model ID used to generate the response. Required. + "frequency_penalty": 0, # Optional. Default value is 0. Number between -2.0 + and 2.0. Positive values penalize new tokens based on their existing frequency in + the text so far, decreasing the model's likelihood to repeat the same line + verbatim. + "logit_bias": { + "str": 0 # Optional. Modify the likelihood of specified tokens + appearing in the completion. Accepts a JSON object that maps tokens + (specified by their token ID in the tokenizer) to an associated bias value + from -100 to 100. Mathematically, the bias is added to the logits generated + by the model prior to sampling. The exact effect will vary per model, but + values between -1 and 1 should decrease or increase likelihood of selection; + values like -100 or 100 should result in a ban or exclusive selection of the + relevant token. + }, + "logprobs": False, # Optional. Default value is False. Whether to return log + probabilities of the output tokens or not. If true, returns the log probabilities + of each output token returned in the content of message. + "max_completion_tokens": 0, # Optional. The maximum number of completion + tokens that may be used over the course of the run. The run will make a best + effort to use only the number of completion tokens specified, across multiple + turns of the run. + "max_tokens": 0, # Optional. The maximum number of tokens that can be + generated in the completion. The token count of your prompt plus max_tokens + cannot exceed the model's context length. + "metadata": { + "str": "str" # Optional. Set of 16 key-value pairs that can be + attached to an object. This can be useful for storing additional information + about the object in a structured format. Keys are strings with a maximum + length of 64 characters. Values are strings with a maximum length of 512 + characters. + }, + "n": 1, # Optional. Default value is 1. How many chat completion choices to + generate for each input message. Note that you will be charged based on the + number of generated tokens across all of the choices. Keep n as 1 to minimize + costs. + "presence_penalty": 0, # Optional. Default value is 0. Number between -2.0 + and 2.0. Positive values penalize new tokens based on whether they appear in the + text so far, increasing the model's likelihood to talk about new topics. + "reasoning_effort": "str", # Optional. Constrains effort on reasoning for + reasoning models. Reducing reasoning effort can result in faster responses and + fewer tokens used on reasoning in a response. Known values are: "none", + "minimal", "low", "medium", "high", and "xhigh". + "seed": 0, # Optional. If specified, the system will make a best effort to + sample deterministically, such that repeated requests with the same seed and + parameters should return the same result. Determinism is not guaranteed. + "stop": {}, + "stream": False, # Optional. Default value is False. If set to true, the + model response data will be streamed to the client as it is generated using + server-sent events. + "stream_options": { + "include_usage": bool # Optional. If set, an additional chunk will + be streamed before the data [DONE] message. The usage field on this chunk + shows the token usage statistics for the entire request, and the choices + field will always be an empty array. + }, + "temperature": 0.0, # Optional. What sampling temperature to use, between 0 + and 2. Higher values like 0.8 will make the output more random, while lower + values like 0.2 will make it more focused and deterministic. We generally + recommend altering this or top_p but not both. + "tool_choice": {}, + "tools": [ + { + "function": { + "name": "str", # The name of the function to be + called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, + with a maximum length of 64. Required. + "description": "str", # Optional. A description of + what the function does, used by the model to choose when and how to + call the function. + "parameters": { + "str": {} # Optional. The parameters the + function accepts, described as a JSON Schema object. + } + }, + "type": "str" # The type of the tool. Currently, only + function is supported. Required. "function" + } + ], + "top_logprobs": 0, # Optional. An integer between 0 and 20 specifying the + number of most likely tokens to return at each token position, each with an + associated log probability. logprobs must be set to true if this parameter is + used. + "top_p": 0.0, # Optional. An alternative to sampling with temperature, + called nucleus sampling, where the model considers the results of the tokens with + top_p probability mass. So 0.1 means only the tokens comprising the top 10% + probability mass are considered. We generally recommend altering this or + temperature but not both. + "user": "str" # Optional. A unique identifier representing your end-user, + which can help DigitalOcean to monitor and detect abuse. + } + + # response body for status code(s): 200 + response == { + "choices": [ + { + "finish_reason": "str", # The reason the model stopped + generating tokens. stop if the model hit a natural stop point or a + provided stop sequence, length if the maximum number of tokens specified + in the request was reached, tool_calls if the model called a tool. + Required. Known values are: "stop", "length", "tool_calls", and + "content_filter". + "index": 0, # The index of the choice in the list of + choices. Required. + "logprobs": { + "content": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ], + "refusal": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ] + }, + "message": { + "content": "str", # The contents of the message. + Required. + "reasoning_content": "str", # The reasoning content + generated by the model. Required. + "refusal": "str", # The refusal message generated by + the model. Required. + "role": "str", # The role of the author of this + message. Required. "assistant" + "tool_calls": [ + { + "function": { + "arguments": "str", # The + arguments to call the function with. Required. + "name": "str" # The name of + the function to call. Required. + }, + "id": "str", # The ID of the tool + call. Required. + "type": "str" # The type of the + tool. Required. "function" + } + ] + } + } + ], + "created": 0, # The Unix timestamp (in seconds) of when the chat completion + was created. Required. + "id": "str", # A unique identifier for the chat completion. Required. + "model": "str", # The model used for the chat completion. Required. + "object": "str", # The object type, which is always chat.completion. + Required. "chat.completion" + "usage": { + "cache_created_input_tokens": 0, # Default value is 0. Number of + prompt tokens written to cache. Required. + "cache_creation": { + "ephemeral_1h_input_tokens": 0, # Default value is 0. Number + of prompt tokens written to 1h cache. Required. + "ephemeral_5m_input_tokens": 0 # Default value is 0. Number + of prompt tokens written to 5m cache. Required. + }, + "cache_read_input_tokens": 0, # Default value is 0. Number of prompt + tokens read from cache. Required. + "completion_tokens": 0, # Default value is 0. Number of tokens in + the generated completion. Required. + "prompt_tokens": 0, # Default value is 0. Number of tokens in the + prompt. Required. + "total_tokens": 0 # Default value is 0. Total number of tokens used + in the request (prompt + completion). Required. + } + } + """ + 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: + _json = body + + _request = build_inference_create_chat_completion_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]: + 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 = {} + 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_messages( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create the next assistant message. + + Send a structured list of input messages with text and/or image content, and the model will + generate the next message in the conversation. + + :param body: Required. + :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 = { + "max_tokens": 0, # Maximum tokens to generate before stopping. Required. + "messages": [ + { + "content": {}, + "role": "str" # Speaker role for this message. Required. + Known values are: "user" and "assistant". + } + ], + "model": "str", # Model ID (for example ``claude-opus-4-6`` or a serverless + model id). Required. + "metadata": { + "user_id": "str" # Optional. Opaque identifier for the end user (for + example a UUID or hash). Do not include PII. + }, + "reasoning_effort": "str", # Optional. DigitalOcean extension for + reasoning-capable models. Ignored by executors that do not support it. Known + values are: "none", "minimal", "low", "medium", "high", and "xhigh". + "speed": "str", # Optional. DigitalOcean extension for preferred inference + speed. Ignored when not supported. Known values are: "standard" and "fast". + "stop_sequences": [ + "str" # Optional. Custom strings that stop generation when produced. + ], + "stream": False, # Optional. Default value is False. When true, the response + is streamed using server-sent events (SSE). + "system": {}, + "temperature": 0.0, # Optional. Sampling temperature between 0.0 and 1.0. + "thinking": { + "type": "str" # Thinking mode discriminator (for example enabled or + disabled). Required. + }, + "tool_choice": {}, + "tools": [ + { + "input_schema": { + "str": {} # JSON Schema (draft 2020-12 style) + describing the tool input object. Required. + }, + "name": "str", # Tool name referenced in ``tool_use`` + blocks. Required. + "description": "str" # Optional. Human-readable description + of what the tool does. + } + ], + "top_k": 0, # Optional. Top-K sampling cutoff. + "top_p": 0.0 # Optional. Nucleus sampling; use either ``temperature`` or + ``top_p``"" , not both. + } + + # response body for status code(s): 200 + response == { + "content": [ + {} + ], + "id": "str", # Unique identifier for this message object. Required. + "model": "str", # Model that produced the message. Required. + "role": "str", # Always ``assistant`` for this response. Required. + "assistant" + "stop_reason": "str", # Why generation stopped. Required. Known values are: + "end_turn", "max_tokens", "stop_sequence", and "tool_use". + "type": "str", # Object type discriminator. Required. "message" + "usage": { + "input_tokens": 0, # Number of input tokens billed for this request. + Required. + "output_tokens": 0, # Number of output tokens generated. Required. + "cache_creation_input_tokens": 0, # Optional. Input tokens used to + create a prompt cache entry, if applicable. + "cache_read_input_tokens": 0, # Optional. Input tokens read from a + prompt cache, if applicable. + "speed": "str" # Optional. Inference speed tier reflected in billing + or routing. Known values are: "standard" and "fast". + }, + "stop_sequence": "str" # Optional. When ``stop_reason`` is + ``stop_sequence``"" , the sequence that matched. + } + # response body for status code(s): 400 + response == { + "error": { + "message": "str", # Human-readable error message. Required. + "type": "str" # Machine-readable error code. Required. + }, + "type": "str" # Required. "error" + } + """ + + @overload + async def create_messages( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create the next assistant message. + + Send a structured list of input messages with text and/or image content, and the model will + generate the next message in the conversation. + + :param body: Required. + :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 == { + "content": [ + {} + ], + "id": "str", # Unique identifier for this message object. Required. + "model": "str", # Model that produced the message. Required. + "role": "str", # Always ``assistant`` for this response. Required. + "assistant" + "stop_reason": "str", # Why generation stopped. Required. Known values are: + "end_turn", "max_tokens", "stop_sequence", and "tool_use". + "type": "str", # Object type discriminator. Required. "message" + "usage": { + "input_tokens": 0, # Number of input tokens billed for this request. + Required. + "output_tokens": 0, # Number of output tokens generated. Required. + "cache_creation_input_tokens": 0, # Optional. Input tokens used to + create a prompt cache entry, if applicable. + "cache_read_input_tokens": 0, # Optional. Input tokens read from a + prompt cache, if applicable. + "speed": "str" # Optional. Inference speed tier reflected in billing + or routing. Known values are: "standard" and "fast". + }, + "stop_sequence": "str" # Optional. When ``stop_reason`` is + ``stop_sequence``"" , the sequence that matched. + } + # response body for status code(s): 400 + response == { + "error": { + "message": "str", # Human-readable error message. Required. + "type": "str" # Machine-readable error code. Required. + }, + "type": "str" # Required. "error" + } + """ + + @distributed_trace_async + async def create_messages( + self, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create the next assistant message. + + Send a structured list of input messages with text and/or image content, and the model will + generate the next message in the conversation. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :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 = { + "max_tokens": 0, # Maximum tokens to generate before stopping. Required. + "messages": [ + { + "content": {}, + "role": "str" # Speaker role for this message. Required. + Known values are: "user" and "assistant". + } + ], + "model": "str", # Model ID (for example ``claude-opus-4-6`` or a serverless + model id). Required. + "metadata": { + "user_id": "str" # Optional. Opaque identifier for the end user (for + example a UUID or hash). Do not include PII. + }, + "reasoning_effort": "str", # Optional. DigitalOcean extension for + reasoning-capable models. Ignored by executors that do not support it. Known + values are: "none", "minimal", "low", "medium", "high", and "xhigh". + "speed": "str", # Optional. DigitalOcean extension for preferred inference + speed. Ignored when not supported. Known values are: "standard" and "fast". + "stop_sequences": [ + "str" # Optional. Custom strings that stop generation when produced. + ], + "stream": False, # Optional. Default value is False. When true, the response + is streamed using server-sent events (SSE). + "system": {}, + "temperature": 0.0, # Optional. Sampling temperature between 0.0 and 1.0. + "thinking": { + "type": "str" # Thinking mode discriminator (for example enabled or + disabled). Required. + }, + "tool_choice": {}, + "tools": [ + { + "input_schema": { + "str": {} # JSON Schema (draft 2020-12 style) + describing the tool input object. Required. + }, + "name": "str", # Tool name referenced in ``tool_use`` + blocks. Required. + "description": "str" # Optional. Human-readable description + of what the tool does. + } + ], + "top_k": 0, # Optional. Top-K sampling cutoff. + "top_p": 0.0 # Optional. Nucleus sampling; use either ``temperature`` or + ``top_p``"" , not both. + } + + # response body for status code(s): 200 + response == { + "content": [ + {} + ], + "id": "str", # Unique identifier for this message object. Required. + "model": "str", # Model that produced the message. Required. + "role": "str", # Always ``assistant`` for this response. Required. + "assistant" + "stop_reason": "str", # Why generation stopped. Required. Known values are: + "end_turn", "max_tokens", "stop_sequence", and "tool_use". + "type": "str", # Object type discriminator. Required. "message" + "usage": { + "input_tokens": 0, # Number of input tokens billed for this request. + Required. + "output_tokens": 0, # Number of output tokens generated. Required. + "cache_creation_input_tokens": 0, # Optional. Input tokens used to + create a prompt cache entry, if applicable. + "cache_read_input_tokens": 0, # Optional. Input tokens read from a + prompt cache, if applicable. + "speed": "str" # Optional. Inference speed tier reflected in billing + or routing. Known values are: "standard" and "fast". + }, + "stop_sequence": "str" # Optional. When ``stop_reason`` is + ``stop_sequence``"" , the sequence that matched. + } + # response body for status code(s): 400 + response == { + "error": { + "message": "str", # Human-readable error message. Required. + "type": "str" # Machine-readable error code. Required. + }, + "type": "str" # Required. "error" + } + """ + 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: + _json = body + + _request = build_inference_create_messages_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, 400]: + 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 == 400: + 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_embedding( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create embedding. + + Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. + Unknown fields in the request body are rejected. There is no streaming response for this + endpoint. + + :param body: Required. + :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 = { + "input": {}, + "model": "str", # Model id to use for embeddings. Must match a model your + account can access. Required. + "encoding_format": "float", # Optional. Default value is "float". How + embedding values are returned in each ``data[].embedding`` field. Known values + are: "float" and "base64". + "user": "str" # Optional. Optional end-user identifier to help with abuse + monitoring. + } + + # response body for status code(s): 200 + response == { + "data": [ + { + "embedding": {}, + "index": 0, # Zero-based index of the corresponding + ``input`` item (0 when ``input`` is a string). Required. + "object": "str" # The object type, which is always + ``embedding``. Required. "embedding" + } + ], + "model": "str", # The embedding model that produced the vectors. Required. + "object": "str", # The object type, which is always the string ``list``. + Required. "list" + "usage": { + "prompt_tokens": 0, # Number of input tokens used for the embedding. + Required. + "total_tokens": 0 # Total billable tokens for the request. Required. + } + } + """ + + @overload + async def create_embedding( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create embedding. + + Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. + Unknown fields in the request body are rejected. There is no streaming response for this + endpoint. + + :param body: Required. + :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 == { + "data": [ + { + "embedding": {}, + "index": 0, # Zero-based index of the corresponding + ``input`` item (0 when ``input`` is a string). Required. + "object": "str" # The object type, which is always + ``embedding``. Required. "embedding" + } + ], + "model": "str", # The embedding model that produced the vectors. Required. + "object": "str", # The object type, which is always the string ``list``. + Required. "list" + "usage": { + "prompt_tokens": 0, # Number of input tokens used for the embedding. + Required. + "total_tokens": 0 # Total billable tokens for the request. Required. + } + } + """ + + @distributed_trace_async + async def create_embedding( + self, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create embedding. + + Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. + Unknown fields in the request body are rejected. There is no streaming response for this + endpoint. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :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 = { + "input": {}, + "model": "str", # Model id to use for embeddings. Must match a model your + account can access. Required. + "encoding_format": "float", # Optional. Default value is "float". How + embedding values are returned in each ``data[].embedding`` field. Known values + are: "float" and "base64". + "user": "str" # Optional. Optional end-user identifier to help with abuse + monitoring. + } + + # response body for status code(s): 200 + response == { + "data": [ + { + "embedding": {}, + "index": 0, # Zero-based index of the corresponding + ``input`` item (0 when ``input`` is a string). Required. + "object": "str" # The object type, which is always + ``embedding``. Required. "embedding" + } + ], + "model": "str", # The embedding model that produced the vectors. Required. + "object": "str", # The object type, which is always the string ``list``. + Required. "list" + "usage": { + "prompt_tokens": 0, # Number of input tokens used for the embedding. + Required. + "total_tokens": 0 # Total billable tokens for the request. Required. + } + } + """ + 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: + _json = body + + _request = build_inference_create_embedding_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]: + 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 = {} + 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_image( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Generate images from text prompts. + + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation + model with automatic prompt optimization and enhanced visual capabilities. + + :param body: Required. + :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 = { + "model": "str", # The model to use for image generation. Required. + "n": 0, # The number of images to generate. Must be between 1 and 10. + Required. + "prompt": "str", # A text description of the desired image(s). Supports up + to 32,000 characters and provides automatic prompt optimization for best results. + Required. + "background": "str", # Optional. The background setting for the image + generation. Supported values: transparent, opaque, auto. + "moderation": "str", # Optional. The moderation setting for the image + generation. Supported values: low, auto. + "output_compression": 0, # Optional. The output compression level for the + image generation (0-100). + "output_format": "str", # Optional. The output format for the image + generation. Supported values: png, webp, jpeg. + "partial_images": 0, # Optional. The number of partial image chunks to + return during streaming generation. Defaults to 0. When stream=true, this must be + greater than 0 to receive progressive updates of the image as it is being + generated. + "quality": "str", # Optional. The quality of the image that will be + generated. Supported values: auto, high, medium, low. + "size": "str", # Optional. The size of the generated images. GPT-IMAGE-1 + supports: auto (automatically select best size), 1536x1024 (landscape), 1024x1536 + (portrait). Known values are: "auto", "1536x1024", and "1024x1536". + "stream": False, # Optional. Default value is False. If set to true, partial + image data will be streamed as the image is being generated. The response will be + sent as server-sent events with partial image chunks. When stream is true, + partial_images must be greater than 0. + "user": "str" # Optional. A unique identifier representing your end-user, + which can help DigitalOcean to monitor and detect abuse. + } + + # response body for status code(s): 200 + response == { + "created": 0, # The Unix timestamp (in seconds) of when the images were + created. Required. + "data": [ + { + "b64_json": "str", # The base64-encoded JSON of the + generated image. Required. + "revised_prompt": "str" # Optional. The optimized prompt + that was used to generate the image. + } + ], + "background": "str", # Optional. The background setting used for the image + generation. + "output_format": "str", # Optional. The output format of the generated + image. + "quality": "str", # Optional. The quality setting used for the image + generation. + "size": "str", # Optional. The size of the generated image. + "usage": { + "input_tokens": 0, # The number of tokens (images and text) in the + input prompt. Required. + "input_tokens_details": { + "image_tokens": 0, # The number of image tokens in the input + prompt. Required. + "text_tokens": 0 # The number of text tokens in the input + prompt. Required. + }, + "output_tokens": 0, # The number of image tokens in the output + image. Required. + "total_tokens": 0 # The total number of tokens (images and text) + used for the image generation. Required. + } + } + """ + + @overload + async def create_image( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + """Generate images from text prompts. + + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation + model with automatic prompt optimization and enhanced visual capabilities. + + :param body: Required. + :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 == { - "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. + "created": 0, # The Unix timestamp (in seconds) of when the images were + created. Required. + "data": [ + { + "b64_json": "str", # The base64-encoded JSON of the + generated image. Required. + "revised_prompt": "str" # Optional. The optimized prompt + that was used to generate the image. + } + ], + "background": "str", # Optional. The background setting used for the image + generation. + "output_format": "str", # Optional. The output format of the generated + image. + "quality": "str", # Optional. The quality setting used for the image + generation. + "size": "str", # Optional. The size of the generated image. + "usage": { + "input_tokens": 0, # The number of tokens (images and text) in the + input prompt. Required. + "input_tokens_details": { + "image_tokens": 0, # The number of image tokens in the input + prompt. Required. + "text_tokens": 0 # The number of text tokens in the input + prompt. Required. + }, + "output_tokens": 0, # The number of image tokens in the output + image. Required. + "total_tokens": 0 # The total number of tokens (images and text) + used for the image generation. Required. + } + } + """ + + @distributed_trace_async + async def create_image(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Generate images from text prompts. + + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation + model with automatic prompt optimization and enhanced visual capabilities. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :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 = { + "model": "str", # The model to use for image generation. Required. + "n": 0, # The number of images to generate. Must be between 1 and 10. + Required. + "prompt": "str", # A text description of the desired image(s). Supports up + to 32,000 characters and provides automatic prompt optimization for best results. + Required. + "background": "str", # Optional. The background setting for the image + generation. Supported values: transparent, opaque, auto. + "moderation": "str", # Optional. The moderation setting for the image + generation. Supported values: low, auto. + "output_compression": 0, # Optional. The output compression level for the + image generation (0-100). + "output_format": "str", # Optional. The output format for the image + generation. Supported values: png, webp, jpeg. + "partial_images": 0, # Optional. The number of partial image chunks to + return during streaming generation. Defaults to 0. When stream=true, this must be + greater than 0 to receive progressive updates of the image as it is being + generated. + "quality": "str", # Optional. The quality of the image that will be + generated. Supported values: auto, high, medium, low. + "size": "str", # Optional. The size of the generated images. GPT-IMAGE-1 + supports: auto (automatically select best size), 1536x1024 (landscape), 1024x1536 + (portrait). Known values are: "auto", "1536x1024", and "1024x1536". + "stream": False, # Optional. Default value is False. If set to true, partial + image data will be streamed as the image is being generated. The response will be + sent as server-sent events with partial image chunks. When stream is true, + partial_images must be greater than 0. + "user": "str" # Optional. A unique identifier representing your end-user, + which can help DigitalOcean to monitor and detect abuse. + } + + # response body for status code(s): 200 + response == { + "created": 0, # The Unix timestamp (in seconds) of when the images were + created. Required. + "data": [ + { + "b64_json": "str", # The base64-encoded JSON of the + generated image. Required. + "revised_prompt": "str" # Optional. The optimized prompt + that was used to generate the image. + } + ], + "background": "str", # Optional. The background setting used for the image + generation. + "output_format": "str", # Optional. The output format of the generated + image. + "quality": "str", # Optional. The quality setting used for the image + generation. + "size": "str", # Optional. The size of the generated image. + "usage": { + "input_tokens": 0, # The number of tokens (images and text) in the + input prompt. Required. + "input_tokens_details": { + "image_tokens": 0, # The number of image tokens in the input + prompt. Required. + "text_tokens": 0 # The number of text tokens in the input + prompt. Required. + }, + "output_tokens": 0, # The number of image tokens in the output + image. Required. + "total_tokens": 0 # The total number of tokens (images and text) + used for the image generation. Required. + } } """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -254153,13 +257093,9 @@ async def update_agents_workspace( if isinstance(body, (IOBase, bytes)): _content = body else: - if body is not None: - _json = body - else: - _json = None + _json = body - _request = build_genai_update_agents_workspace_request( - workspace_uuid=workspace_uuid, + _request = build_inference_create_image_request( content_type=content_type, json=_json, content=_content, @@ -254177,44 +257113,27 @@ async def update_agents_workspace( response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: 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") - ) + 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.content: + deserialized = response.json() + else: + deserialized = None if cls: return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore @@ -254222,17 +257141,12 @@ async def update_agents_workspace( return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def list_evaluation_test_cases_by_workspace( - self, workspace_uuid: str, **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """List Evaluation Test Cases by Workspace. + async def list_models(self, **kwargs: Any) -> JSON: + """List available models. - To list all evaluation test cases by a workspace, send a GET request to - ``/v2/gen-ai/workspaces/{workspace_uuid}/evaluation_test_cases``. + Lists the currently available models, and provides basic information about each one such as the + owner and availability. - :param workspace_uuid: Workspace UUID. Required. - :type workspace_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -254242,91 +257156,19 @@ async def list_evaluation_test_cases_by_workspace( # response body for status code(s): 200 response == { - "evaluation_test_cases": [ + "data": [ { - "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": [ - { - "category": "METRIC_CATEGORY_UNSPECIFIED", # - Optional. Default value is "METRIC_CATEGORY_UNSPECIFIED". Known - values are: "METRIC_CATEGORY_UNSPECIFIED", - "METRIC_CATEGORY_CORRECTNESS", "METRIC_CATEGORY_USER_OUTCOMES", - "METRIC_CATEGORY_SAFETY_AND_SECURITY", - "METRIC_CATEGORY_CONTEXT_QUALITY", and - "METRIC_CATEGORY_MODEL_FIT". - "description": "str", # Optional. - "inverted": bool, # Optional. If true, the - metric is inverted, meaning that a lower value is better. - "is_metric_goal": bool, # Optional. - "metric_name": "str", # Optional. - "metric_rank": 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. - "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. + "created": 0, # The Unix timestamp (in seconds) when the + model was created. Required. + "id": "str", # The model identifier, which can be referenced + in the API endpoints. Required. + "object": "str", # The object type, which is always "model". + Required. "model" + "owned_by": "str" # The organization that owns the model. + Required. } - ] - } - # 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. + ], + "object": "str" # The object type, which is always "list". Required. "list" } """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -254347,8 +257189,7 @@ async def list_evaluation_test_cases_by_workspace( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_evaluation_test_cases_by_workspace_request( - workspace_uuid=workspace_uuid, + _request = build_inference_list_models_request( headers=_headers, params=_params, ) @@ -254363,78 +257204,42 @@ async def list_evaluation_test_cases_by_workspace( response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: 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") - ) + 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.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 - -class InferenceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~pydo.aio.GeneratedClient`'s - :attr:`inference` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = ( - input_args.pop(0) if input_args else kwargs.pop("deserializer") - ) - @overload - async def create_chat_completion( + async def create_response( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a model response for the given chat conversation. + """Send Prompt to a Model Using the Responses API. - Creates a model response for the given chat conversation. + Generate text responses from text prompts. This endpoint supports both streaming and + non-streaming responses for supported text models. :param body: Required. :type body: JSON @@ -254450,257 +257255,129 @@ async def create_chat_completion( # JSON input template you can fill out and use as your body input. body = { - "messages": [ - { - "role": "str", # The role of the message author. Required. - Known values are: "system", "developer", "user", "assistant", and "tool". - "content": "str", # Optional. The contents of the message. - "reasoning_content": "str", # Optional. The reasoning - content generated by the model (assistant messages only). - "refusal": "str", # Optional. The refusal message generated - by the model (assistant messages only). - "tool_call_id": "str", # Optional. Tool call that this - message is responding to (tool messages only). - "tool_calls": [ - { - "function": { - "arguments": "str", # The arguments - to call the function with, as generated by the model in JSON - format. Required. - "name": "str" # The name of the - function to call. Required. - }, - "id": "str", # The ID of the tool call. - Required. - "type": "str" # The type of the tool. - Currently, only function is supported. Required. "function" - } - ] - } - ], - "model": "str", # Model ID used to generate the response. Required. - "frequency_penalty": 0, # Optional. Default value is 0. Number between -2.0 - and 2.0. Positive values penalize new tokens based on their existing frequency in - the text so far, decreasing the model's likelihood to repeat the same line - verbatim. - "logit_bias": { - "str": 0 # Optional. Modify the likelihood of specified tokens - appearing in the completion. Accepts a JSON object that maps tokens - (specified by their token ID in the tokenizer) to an associated bias value - from -100 to 100. Mathematically, the bias is added to the logits generated - by the model prior to sampling. The exact effect will vary per model, but - values between -1 and 1 should decrease or increase likelihood of selection; - values like -100 or 100 should result in a ban or exclusive selection of the - relevant token. - }, - "logprobs": False, # Optional. Default value is False. Whether to return log - probabilities of the output tokens or not. If true, returns the log probabilities - of each output token returned in the content of message. - "max_completion_tokens": 0, # Optional. The maximum number of completion - tokens that may be used over the course of the run. The run will make a best - effort to use only the number of completion tokens specified, across multiple - turns of the run. - "max_tokens": 0, # Optional. The maximum number of tokens that can be - generated in the completion. The token count of your prompt plus max_tokens - cannot exceed the model's context length. + "input": {}, + "model": "str", # The model ID of the model you want to use. Get the model + ID using ``/v1/models`` or on the available models page. Required. + "instructions": "str", # Optional. System-level instructions for the model. + This sets the behavior and context for the response generation. + "max_output_tokens": 0, # Optional. The maximum number of tokens to generate + in the response. "metadata": { - "str": "str" # Optional. Set of 16 key-value pairs that can be - attached to an object. This can be useful for storing additional information - about the object in a structured format. Keys are strings with a maximum - length of 64 characters. Values are strings with a maximum length of 512 - characters. + "str": "str" # Optional. Set of key-value pairs that can be attached + to the request. }, - "n": 1, # Optional. Default value is 1. How many chat completion choices to - generate for each input message. Note that you will be charged based on the - number of generated tokens across all of the choices. Keep n as 1 to minimize - costs. - "presence_penalty": 0, # Optional. Default value is 0. Number between -2.0 - and 2.0. Positive values penalize new tokens based on whether they appear in the - text so far, increasing the model's likelihood to talk about new topics. - "reasoning_effort": "str", # Optional. Constrains effort on reasoning for - reasoning models. Reducing reasoning effort can result in faster responses and - fewer tokens used on reasoning in a response. Known values are: "none", - "minimal", "low", "medium", "high", and "xhigh". - "seed": 0, # Optional. If specified, the system will make a best effort to - sample deterministically, such that repeated requests with the same seed and - parameters should return the same result. Determinism is not guaranteed. "stop": {}, - "stream": False, # Optional. Default value is False. If set to true, the - model response data will be streamed to the client as it is generated using - server-sent events. + "stream": False, # Optional. Default value is False. Set to true to stream + partial responses as Server-Sent Events. "stream_options": { "include_usage": bool # Optional. If set, an additional chunk will - be streamed before the data [DONE] message. The usage field on this chunk - shows the token usage statistics for the entire request, and the choices - field will always be an empty array. + be streamed before the data: [DONE] message with token usage statistics for + the entire request. }, - "temperature": 0.0, # Optional. What sampling temperature to use, between 0 - and 2. Higher values like 0.8 will make the output more random, while lower - values like 0.2 will make it more focused and deterministic. We generally - recommend altering this or top_p but not both. + "temperature": 0.0, # Optional. A value between 0.0 and 2.0 to control + randomness and creativity. Lower values like 0.2 make the output more focused and + deterministic, while higher values like 0.8 make it more random. "tool_choice": {}, "tools": [ { - "function": { - "name": "str", # The name of the function to be - called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, - with a maximum length of 64. Required. - "description": "str", # Optional. A description of - what the function does, used by the model to choose when and how to - call the function. - "parameters": { - "str": {} # Optional. The parameters the - function accepts, described as a JSON Schema object. - } - }, - "type": "str" # The type of the tool. Currently, only - function is supported. Required. "function" + "type": "str", # The type of the tool. Required. "function" + "description": "str", # Optional. A description of what the + function does. + "name": "str", # Optional. The name of the function to be + called. + "parameters": { + "str": {} # Optional. The parameters the function + accepts, described as a JSON Schema object. + } } ], - "top_logprobs": 0, # Optional. An integer between 0 and 20 specifying the - number of most likely tokens to return at each token position, each with an - associated log probability. logprobs must be set to true if this parameter is - used. "top_p": 0.0, # Optional. An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with - top_p probability mass. So 0.1 means only the tokens comprising the top 10% - probability mass are considered. We generally recommend altering this or - temperature but not both. - "user": "str" # Optional. A unique identifier representing your end-user, - which can help DigitalOcean to monitor and detect abuse. + top_p probability mass. + "user": "str" # Optional. A unique identifier representing your end-user. } # response body for status code(s): 200 response == { - "choices": [ + "created": 0, # The Unix timestamp (in seconds) of when the response was + created. Required. + "id": "str", # A unique identifier for the response. Required. + "model": "str", # The model used to generate the response. Required. + "object": "str", # The object type, which is always ``response``. Required. + "response" + "output": [ { - "finish_reason": "str", # The reason the model stopped - generating tokens. stop if the model hit a natural stop point or a - provided stop sequence, length if the maximum number of tokens specified - in the request was reached, tool_calls if the model called a tool. - Required. Known values are: "stop", "length", "tool_calls", and - "content_filter". - "index": 0, # The index of the choice in the list of - choices. Required. - "logprobs": { - "content": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ], - "refusal": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ] - }, - "message": { - "content": "str", # The contents of the message. - Required. - "reasoning_content": "str", # The reasoning content - generated by the model. Required. - "refusal": "str", # The refusal message generated by - the model. Required. - "role": "str", # The role of the author of this - message. Required. "assistant" - "tool_calls": [ - { - "function": { - "arguments": "str", # The - arguments to call the function with. Required. - "name": "str" # The name of - the function to call. Required. - }, - "id": "str", # The ID of the tool - call. Required. - "type": "str" # The type of the - tool. Required. "function" - } - ] - } + "content": [ + { + "text": "str", # The text content. Required. + "type": "str" # The type of content part. + ``reasoning_text`` for reasoning content, ``output_text`` for + final output text. Required. Known values are: "reasoning_text" + and "output_text". + } + ], + "type": "str", # The type of output item. One of + ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known + values are: "reasoning", "message", and "function_call". + "arguments": "str", # Optional. JSON string of function + arguments (present when type is ``function_call``"" ). + "call_id": "str", # Optional. The unique ID of the function + tool call (present when type is ``function_call``"" ). + "id": "str", # Optional. The unique ID of the output item. + "name": "str", # Optional. The name of the function to call + (present when type is ``function_call``"" ). + "role": "str", # Optional. The role associated with this + output item (typically ``assistant``"" ). + "status": "str" # Optional. Status of the item. } ], - "created": 0, # The Unix timestamp (in seconds) of when the chat completion - was created. Required. - "id": "str", # A unique identifier for the chat completion. Required. - "model": "str", # The model used for the chat completion. Required. - "object": "str", # The object type, which is always chat.completion. - Required. "chat.completion" "usage": { - "cache_created_input_tokens": 0, # Default value is 0. Number of - prompt tokens written to cache. Required. - "cache_creation": { - "ephemeral_1h_input_tokens": 0, # Default value is 0. Number - of prompt tokens written to 1h cache. Required. - "ephemeral_5m_input_tokens": 0 # Default value is 0. Number - of prompt tokens written to 5m cache. Required. + "input_tokens": 0, # The number of input tokens. Required. + "input_tokens_details": { + "cached_tokens": 0 # The number of tokens that were + retrieved from the cache. Required. }, - "cache_read_input_tokens": 0, # Default value is 0. Number of prompt - tokens read from cache. Required. - "completion_tokens": 0, # Default value is 0. Number of tokens in - the generated completion. Required. - "prompt_tokens": 0, # Default value is 0. Number of tokens in the - prompt. Required. - "total_tokens": 0 # Default value is 0. Total number of tokens used - in the request (prompt + completion). Required. - } + "output_tokens": 0, # The number of output tokens. Required. + "output_tokens_details": { + "reasoning_tokens": 0, # The number of reasoning tokens. + Required. + "tool_output_tokens": 0 # The number of tool output tokens. + Required. + }, + "total_tokens": 0 # The total number of tokens used. Required. + }, + "max_output_tokens": 0, # Optional. Maximum output tokens setting. + "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are + enabled. + "status": "str", # Optional. Status of the response. + "temperature": 0.0, # Optional. Temperature setting used for the response. + "tool_choice": "str", # Optional. Tool choice setting used for the response. + "tools": [ + { + "type": "str", # The type of the tool. Required. "function" + "description": "str", # Optional. A description of what the + function does. + "name": "str", # Optional. The name of the function. + "parameters": { + "str": {} # Optional. The parameters the function + accepts. + } + } + ], + "top_p": 0.0, # Optional. Top-p setting used for the response. + "user": "str" # Optional. User identifier. } """ @overload - async def create_chat_completion( + async def create_response( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a model response for the given chat conversation. + """Send Prompt to a Model Using the Responses API. - Creates a model response for the given chat conversation. + Generate text responses from text prompts. This endpoint supports both streaming and + non-streaming responses for supported text models. :param body: Required. :type body: IO[bytes] @@ -254716,387 +257393,208 @@ async def create_chat_completion( # response body for status code(s): 200 response == { - "choices": [ - { - "finish_reason": "str", # The reason the model stopped - generating tokens. stop if the model hit a natural stop point or a - provided stop sequence, length if the maximum number of tokens specified - in the request was reached, tool_calls if the model called a tool. - Required. Known values are: "stop", "length", "tool_calls", and - "content_filter". - "index": 0, # The index of the choice in the list of - choices. Required. - "logprobs": { - "content": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ], - "refusal": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ] - }, - "message": { - "content": "str", # The contents of the message. - Required. - "reasoning_content": "str", # The reasoning content - generated by the model. Required. - "refusal": "str", # The refusal message generated by - the model. Required. - "role": "str", # The role of the author of this - message. Required. "assistant" - "tool_calls": [ - { - "function": { - "arguments": "str", # The - arguments to call the function with. Required. - "name": "str" # The name of - the function to call. Required. - }, - "id": "str", # The ID of the tool - call. Required. - "type": "str" # The type of the - tool. Required. "function" - } - ] - } - } - ], - "created": 0, # The Unix timestamp (in seconds) of when the chat completion - was created. Required. - "id": "str", # A unique identifier for the chat completion. Required. - "model": "str", # The model used for the chat completion. Required. - "object": "str", # The object type, which is always chat.completion. - Required. "chat.completion" - "usage": { - "cache_created_input_tokens": 0, # Default value is 0. Number of - prompt tokens written to cache. Required. - "cache_creation": { - "ephemeral_1h_input_tokens": 0, # Default value is 0. Number - of prompt tokens written to 1h cache. Required. - "ephemeral_5m_input_tokens": 0 # Default value is 0. Number - of prompt tokens written to 5m cache. Required. - }, - "cache_read_input_tokens": 0, # Default value is 0. Number of prompt - tokens read from cache. Required. - "completion_tokens": 0, # Default value is 0. Number of tokens in - the generated completion. Required. - "prompt_tokens": 0, # Default value is 0. Number of tokens in the - prompt. Required. - "total_tokens": 0 # Default value is 0. Total number of tokens used - in the request (prompt + completion). Required. - } - } - """ - - @distributed_trace_async - async def create_chat_completion( - self, body: Union[JSON, IO[bytes]], **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Create a model response for the given chat conversation. - - Creates a model response for the given chat conversation. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :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 = { - "messages": [ + "created": 0, # The Unix timestamp (in seconds) of when the response was + created. Required. + "id": "str", # A unique identifier for the response. Required. + "model": "str", # The model used to generate the response. Required. + "object": "str", # The object type, which is always ``response``. Required. + "response" + "output": [ { - "role": "str", # The role of the message author. Required. - Known values are: "system", "developer", "user", "assistant", and "tool". - "content": "str", # Optional. The contents of the message. - "reasoning_content": "str", # Optional. The reasoning - content generated by the model (assistant messages only). - "refusal": "str", # Optional. The refusal message generated - by the model (assistant messages only). - "tool_call_id": "str", # Optional. Tool call that this - message is responding to (tool messages only). - "tool_calls": [ + "content": [ { - "function": { - "arguments": "str", # The arguments - to call the function with, as generated by the model in JSON - format. Required. - "name": "str" # The name of the - function to call. Required. - }, - "id": "str", # The ID of the tool call. - Required. - "type": "str" # The type of the tool. - Currently, only function is supported. Required. "function" + "text": "str", # The text content. Required. + "type": "str" # The type of content part. + ``reasoning_text`` for reasoning content, ``output_text`` for + final output text. Required. Known values are: "reasoning_text" + and "output_text". } - ] + ], + "type": "str", # The type of output item. One of + ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known + values are: "reasoning", "message", and "function_call". + "arguments": "str", # Optional. JSON string of function + arguments (present when type is ``function_call``"" ). + "call_id": "str", # Optional. The unique ID of the function + tool call (present when type is ``function_call``"" ). + "id": "str", # Optional. The unique ID of the output item. + "name": "str", # Optional. The name of the function to call + (present when type is ``function_call``"" ). + "role": "str", # Optional. The role associated with this + output item (typically ``assistant``"" ). + "status": "str" # Optional. Status of the item. } ], - "model": "str", # Model ID used to generate the response. Required. - "frequency_penalty": 0, # Optional. Default value is 0. Number between -2.0 - and 2.0. Positive values penalize new tokens based on their existing frequency in - the text so far, decreasing the model's likelihood to repeat the same line - verbatim. - "logit_bias": { - "str": 0 # Optional. Modify the likelihood of specified tokens - appearing in the completion. Accepts a JSON object that maps tokens - (specified by their token ID in the tokenizer) to an associated bias value - from -100 to 100. Mathematically, the bias is added to the logits generated - by the model prior to sampling. The exact effect will vary per model, but - values between -1 and 1 should decrease or increase likelihood of selection; - values like -100 or 100 should result in a ban or exclusive selection of the - relevant token. + "usage": { + "input_tokens": 0, # The number of input tokens. Required. + "input_tokens_details": { + "cached_tokens": 0 # The number of tokens that were + retrieved from the cache. Required. + }, + "output_tokens": 0, # The number of output tokens. Required. + "output_tokens_details": { + "reasoning_tokens": 0, # The number of reasoning tokens. + Required. + "tool_output_tokens": 0 # The number of tool output tokens. + Required. + }, + "total_tokens": 0 # The total number of tokens used. Required. }, - "logprobs": False, # Optional. Default value is False. Whether to return log - probabilities of the output tokens or not. If true, returns the log probabilities - of each output token returned in the content of message. - "max_completion_tokens": 0, # Optional. The maximum number of completion - tokens that may be used over the course of the run. The run will make a best - effort to use only the number of completion tokens specified, across multiple - turns of the run. - "max_tokens": 0, # Optional. The maximum number of tokens that can be - generated in the completion. The token count of your prompt plus max_tokens - cannot exceed the model's context length. + "max_output_tokens": 0, # Optional. Maximum output tokens setting. + "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are + enabled. + "status": "str", # Optional. Status of the response. + "temperature": 0.0, # Optional. Temperature setting used for the response. + "tool_choice": "str", # Optional. Tool choice setting used for the response. + "tools": [ + { + "type": "str", # The type of the tool. Required. "function" + "description": "str", # Optional. A description of what the + function does. + "name": "str", # Optional. The name of the function. + "parameters": { + "str": {} # Optional. The parameters the function + accepts. + } + } + ], + "top_p": 0.0, # Optional. Top-p setting used for the response. + "user": "str" # Optional. User identifier. + } + """ + + @distributed_trace_async + async def create_response( + self, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Send Prompt to a Model Using the Responses API. + + Generate text responses from text prompts. This endpoint supports both streaming and + non-streaming responses for supported text models. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :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 = { + "input": {}, + "model": "str", # The model ID of the model you want to use. Get the model + ID using ``/v1/models`` or on the available models page. Required. + "instructions": "str", # Optional. System-level instructions for the model. + This sets the behavior and context for the response generation. + "max_output_tokens": 0, # Optional. The maximum number of tokens to generate + in the response. "metadata": { - "str": "str" # Optional. Set of 16 key-value pairs that can be - attached to an object. This can be useful for storing additional information - about the object in a structured format. Keys are strings with a maximum - length of 64 characters. Values are strings with a maximum length of 512 - characters. + "str": "str" # Optional. Set of key-value pairs that can be attached + to the request. }, - "n": 1, # Optional. Default value is 1. How many chat completion choices to - generate for each input message. Note that you will be charged based on the - number of generated tokens across all of the choices. Keep n as 1 to minimize - costs. - "presence_penalty": 0, # Optional. Default value is 0. Number between -2.0 - and 2.0. Positive values penalize new tokens based on whether they appear in the - text so far, increasing the model's likelihood to talk about new topics. - "reasoning_effort": "str", # Optional. Constrains effort on reasoning for - reasoning models. Reducing reasoning effort can result in faster responses and - fewer tokens used on reasoning in a response. Known values are: "none", - "minimal", "low", "medium", "high", and "xhigh". - "seed": 0, # Optional. If specified, the system will make a best effort to - sample deterministically, such that repeated requests with the same seed and - parameters should return the same result. Determinism is not guaranteed. "stop": {}, - "stream": False, # Optional. Default value is False. If set to true, the - model response data will be streamed to the client as it is generated using - server-sent events. + "stream": False, # Optional. Default value is False. Set to true to stream + partial responses as Server-Sent Events. "stream_options": { "include_usage": bool # Optional. If set, an additional chunk will - be streamed before the data [DONE] message. The usage field on this chunk - shows the token usage statistics for the entire request, and the choices - field will always be an empty array. + be streamed before the data: [DONE] message with token usage statistics for + the entire request. }, - "temperature": 0.0, # Optional. What sampling temperature to use, between 0 - and 2. Higher values like 0.8 will make the output more random, while lower - values like 0.2 will make it more focused and deterministic. We generally - recommend altering this or top_p but not both. + "temperature": 0.0, # Optional. A value between 0.0 and 2.0 to control + randomness and creativity. Lower values like 0.2 make the output more focused and + deterministic, while higher values like 0.8 make it more random. "tool_choice": {}, "tools": [ { - "function": { - "name": "str", # The name of the function to be - called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, - with a maximum length of 64. Required. - "description": "str", # Optional. A description of - what the function does, used by the model to choose when and how to - call the function. - "parameters": { - "str": {} # Optional. The parameters the - function accepts, described as a JSON Schema object. - } - }, - "type": "str" # The type of the tool. Currently, only - function is supported. Required. "function" + "type": "str", # The type of the tool. Required. "function" + "description": "str", # Optional. A description of what the + function does. + "name": "str", # Optional. The name of the function to be + called. + "parameters": { + "str": {} # Optional. The parameters the function + accepts, described as a JSON Schema object. + } } ], - "top_logprobs": 0, # Optional. An integer between 0 and 20 specifying the - number of most likely tokens to return at each token position, each with an - associated log probability. logprobs must be set to true if this parameter is - used. "top_p": 0.0, # Optional. An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with - top_p probability mass. So 0.1 means only the tokens comprising the top 10% - probability mass are considered. We generally recommend altering this or - temperature but not both. - "user": "str" # Optional. A unique identifier representing your end-user, - which can help DigitalOcean to monitor and detect abuse. + top_p probability mass. + "user": "str" # Optional. A unique identifier representing your end-user. } # response body for status code(s): 200 response == { - "choices": [ + "created": 0, # The Unix timestamp (in seconds) of when the response was + created. Required. + "id": "str", # A unique identifier for the response. Required. + "model": "str", # The model used to generate the response. Required. + "object": "str", # The object type, which is always ``response``. Required. + "response" + "output": [ { - "finish_reason": "str", # The reason the model stopped - generating tokens. stop if the model hit a natural stop point or a - provided stop sequence, length if the maximum number of tokens specified - in the request was reached, tool_calls if the model called a tool. - Required. Known values are: "stop", "length", "tool_calls", and - "content_filter". - "index": 0, # The index of the choice in the list of - choices. Required. - "logprobs": { - "content": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ], - "refusal": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ] - }, - "message": { - "content": "str", # The contents of the message. - Required. - "reasoning_content": "str", # The reasoning content - generated by the model. Required. - "refusal": "str", # The refusal message generated by - the model. Required. - "role": "str", # The role of the author of this - message. Required. "assistant" - "tool_calls": [ - { - "function": { - "arguments": "str", # The - arguments to call the function with. Required. - "name": "str" # The name of - the function to call. Required. - }, - "id": "str", # The ID of the tool - call. Required. - "type": "str" # The type of the - tool. Required. "function" - } - ] - } + "content": [ + { + "text": "str", # The text content. Required. + "type": "str" # The type of content part. + ``reasoning_text`` for reasoning content, ``output_text`` for + final output text. Required. Known values are: "reasoning_text" + and "output_text". + } + ], + "type": "str", # The type of output item. One of + ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known + values are: "reasoning", "message", and "function_call". + "arguments": "str", # Optional. JSON string of function + arguments (present when type is ``function_call``"" ). + "call_id": "str", # Optional. The unique ID of the function + tool call (present when type is ``function_call``"" ). + "id": "str", # Optional. The unique ID of the output item. + "name": "str", # Optional. The name of the function to call + (present when type is ``function_call``"" ). + "role": "str", # Optional. The role associated with this + output item (typically ``assistant``"" ). + "status": "str" # Optional. Status of the item. } ], - "created": 0, # The Unix timestamp (in seconds) of when the chat completion - was created. Required. - "id": "str", # A unique identifier for the chat completion. Required. - "model": "str", # The model used for the chat completion. Required. - "object": "str", # The object type, which is always chat.completion. - Required. "chat.completion" "usage": { - "cache_created_input_tokens": 0, # Default value is 0. Number of - prompt tokens written to cache. Required. - "cache_creation": { - "ephemeral_1h_input_tokens": 0, # Default value is 0. Number - of prompt tokens written to 1h cache. Required. - "ephemeral_5m_input_tokens": 0 # Default value is 0. Number - of prompt tokens written to 5m cache. Required. + "input_tokens": 0, # The number of input tokens. Required. + "input_tokens_details": { + "cached_tokens": 0 # The number of tokens that were + retrieved from the cache. Required. }, - "cache_read_input_tokens": 0, # Default value is 0. Number of prompt - tokens read from cache. Required. - "completion_tokens": 0, # Default value is 0. Number of tokens in - the generated completion. Required. - "prompt_tokens": 0, # Default value is 0. Number of tokens in the - prompt. Required. - "total_tokens": 0 # Default value is 0. Total number of tokens used - in the request (prompt + completion). Required. - } + "output_tokens": 0, # The number of output tokens. Required. + "output_tokens_details": { + "reasoning_tokens": 0, # The number of reasoning tokens. + Required. + "tool_output_tokens": 0 # The number of tool output tokens. + Required. + }, + "total_tokens": 0 # The total number of tokens used. Required. + }, + "max_output_tokens": 0, # Optional. Maximum output tokens setting. + "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are + enabled. + "status": "str", # Optional. Status of the response. + "temperature": 0.0, # Optional. Temperature setting used for the response. + "tool_choice": "str", # Optional. Tool choice setting used for the response. + "tools": [ + { + "type": "str", # The type of the tool. Required. "function" + "description": "str", # Optional. A description of what the + function does. + "name": "str", # Optional. The name of the function. + "parameters": { + "str": {} # Optional. The parameters the function + accepts. + } + } + ], + "top_p": 0.0, # Optional. Top-p setting used for the response. + "user": "str" # Optional. User identifier. } """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -255128,7 +257626,7 @@ async def create_chat_completion( else: _json = body - _request = build_inference_create_chat_completion_request( + _request = build_inference_create_response_request( content_type=content_type, json=_json, content=_content, @@ -255174,14 +257672,15 @@ async def create_chat_completion( return cast(JSON, deserialized) # type: ignore @overload - async def create_messages( + async def create_async_invoke( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create the next assistant message. + """Generate Image, Audio, or Text-to-Speech Using fal Models. - Send a structured list of input messages with text and/or image content, and the model will - generate the next message in the conversation. + Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous + job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll + for the result. :param body: Required. :type body: JSON @@ -255197,99 +257696,66 @@ async def create_messages( # JSON input template you can fill out and use as your body input. body = { - "max_tokens": 0, # Maximum tokens to generate before stopping. Required. - "messages": [ - { - "content": {}, - "role": "str" # Speaker role for this message. Required. - Known values are: "user" and "assistant". - } - ], - "model": "str", # Model ID (for example ``claude-opus-4-6`` or a serverless - model id). Required. - "metadata": { - "user_id": "str" # Optional. Opaque identifier for the end user (for - example a UUID or hash). Do not include PII. - }, - "reasoning_effort": "str", # Optional. DigitalOcean extension for - reasoning-capable models. Ignored by executors that do not support it. Known - values are: "none", "minimal", "low", "medium", "high", and "xhigh". - "speed": "str", # Optional. DigitalOcean extension for preferred inference - speed. Ignored when not supported. Known values are: "standard" and "fast". - "stop_sequences": [ - "str" # Optional. Custom strings that stop generation when produced. - ], - "stream": False, # Optional. Default value is False. When true, the response - is streamed using server-sent events (SSE). - "system": {}, - "temperature": 0.0, # Optional. Sampling temperature between 0.0 and 1.0. - "thinking": { - "type": "str" # Thinking mode discriminator (for example enabled or - disabled). Required. + "input": { + "enable_safety_checker": bool, # Optional. Whether to enable the + safety checker for generated content. + "guidance_scale": 0.0, # Optional. Controls how closely the image + generation model follows the prompt. Higher values produce output more + closely matching the prompt. + "num_images": 0, # Optional. The number of images to generate. + "num_inference_steps": 0, # Optional. The number of inference steps + to use during image generation. More steps generally produce higher quality + output but take longer. + "output_format": "str", # Optional. The desired output format or + aspect ratio for image generation. + "prompt": "str", # Optional. The text prompt describing the desired + output. Used for image generation and audio generation models. + "seconds_total": 0, # Optional. The total duration in seconds for + generated audio. Used for audio generation models. + "text": "str" # Optional. The text content to convert to speech. + Used for text-to-speech models. }, - "tool_choice": {}, - "tools": [ + "model_id": "str", # The ID of the model to invoke asynchronously. Required. + "tags": [ { - "input_schema": { - "str": {} # JSON Schema (draft 2020-12 style) - describing the tool input object. Required. - }, - "name": "str", # Tool name referenced in ``tool_use`` - blocks. Required. - "description": "str" # Optional. Human-readable description - of what the tool does. + "key": "str", # The tag key. Required. + "value": "str" # The tag value. Required. } - ], - "top_k": 0, # Optional. Top-K sampling cutoff. - "top_p": 0.0 # Optional. Nucleus sampling; use either ``temperature`` or - ``top_p``"" , not both. + ] } - # response body for status code(s): 200 - response == { - "content": [ - {} - ], - "id": "str", # Unique identifier for this message object. Required. - "model": "str", # Model that produced the message. Required. - "role": "str", # Always ``assistant`` for this response. Required. - "assistant" - "stop_reason": "str", # Why generation stopped. Required. Known values are: - "end_turn", "max_tokens", "stop_sequence", and "tool_use". - "type": "str", # Object type discriminator. Required. "message" - "usage": { - "input_tokens": 0, # Number of input tokens billed for this request. - Required. - "output_tokens": 0, # Number of output tokens generated. Required. - "cache_creation_input_tokens": 0, # Optional. Input tokens used to - create a prompt cache entry, if applicable. - "cache_read_input_tokens": 0, # Optional. Input tokens read from a - prompt cache, if applicable. - "speed": "str" # Optional. Inference speed tier reflected in billing - or routing. Known values are: "standard" and "fast". - }, - "stop_sequence": "str" # Optional. When ``stop_reason`` is - ``stop_sequence``"" , the sequence that matched. - } - # response body for status code(s): 400 + # response body for status code(s): 200, 202 response == { - "error": { - "message": "str", # Human-readable error message. Required. - "type": "str" # Machine-readable error code. Required. + "created_at": "2020-02-20 00:00:00", # The timestamp when the request was + created. Required. + "model_id": "str", # The model ID that was invoked. Required. + "request_id": "str", # A unique identifier for the async invocation request. + Use this ID to check the status and retrieve the result. Required. + "status": "str", # The current status of the async invocation. Required. + Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". + "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the + job completed. Null until finished. + "error": "str", # Optional. Error message if the job failed. Null on + success. + "output": { + "str": {} # Optional. The output of the invocation. Null while the + job is queued or in progress. Contains the result once completed. }, - "type": "str" # Required. "error" + "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job + started processing. Null while queued. } """ @overload - async def create_messages( + async def create_async_invoke( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create the next assistant message. + """Generate Image, Audio, or Text-to-Speech Using fal Models. - Send a structured list of input messages with text and/or image content, and the model will - generate the next message in the conversation. + Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous + job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll + for the result. :param body: Required. :type body: IO[bytes] @@ -255303,51 +257769,38 @@ async def create_messages( Example: .. code-block:: python - # response body for status code(s): 200 - response == { - "content": [ - {} - ], - "id": "str", # Unique identifier for this message object. Required. - "model": "str", # Model that produced the message. Required. - "role": "str", # Always ``assistant`` for this response. Required. - "assistant" - "stop_reason": "str", # Why generation stopped. Required. Known values are: - "end_turn", "max_tokens", "stop_sequence", and "tool_use". - "type": "str", # Object type discriminator. Required. "message" - "usage": { - "input_tokens": 0, # Number of input tokens billed for this request. - Required. - "output_tokens": 0, # Number of output tokens generated. Required. - "cache_creation_input_tokens": 0, # Optional. Input tokens used to - create a prompt cache entry, if applicable. - "cache_read_input_tokens": 0, # Optional. Input tokens read from a - prompt cache, if applicable. - "speed": "str" # Optional. Inference speed tier reflected in billing - or routing. Known values are: "standard" and "fast". - }, - "stop_sequence": "str" # Optional. When ``stop_reason`` is - ``stop_sequence``"" , the sequence that matched. - } - # response body for status code(s): 400 + # response body for status code(s): 200, 202 response == { - "error": { - "message": "str", # Human-readable error message. Required. - "type": "str" # Machine-readable error code. Required. + "created_at": "2020-02-20 00:00:00", # The timestamp when the request was + created. Required. + "model_id": "str", # The model ID that was invoked. Required. + "request_id": "str", # A unique identifier for the async invocation request. + Use this ID to check the status and retrieve the result. Required. + "status": "str", # The current status of the async invocation. Required. + Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". + "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the + job completed. Null until finished. + "error": "str", # Optional. Error message if the job failed. Null on + success. + "output": { + "str": {} # Optional. The output of the invocation. Null while the + job is queued or in progress. Contains the result once completed. }, - "type": "str" # Required. "error" + "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job + started processing. Null while queued. } """ @distributed_trace_async - async def create_messages( + async def create_async_invoke( self, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create the next assistant message. + """Generate Image, Audio, or Text-to-Speech Using fal Models. - Send a structured list of input messages with text and/or image content, and the model will - generate the next message in the conversation. + Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous + job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll + for the result. :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] @@ -255360,87 +257813,53 @@ async def create_messages( # JSON input template you can fill out and use as your body input. body = { - "max_tokens": 0, # Maximum tokens to generate before stopping. Required. - "messages": [ - { - "content": {}, - "role": "str" # Speaker role for this message. Required. - Known values are: "user" and "assistant". - } - ], - "model": "str", # Model ID (for example ``claude-opus-4-6`` or a serverless - model id). Required. - "metadata": { - "user_id": "str" # Optional. Opaque identifier for the end user (for - example a UUID or hash). Do not include PII. - }, - "reasoning_effort": "str", # Optional. DigitalOcean extension for - reasoning-capable models. Ignored by executors that do not support it. Known - values are: "none", "minimal", "low", "medium", "high", and "xhigh". - "speed": "str", # Optional. DigitalOcean extension for preferred inference - speed. Ignored when not supported. Known values are: "standard" and "fast". - "stop_sequences": [ - "str" # Optional. Custom strings that stop generation when produced. - ], - "stream": False, # Optional. Default value is False. When true, the response - is streamed using server-sent events (SSE). - "system": {}, - "temperature": 0.0, # Optional. Sampling temperature between 0.0 and 1.0. - "thinking": { - "type": "str" # Thinking mode discriminator (for example enabled or - disabled). Required. + "input": { + "enable_safety_checker": bool, # Optional. Whether to enable the + safety checker for generated content. + "guidance_scale": 0.0, # Optional. Controls how closely the image + generation model follows the prompt. Higher values produce output more + closely matching the prompt. + "num_images": 0, # Optional. The number of images to generate. + "num_inference_steps": 0, # Optional. The number of inference steps + to use during image generation. More steps generally produce higher quality + output but take longer. + "output_format": "str", # Optional. The desired output format or + aspect ratio for image generation. + "prompt": "str", # Optional. The text prompt describing the desired + output. Used for image generation and audio generation models. + "seconds_total": 0, # Optional. The total duration in seconds for + generated audio. Used for audio generation models. + "text": "str" # Optional. The text content to convert to speech. + Used for text-to-speech models. }, - "tool_choice": {}, - "tools": [ + "model_id": "str", # The ID of the model to invoke asynchronously. Required. + "tags": [ { - "input_schema": { - "str": {} # JSON Schema (draft 2020-12 style) - describing the tool input object. Required. - }, - "name": "str", # Tool name referenced in ``tool_use`` - blocks. Required. - "description": "str" # Optional. Human-readable description - of what the tool does. + "key": "str", # The tag key. Required. + "value": "str" # The tag value. Required. } - ], - "top_k": 0, # Optional. Top-K sampling cutoff. - "top_p": 0.0 # Optional. Nucleus sampling; use either ``temperature`` or - ``top_p``"" , not both. + ] } - # response body for status code(s): 200 - response == { - "content": [ - {} - ], - "id": "str", # Unique identifier for this message object. Required. - "model": "str", # Model that produced the message. Required. - "role": "str", # Always ``assistant`` for this response. Required. - "assistant" - "stop_reason": "str", # Why generation stopped. Required. Known values are: - "end_turn", "max_tokens", "stop_sequence", and "tool_use". - "type": "str", # Object type discriminator. Required. "message" - "usage": { - "input_tokens": 0, # Number of input tokens billed for this request. - Required. - "output_tokens": 0, # Number of output tokens generated. Required. - "cache_creation_input_tokens": 0, # Optional. Input tokens used to - create a prompt cache entry, if applicable. - "cache_read_input_tokens": 0, # Optional. Input tokens read from a - prompt cache, if applicable. - "speed": "str" # Optional. Inference speed tier reflected in billing - or routing. Known values are: "standard" and "fast". - }, - "stop_sequence": "str" # Optional. When ``stop_reason`` is - ``stop_sequence``"" , the sequence that matched. - } - # response body for status code(s): 400 + # response body for status code(s): 200, 202 response == { - "error": { - "message": "str", # Human-readable error message. Required. - "type": "str" # Machine-readable error code. Required. + "created_at": "2020-02-20 00:00:00", # The timestamp when the request was + created. Required. + "model_id": "str", # The model ID that was invoked. Required. + "request_id": "str", # A unique identifier for the async invocation request. + Use this ID to check the status and retrieve the result. Required. + "status": "str", # The current status of the async invocation. Required. + Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". + "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the + job completed. Null until finished. + "error": "str", # Optional. Error message if the job failed. Null on + success. + "output": { + "str": {} # Optional. The output of the invocation. Null while the + job is queued or in progress. Contains the result once completed. }, - "type": "str" # Required. "error" + "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job + started processing. Null while queued. } """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -255472,7 +257891,7 @@ async def create_messages( else: _json = body - _request = build_inference_create_messages_request( + _request = build_inference_create_async_invoke_request( content_type=content_type, json=_json, content=_content, @@ -255490,7 +257909,7 @@ async def create_messages( response = pipeline_response.http_response - if response.status_code not in [200, 400]: + if response.status_code not in [200, 202]: 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 @@ -255513,7 +257932,7 @@ async def create_messages( else: deserialized = None - if response.status_code == 400: + if response.status_code == 202: response_headers["ratelimit-limit"] = self._deserialize( "int", response.headers.get("ratelimit-limit") ) @@ -255535,15 +257954,15 @@ async def create_messages( return cast(JSON, deserialized) # type: ignore @overload - async def create_embedding( + async def create_batch_file( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create embedding. + """Create a Batch Inference Input File. - Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. - Unknown fields in the request body are rejected. There is no streaming response for this - endpoint. + Creates a file record and returns a ``file_id`` plus a short-lived presigned ``PUT`` URL + (typically valid for ~15 minutes). Upload the raw JSONL bytes to ``upload_url`` (see ``PUT + /{upload_path}``\\ ) before calling ``POST /v1/batches``. :param body: Required. :type body: JSON @@ -255559,48 +257978,43 @@ async def create_embedding( # JSON input template you can fill out and use as your body input. body = { - "input": {}, - "model": "str", # Model id to use for embeddings. Must match a model your - account can access. Required. - "encoding_format": "float", # Optional. Default value is "float". How - embedding values are returned in each ``data[].embedding`` field. Known values - are: "float" and "base64". - "user": "str" # Optional. Optional end-user identifier to help with abuse - monitoring. + "file_name": "str" # The file you plan to upload. Must end with ``.jsonl`` + (case-insensitive) and contain one request per line in the schema expected by the + target ``provider``. Required. } - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "data": [ - { - "embedding": {}, - "index": 0, # Zero-based index of the corresponding - ``input`` item (0 when ``input`` is a string). Required. - "object": "str" # The object type, which is always - ``embedding``. Required. "embedding" - } - ], - "model": "str", # The embedding model that produced the vectors. Required. - "object": "str", # The object type, which is always the string ``list``. - Required. "list" - "usage": { - "prompt_tokens": 0, # Number of input tokens used for the embedding. - Required. - "total_tokens": 0 # Total billable tokens for the request. Required. - } + "file_id": "str", # Pass this value as ``file_id`` when creating a batch + job. Required. + "upload_url": "str", # Short-lived presigned ``PUT`` URL (typically valid + for ~15 minutes). If it expires before upload, create a new file intent. + Required. + "expires_at": "2020-02-20 00:00:00" # Optional. When ``upload_url`` expires. + } + # response body for status code(s): 400, 403, 422 + 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_embedding( + async def create_batch_file( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create embedding. + """Create a Batch Inference Input File. - Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. - Unknown fields in the request body are rejected. There is no streaming response for this - endpoint. + Creates a file record and returns a ``file_id`` plus a short-lived presigned ``PUT`` URL + (typically valid for ~15 minutes). Upload the raw JSONL bytes to ``upload_url`` (see ``PUT + /{upload_path}``\\ ) before calling ``POST /v1/batches``. :param body: Required. :type body: IO[bytes] @@ -255614,38 +258028,38 @@ async def create_embedding( Example: .. code-block:: python - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "data": [ - { - "embedding": {}, - "index": 0, # Zero-based index of the corresponding - ``input`` item (0 when ``input`` is a string). Required. - "object": "str" # The object type, which is always - ``embedding``. Required. "embedding" - } - ], - "model": "str", # The embedding model that produced the vectors. Required. - "object": "str", # The object type, which is always the string ``list``. - Required. "list" - "usage": { - "prompt_tokens": 0, # Number of input tokens used for the embedding. - Required. - "total_tokens": 0 # Total billable tokens for the request. Required. - } + "file_id": "str", # Pass this value as ``file_id`` when creating a batch + job. Required. + "upload_url": "str", # Short-lived presigned ``PUT`` URL (typically valid + for ~15 minutes). If it expires before upload, create a new file intent. + Required. + "expires_at": "2020-02-20 00:00:00" # Optional. When ``upload_url`` expires. + } + # response body for status code(s): 400, 403, 422 + 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_embedding( + async def create_batch_file( self, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create embedding. + """Create a Batch Inference Input File. - Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. - Unknown fields in the request body are rejected. There is no streaming response for this - endpoint. + Creates a file record and returns a ``file_id`` plus a short-lived presigned ``PUT`` URL + (typically valid for ~15 minutes). Upload the raw JSONL bytes to ``upload_url`` (see ``PUT + /{upload_path}``\\ ) before calling ``POST /v1/batches``. :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] @@ -255658,35 +258072,30 @@ async def create_embedding( # JSON input template you can fill out and use as your body input. body = { - "input": {}, - "model": "str", # Model id to use for embeddings. Must match a model your - account can access. Required. - "encoding_format": "float", # Optional. Default value is "float". How - embedding values are returned in each ``data[].embedding`` field. Known values - are: "float" and "base64". - "user": "str" # Optional. Optional end-user identifier to help with abuse - monitoring. + "file_name": "str" # The file you plan to upload. Must end with ``.jsonl`` + (case-insensitive) and contain one request per line in the schema expected by the + target ``provider``. Required. } - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "data": [ - { - "embedding": {}, - "index": 0, # Zero-based index of the corresponding - ``input`` item (0 when ``input`` is a string). Required. - "object": "str" # The object type, which is always - ``embedding``. Required. "embedding" - } - ], - "model": "str", # The embedding model that produced the vectors. Required. - "object": "str", # The object type, which is always the string ``list``. - Required. "list" - "usage": { - "prompt_tokens": 0, # Number of input tokens used for the embedding. - Required. - "total_tokens": 0 # Total billable tokens for the request. Required. - } + "file_id": "str", # Pass this value as ``file_id`` when creating a batch + job. Required. + "upload_url": "str", # Short-lived presigned ``PUT`` URL (typically valid + for ~15 minutes). If it expires before upload, create a new file intent. + Required. + "expires_at": "2020-02-20 00:00:00" # Optional. When ``upload_url`` expires. + } + # response body for status code(s): 400, 403, 422 + 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]] = { @@ -255718,7 +258127,7 @@ async def create_embedding( else: _json = body - _request = build_inference_create_embedding_request( + _request = build_inference_create_batch_file_request( content_type=content_type, json=_json, content=_content, @@ -255736,265 +258145,104 @@ async def create_embedding( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [201, 400, 403, 422]: 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 = {} - 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_image( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Generate images from text prompts. - - Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation - model with automatic prompt optimization and enhanced visual capabilities. - - :param body: Required. - :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 = { - "model": "str", # The model to use for image generation. Required. - "n": 0, # The number of images to generate. Must be between 1 and 10. - Required. - "prompt": "str", # A text description of the desired image(s). Supports up - to 32,000 characters and provides automatic prompt optimization for best results. - Required. - "background": "str", # Optional. The background setting for the image - generation. Supported values: transparent, opaque, auto. - "moderation": "str", # Optional. The moderation setting for the image - generation. Supported values: low, auto. - "output_compression": 0, # Optional. The output compression level for the - image generation (0-100). - "output_format": "str", # Optional. The output format for the image - generation. Supported values: png, webp, jpeg. - "partial_images": 0, # Optional. The number of partial image chunks to - return during streaming generation. Defaults to 0. When stream=true, this must be - greater than 0 to receive progressive updates of the image as it is being - generated. - "quality": "str", # Optional. The quality of the image that will be - generated. Supported values: auto, high, medium, low. - "size": "str", # Optional. The size of the generated images. GPT-IMAGE-1 - supports: auto (automatically select best size), 1536x1024 (landscape), 1024x1536 - (portrait). Known values are: "auto", "1536x1024", and "1024x1536". - "stream": False, # Optional. Default value is False. If set to true, partial - image data will be streamed as the image is being generated. The response will be - sent as server-sent events with partial image chunks. When stream is true, - partial_images must be greater than 0. - "user": "str" # Optional. A unique identifier representing your end-user, - which can help DigitalOcean to monitor and detect abuse. - } - - # response body for status code(s): 200 - response == { - "created": 0, # The Unix timestamp (in seconds) of when the images were - created. Required. - "data": [ - { - "b64_json": "str", # The base64-encoded JSON of the - generated image. Required. - "revised_prompt": "str" # Optional. The optimized prompt - that was used to generate the image. - } - ], - "background": "str", # Optional. The background setting used for the image - generation. - "output_format": "str", # Optional. The output format of the generated - image. - "quality": "str", # Optional. The quality setting used for the image - generation. - "size": "str", # Optional. The size of the generated image. - "usage": { - "input_tokens": 0, # The number of tokens (images and text) in the - input prompt. Required. - "input_tokens_details": { - "image_tokens": 0, # The number of image tokens in the input - prompt. Required. - "text_tokens": 0 # The number of text tokens in the input - prompt. Required. - }, - "output_tokens": 0, # The number of image tokens in the output - image. Required. - "total_tokens": 0 # The total number of tokens (images and text) - used for the image generation. Required. - } - } - """ - - @overload - async def create_image( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Generate images from text prompts. - - Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation - model with automatic prompt optimization and enhanced visual capabilities. - - :param body: Required. - :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 response.status_code == 201: + 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") + ) - Example: - .. code-block:: python + if response.content: + deserialized = response.json() + else: + deserialized = None - # response body for status code(s): 200 - response == { - "created": 0, # The Unix timestamp (in seconds) of when the images were - created. Required. - "data": [ - { - "b64_json": "str", # The base64-encoded JSON of the - generated image. Required. - "revised_prompt": "str" # Optional. The optimized prompt - that was used to generate the image. - } - ], - "background": "str", # Optional. The background setting used for the image - generation. - "output_format": "str", # Optional. The output format of the generated - image. - "quality": "str", # Optional. The quality setting used for the image - generation. - "size": "str", # Optional. The size of the generated image. - "usage": { - "input_tokens": 0, # The number of tokens (images and text) in the - input prompt. Required. - "input_tokens_details": { - "image_tokens": 0, # The number of image tokens in the input - prompt. Required. - "text_tokens": 0 # The number of text tokens in the input - prompt. Required. - }, - "output_tokens": 0, # The number of image tokens in the output - image. Required. - "total_tokens": 0 # The total number of tokens (images and text) - used for the image generation. Required. - } - } - """ + if response.status_code == 400: + 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") + ) - @distributed_trace_async - async def create_image(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: - # pylint: disable=line-too-long - """Generate images from text prompts. + if response.content: + deserialized = response.json() + else: + deserialized = None - Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation - model with automatic prompt optimization and enhanced visual capabilities. + if response.status_code == 403: + 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") + ) - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: + if response.content: + deserialized = response.json() + else: + deserialized = None - Example: - .. code-block:: python + if response.status_code == 422: + 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") + ) - # JSON input template you can fill out and use as your body input. - body = { - "model": "str", # The model to use for image generation. Required. - "n": 0, # The number of images to generate. Must be between 1 and 10. - Required. - "prompt": "str", # A text description of the desired image(s). Supports up - to 32,000 characters and provides automatic prompt optimization for best results. - Required. - "background": "str", # Optional. The background setting for the image - generation. Supported values: transparent, opaque, auto. - "moderation": "str", # Optional. The moderation setting for the image - generation. Supported values: low, auto. - "output_compression": 0, # Optional. The output compression level for the - image generation (0-100). - "output_format": "str", # Optional. The output format for the image - generation. Supported values: png, webp, jpeg. - "partial_images": 0, # Optional. The number of partial image chunks to - return during streaming generation. Defaults to 0. When stream=true, this must be - greater than 0 to receive progressive updates of the image as it is being - generated. - "quality": "str", # Optional. The quality of the image that will be - generated. Supported values: auto, high, medium, low. - "size": "str", # Optional. The size of the generated images. GPT-IMAGE-1 - supports: auto (automatically select best size), 1536x1024 (landscape), 1024x1536 - (portrait). Known values are: "auto", "1536x1024", and "1024x1536". - "stream": False, # Optional. Default value is False. If set to true, partial - image data will be streamed as the image is being generated. The response will be - sent as server-sent events with partial image chunks. When stream is true, - partial_images must be greater than 0. - "user": "str" # Optional. A unique identifier representing your end-user, - which can help DigitalOcean to monitor and detect abuse. - } + if response.content: + deserialized = response.json() + else: + deserialized = None - # response body for status code(s): 200 - response == { - "created": 0, # The Unix timestamp (in seconds) of when the images were - created. Required. - "data": [ - { - "b64_json": "str", # The base64-encoded JSON of the - generated image. Required. - "revised_prompt": "str" # Optional. The optimized prompt - that was used to generate the image. - } - ], - "background": "str", # Optional. The background setting used for the image - generation. - "output_format": "str", # Optional. The output format of the generated - image. - "quality": "str", # Optional. The quality setting used for the image - generation. - "size": "str", # Optional. The size of the generated image. - "usage": { - "input_tokens": 0, # The number of tokens (images and text) in the - input prompt. Required. - "input_tokens_details": { - "image_tokens": 0, # The number of image tokens in the input - prompt. Required. - "text_tokens": 0 # The number of text tokens in the input - prompt. Required. - }, - "output_tokens": 0, # The number of image tokens in the output - image. Required. - "total_tokens": 0 # The total number of tokens (images and text) - used for the image generation. Required. - } - } + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def upload_batch_file( # pylint: disable=inconsistent-return-statements + self, data: IO[bytes], **kwargs: Any + ) -> None: + """Upload a Batch Inference Input File. + + Uploads the raw JSONL bytes to the presigned ``upload_url`` returned by ``POST + /v1/batches/files``. + + **The URL is dynamic — do not construct it.** Use the ``upload_url`` value from the previous + step verbatim. Its host, path, and query parameters are part of the short-lived (~15 minute) + signature and change per request; the server and path shown here are illustrative. If the URL + expires before the upload completes, create a new file intent and retry. + + ``POST /v1/batches`` performs a ``HEAD`` check on the uploaded object and will reject the batch + if this upload has not completed. + + :param data: Raw JSONL bytes — one request per line. Required. + :type data: IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, @@ -256012,22 +258260,15 @@ async def create_image(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSO _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) + content_type: str = kwargs.pop( + "content_type", _headers.pop("Content-Type", "application/octet-stream") ) - cls: ClsType[JSON] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = body + _content = data - _request = build_inference_create_image_request( + _request = build_inference_upload_batch_file_request( content_type=content_type, - json=_json, content=_content, headers=_headers, params=_params, @@ -256043,40 +258284,53 @@ async def create_image(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSO response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 403]: 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 = {} - 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.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 == 403: + 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 cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async - async def list_models(self, **kwargs: Any) -> JSON: - """List available models. + async def list_batches( + self, *, after: Optional[str] = None, limit: int = 20, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List Batch Inference Jobs. - Lists the currently available models, and provides basic information about each one such as the - owner and availability. + Returns a cursor-paginated list of batch jobs, ordered newest first. Use ``limit`` to control + page size and ``after`` to page forward using the ``last_id`` from the previous response. + :keyword after: Cursor for pagination. Pass the ``last_id`` value from the previous response to + fetch the next page. Omit for the first page. Default value is None. + :paramtype after: str + :keyword limit: Maximum number of batches to return per page. Default value is 20. + :paramtype limit: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -256088,17 +258342,78 @@ async def list_models(self, **kwargs: Any) -> JSON: response == { "data": [ { - "created": 0, # The Unix timestamp (in seconds) when the - model was created. Required. - "id": "str", # The model identifier, which can be referenced - in the API endpoints. Required. - "object": "str", # The object type, which is always "model". - Required. "model" - "owned_by": "str" # The organization that owns the model. + "batch_id": "str", # Unique identifier for the batch job. Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is + dispatched to. Required. + "input_file_id": "str", # The uploaded JSONL input file. + Required. + "provider": "str", # Required. Known values are: "openai" + and "anthropic". + "status": "str", # Lifecycle status. Terminal states: + ``completed``"" , ``failed``"" , ``expired``"" , ``cancelled``. Required. + Known values are: "validating", "in_progress", "finalizing", "completed", + "failed", "expired", "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. Batch + jobs on this page, ordered newest first. Required. + "completed_at": "2020-02-20 00:00:00", # Optional. Batch + jobs on this page, ordered newest first. Required. + "error_file_id": "str", # Optional. Error sidecar file. Null + when no errors were produced. + "errors": [ + { + "code": "str", # Optional. Top-level errors + that prevented the batch from completing. + "line": 0, # Optional. 1-based JSONL line + number, if applicable. + "message": "str" # Optional. Top-level + errors that prevented the batch from completing. + } + ], + "expires_at": "2020-02-20 00:00:00", # Optional. Derived + from ``created_at`` plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. Batch jobs + on this page, ordered newest first. Required. + "finalizing_at": "2020-02-20 00:00:00", # Optional. Batch + jobs on this page, ordered newest first. Required. + "in_progress_at": "2020-02-20 00:00:00", # Optional. Batch + jobs on this page, ordered newest first. Required. + "metadata": { + "str": "str" # Optional. Metadata attached at + creation. + }, + "output_file_id": "str", # Optional. Output JSONL file. + Populated once the job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request + counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied + at creation. } ], - "object": "str" # The object type, which is always "list". Required. "list" + "has_more": bool, # Whether additional batches exist beyond this page. + Required. + "object": "str", # The object type, always ``list``. Required. "list" + "first_id": "str", # Optional. ID of the first batch on this page. Null when + the page is empty. + "last_id": "str" # Optional. ID of the last batch on this page. Pass as + ``after`` to fetch the next page. + } + # response body for status code(s): 403 + 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]] = { @@ -256119,7 +258434,9 @@ async def list_models(self, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_inference_list_models_request( + _request = build_inference_list_batches_request( + after=after, + limit=limit, headers=_headers, params=_params, ) @@ -256134,27 +258451,44 @@ async def list_models(self, **kwargs: Any) -> JSON: response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 403]: 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 = {} - 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.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.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 403: + 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 @@ -256162,14 +258496,18 @@ async def list_models(self, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @overload - async def create_response( + async def create_batch( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Send Prompt to a Model Using the Responses API. + """Create a Batch Inference Job. - Generate text responses from text prompts. This endpoint supports both streaming and - non-streaming responses for supported text models. + Submits a batch job against a previously uploaded JSONL input file. The upload must have + completed before this call; otherwise the request is rejected. + + Supply a unique ``request_id`` to make the submission idempotent — retries with the same value + return the existing job. When ``provider`` is ``openai``\\ , the ``url`` on each JSONL line + must match ``endpoint``. :param body: Required. :type body: JSON @@ -256185,129 +258523,98 @@ async def create_response( # JSON input template you can fill out and use as your body input. body = { - "input": {}, - "model": "str", # The model ID of the model you want to use. Get the model - ID using ``/v1/models`` or on the available models page. Required. - "instructions": "str", # Optional. System-level instructions for the model. - This sets the behavior and context for the response generation. - "max_output_tokens": 0, # Optional. The maximum number of tokens to generate - in the response. + "endpoint": "str", # Inference endpoint each request is dispatched to. When + ``provider`` is ``openai``"" , must match the ``url`` on every JSONL line. + Required. Known values are: "/v1/chat/completions", "/v1/embeddings", and + "/v1/messages". + "file_id": "str", # The ``file_id`` returned by ``POST /v1/batches/files``. + Required. + "provider": "str", # The inference provider whose JSONL schema the input + file conforms to. ``openai`` follows the OpenAI Batch API input schema ("" + ``custom_id``"" , ``method``"" , ``url``"" , ``body``"" ); ``anthropic`` follows + the Anthropic Message Batches JSONL conventions. Required. Known values are: + "openai" and "anthropic". + "request_id": "str", # Client-supplied idempotency key. Retries with the + same value return the existing job. Required. + "completion_window": "24h", # Optional. Default value is "24h". Time window + in which the job must complete. Jobs that do not finish in time transition to + ``expired``. "24h" "metadata": { - "str": "str" # Optional. Set of key-value pairs that can be attached - to the request. - }, - "stop": {}, - "stream": False, # Optional. Default value is False. Set to true to stream - partial responses as Server-Sent Events. - "stream_options": { - "include_usage": bool # Optional. If set, an additional chunk will - be streamed before the data: [DONE] message with token usage statistics for - the entire request. - }, - "temperature": 0.0, # Optional. A value between 0.0 and 2.0 to control - randomness and creativity. Lower values like 0.2 make the output more focused and - deterministic, while higher values like 0.8 make it more random. - "tool_choice": {}, - "tools": [ - { - "type": "str", # The type of the tool. Required. "function" - "description": "str", # Optional. A description of what the - function does. - "name": "str", # Optional. The name of the function to be - called. - "parameters": { - "str": {} # Optional. The parameters the function - accepts, described as a JSON Schema object. - } - } - ], - "top_p": 0.0, # Optional. An alternative to sampling with temperature, - called nucleus sampling, where the model considers the results of the tokens with - top_p probability mass. - "user": "str" # Optional. A unique identifier representing your end-user. + "str": "str" # Optional. Optional string-valued metadata to attach + to the job. + } } - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "created": 0, # The Unix timestamp (in seconds) of when the response was - created. Required. - "id": "str", # A unique identifier for the response. Required. - "model": "str", # The model used to generate the response. Required. - "object": "str", # The object type, which is always ``response``. Required. - "response" - "output": [ + "batch_id": "str", # Unique identifier for the batch job. Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is dispatched to. + Required. + "input_file_id": "str", # The uploaded JSONL input file. Required. + "provider": "str", # Required. Known values are: "openai" and "anthropic". + "status": "str", # Lifecycle status. Terminal states: ``completed``"" , + ``failed``"" , ``expired``"" , ``cancelled``. Required. Known values are: + "validating", "in_progress", "finalizing", "completed", "failed", "expired", + "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. + "completed_at": "2020-02-20 00:00:00", # Optional. + "error_file_id": "str", # Optional. Error sidecar file. Null when no errors + were produced. + "errors": [ { - "content": [ - { - "text": "str", # The text content. Required. - "type": "str" # The type of content part. - ``reasoning_text`` for reasoning content, ``output_text`` for - final output text. Required. Known values are: "reasoning_text" - and "output_text". - } - ], - "type": "str", # The type of output item. One of - ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known - values are: "reasoning", "message", and "function_call". - "arguments": "str", # Optional. JSON string of function - arguments (present when type is ``function_call``"" ). - "call_id": "str", # Optional. The unique ID of the function - tool call (present when type is ``function_call``"" ). - "id": "str", # Optional. The unique ID of the output item. - "name": "str", # Optional. The name of the function to call - (present when type is ``function_call``"" ). - "role": "str", # Optional. The role associated with this - output item (typically ``assistant``"" ). - "status": "str" # Optional. Status of the item. + "code": "str", # Optional. Top-level errors that prevented + the batch from completing. + "line": 0, # Optional. 1-based JSONL line number, if + applicable. + "message": "str" # Optional. Top-level errors that prevented + the batch from completing. } ], - "usage": { - "input_tokens": 0, # The number of input tokens. Required. - "input_tokens_details": { - "cached_tokens": 0 # The number of tokens that were - retrieved from the cache. Required. - }, - "output_tokens": 0, # The number of output tokens. Required. - "output_tokens_details": { - "reasoning_tokens": 0, # The number of reasoning tokens. - Required. - "tool_output_tokens": 0 # The number of tool output tokens. - Required. - }, - "total_tokens": 0 # The total number of tokens used. Required. + "expires_at": "2020-02-20 00:00:00", # Optional. Derived from ``created_at`` + plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. + "finalizing_at": "2020-02-20 00:00:00", # Optional. + "in_progress_at": "2020-02-20 00:00:00", # Optional. + "metadata": { + "str": "str" # Optional. Metadata attached at creation. }, - "max_output_tokens": 0, # Optional. Maximum output tokens setting. - "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are - enabled. - "status": "str", # Optional. Status of the response. - "temperature": 0.0, # Optional. Temperature setting used for the response. - "tool_choice": "str", # Optional. Tool choice setting used for the response. - "tools": [ - { - "type": "str", # The type of the tool. Required. "function" - "description": "str", # Optional. A description of what the - function does. - "name": "str", # Optional. The name of the function. - "parameters": { - "str": {} # Optional. The parameters the function - accepts. - } - } - ], - "top_p": 0.0, # Optional. Top-p setting used for the response. - "user": "str" # Optional. User identifier. + "output_file_id": "str", # Optional. Output JSONL file. Populated once the + job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied at creation. + } + # response body for status code(s): 400, 403, 404, 409, 422 + 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_response( + async def create_batch( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Send Prompt to a Model Using the Responses API. + """Create a Batch Inference Job. - Generate text responses from text prompts. This endpoint supports both streaming and - non-streaming responses for supported text models. + Submits a batch job against a previously uploaded JSONL input file. The upload must have + completed before this call; otherwise the request is rejected. + + Supply a unique ``request_id`` to make the submission idempotent — retries with the same value + return the existing job. When ``provider`` is ``openai``\\ , the ``url`` on each JSONL line + must match ``endpoint``. :param body: Required. :type body: IO[bytes] @@ -256321,87 +258628,74 @@ async def create_response( Example: .. code-block:: python - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "created": 0, # The Unix timestamp (in seconds) of when the response was - created. Required. - "id": "str", # A unique identifier for the response. Required. - "model": "str", # The model used to generate the response. Required. - "object": "str", # The object type, which is always ``response``. Required. - "response" - "output": [ + "batch_id": "str", # Unique identifier for the batch job. Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is dispatched to. + Required. + "input_file_id": "str", # The uploaded JSONL input file. Required. + "provider": "str", # Required. Known values are: "openai" and "anthropic". + "status": "str", # Lifecycle status. Terminal states: ``completed``"" , + ``failed``"" , ``expired``"" , ``cancelled``. Required. Known values are: + "validating", "in_progress", "finalizing", "completed", "failed", "expired", + "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. + "completed_at": "2020-02-20 00:00:00", # Optional. + "error_file_id": "str", # Optional. Error sidecar file. Null when no errors + were produced. + "errors": [ { - "content": [ - { - "text": "str", # The text content. Required. - "type": "str" # The type of content part. - ``reasoning_text`` for reasoning content, ``output_text`` for - final output text. Required. Known values are: "reasoning_text" - and "output_text". - } - ], - "type": "str", # The type of output item. One of - ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known - values are: "reasoning", "message", and "function_call". - "arguments": "str", # Optional. JSON string of function - arguments (present when type is ``function_call``"" ). - "call_id": "str", # Optional. The unique ID of the function - tool call (present when type is ``function_call``"" ). - "id": "str", # Optional. The unique ID of the output item. - "name": "str", # Optional. The name of the function to call - (present when type is ``function_call``"" ). - "role": "str", # Optional. The role associated with this - output item (typically ``assistant``"" ). - "status": "str" # Optional. Status of the item. + "code": "str", # Optional. Top-level errors that prevented + the batch from completing. + "line": 0, # Optional. 1-based JSONL line number, if + applicable. + "message": "str" # Optional. Top-level errors that prevented + the batch from completing. } ], - "usage": { - "input_tokens": 0, # The number of input tokens. Required. - "input_tokens_details": { - "cached_tokens": 0 # The number of tokens that were - retrieved from the cache. Required. - }, - "output_tokens": 0, # The number of output tokens. Required. - "output_tokens_details": { - "reasoning_tokens": 0, # The number of reasoning tokens. - Required. - "tool_output_tokens": 0 # The number of tool output tokens. - Required. - }, - "total_tokens": 0 # The total number of tokens used. Required. + "expires_at": "2020-02-20 00:00:00", # Optional. Derived from ``created_at`` + plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. + "finalizing_at": "2020-02-20 00:00:00", # Optional. + "in_progress_at": "2020-02-20 00:00:00", # Optional. + "metadata": { + "str": "str" # Optional. Metadata attached at creation. }, - "max_output_tokens": 0, # Optional. Maximum output tokens setting. - "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are - enabled. - "status": "str", # Optional. Status of the response. - "temperature": 0.0, # Optional. Temperature setting used for the response. - "tool_choice": "str", # Optional. Tool choice setting used for the response. - "tools": [ - { - "type": "str", # The type of the tool. Required. "function" - "description": "str", # Optional. A description of what the - function does. - "name": "str", # Optional. The name of the function. - "parameters": { - "str": {} # Optional. The parameters the function - accepts. - } - } - ], - "top_p": 0.0, # Optional. Top-p setting used for the response. - "user": "str" # Optional. User identifier. + "output_file_id": "str", # Optional. Output JSONL file. Populated once the + job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied at creation. + } + # response body for status code(s): 400, 403, 404, 409, 422 + 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_response( - self, body: Union[JSON, IO[bytes]], **kwargs: Any - ) -> JSON: + async def create_batch(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Send Prompt to a Model Using the Responses API. + """Create a Batch Inference Job. - Generate text responses from text prompts. This endpoint supports both streaming and - non-streaming responses for supported text models. + Submits a batch job against a previously uploaded JSONL input file. The upload must have + completed before this call; otherwise the request is rejected. + + Supply a unique ``request_id`` to make the submission idempotent — retries with the same value + return the existing job. When ``provider`` is ``openai``\\ , the ``url`` on each JSONL line + must match ``endpoint``. :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] @@ -256414,117 +258708,82 @@ async def create_response( # JSON input template you can fill out and use as your body input. body = { - "input": {}, - "model": "str", # The model ID of the model you want to use. Get the model - ID using ``/v1/models`` or on the available models page. Required. - "instructions": "str", # Optional. System-level instructions for the model. - This sets the behavior and context for the response generation. - "max_output_tokens": 0, # Optional. The maximum number of tokens to generate - in the response. + "endpoint": "str", # Inference endpoint each request is dispatched to. When + ``provider`` is ``openai``"" , must match the ``url`` on every JSONL line. + Required. Known values are: "/v1/chat/completions", "/v1/embeddings", and + "/v1/messages". + "file_id": "str", # The ``file_id`` returned by ``POST /v1/batches/files``. + Required. + "provider": "str", # The inference provider whose JSONL schema the input + file conforms to. ``openai`` follows the OpenAI Batch API input schema ("" + ``custom_id``"" , ``method``"" , ``url``"" , ``body``"" ); ``anthropic`` follows + the Anthropic Message Batches JSONL conventions. Required. Known values are: + "openai" and "anthropic". + "request_id": "str", # Client-supplied idempotency key. Retries with the + same value return the existing job. Required. + "completion_window": "24h", # Optional. Default value is "24h". Time window + in which the job must complete. Jobs that do not finish in time transition to + ``expired``. "24h" "metadata": { - "str": "str" # Optional. Set of key-value pairs that can be attached - to the request. - }, - "stop": {}, - "stream": False, # Optional. Default value is False. Set to true to stream - partial responses as Server-Sent Events. - "stream_options": { - "include_usage": bool # Optional. If set, an additional chunk will - be streamed before the data: [DONE] message with token usage statistics for - the entire request. - }, - "temperature": 0.0, # Optional. A value between 0.0 and 2.0 to control - randomness and creativity. Lower values like 0.2 make the output more focused and - deterministic, while higher values like 0.8 make it more random. - "tool_choice": {}, - "tools": [ - { - "type": "str", # The type of the tool. Required. "function" - "description": "str", # Optional. A description of what the - function does. - "name": "str", # Optional. The name of the function to be - called. - "parameters": { - "str": {} # Optional. The parameters the function - accepts, described as a JSON Schema object. - } - } - ], - "top_p": 0.0, # Optional. An alternative to sampling with temperature, - called nucleus sampling, where the model considers the results of the tokens with - top_p probability mass. - "user": "str" # Optional. A unique identifier representing your end-user. + "str": "str" # Optional. Optional string-valued metadata to attach + to the job. + } } - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "created": 0, # The Unix timestamp (in seconds) of when the response was - created. Required. - "id": "str", # A unique identifier for the response. Required. - "model": "str", # The model used to generate the response. Required. - "object": "str", # The object type, which is always ``response``. Required. - "response" - "output": [ + "batch_id": "str", # Unique identifier for the batch job. Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is dispatched to. + Required. + "input_file_id": "str", # The uploaded JSONL input file. Required. + "provider": "str", # Required. Known values are: "openai" and "anthropic". + "status": "str", # Lifecycle status. Terminal states: ``completed``"" , + ``failed``"" , ``expired``"" , ``cancelled``. Required. Known values are: + "validating", "in_progress", "finalizing", "completed", "failed", "expired", + "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. + "completed_at": "2020-02-20 00:00:00", # Optional. + "error_file_id": "str", # Optional. Error sidecar file. Null when no errors + were produced. + "errors": [ { - "content": [ - { - "text": "str", # The text content. Required. - "type": "str" # The type of content part. - ``reasoning_text`` for reasoning content, ``output_text`` for - final output text. Required. Known values are: "reasoning_text" - and "output_text". - } - ], - "type": "str", # The type of output item. One of - ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known - values are: "reasoning", "message", and "function_call". - "arguments": "str", # Optional. JSON string of function - arguments (present when type is ``function_call``"" ). - "call_id": "str", # Optional. The unique ID of the function - tool call (present when type is ``function_call``"" ). - "id": "str", # Optional. The unique ID of the output item. - "name": "str", # Optional. The name of the function to call - (present when type is ``function_call``"" ). - "role": "str", # Optional. The role associated with this - output item (typically ``assistant``"" ). - "status": "str" # Optional. Status of the item. + "code": "str", # Optional. Top-level errors that prevented + the batch from completing. + "line": 0, # Optional. 1-based JSONL line number, if + applicable. + "message": "str" # Optional. Top-level errors that prevented + the batch from completing. } ], - "usage": { - "input_tokens": 0, # The number of input tokens. Required. - "input_tokens_details": { - "cached_tokens": 0 # The number of tokens that were - retrieved from the cache. Required. - }, - "output_tokens": 0, # The number of output tokens. Required. - "output_tokens_details": { - "reasoning_tokens": 0, # The number of reasoning tokens. - Required. - "tool_output_tokens": 0 # The number of tool output tokens. - Required. - }, - "total_tokens": 0 # The total number of tokens used. Required. + "expires_at": "2020-02-20 00:00:00", # Optional. Derived from ``created_at`` + plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. + "finalizing_at": "2020-02-20 00:00:00", # Optional. + "in_progress_at": "2020-02-20 00:00:00", # Optional. + "metadata": { + "str": "str" # Optional. Metadata attached at creation. }, - "max_output_tokens": 0, # Optional. Maximum output tokens setting. - "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are - enabled. - "status": "str", # Optional. Status of the response. - "temperature": 0.0, # Optional. Temperature setting used for the response. - "tool_choice": "str", # Optional. Tool choice setting used for the response. - "tools": [ - { - "type": "str", # The type of the tool. Required. "function" - "description": "str", # Optional. A description of what the - function does. - "name": "str", # Optional. The name of the function. - "parameters": { - "str": {} # Optional. The parameters the function - accepts. - } - } - ], - "top_p": 0.0, # Optional. Top-p setting used for the response. - "user": "str" # Optional. User identifier. + "output_file_id": "str", # Optional. Output JSONL file. Populated once the + job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied at creation. + } + # response body for status code(s): 400, 403, 404, 409, 422 + 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]] = { @@ -256556,7 +258815,7 @@ async def create_response( else: _json = body - _request = build_inference_create_response_request( + _request = build_inference_create_batch_request( content_type=content_type, json=_json, content=_content, @@ -256574,49 +258833,124 @@ async def create_response( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [201, 400, 403, 404, 409, 422]: 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 = {} - 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.status_code == 201: + 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.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 400: + 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 == 403: + 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 response.status_code == 409: + 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 == 422: + 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_async_invoke( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: + @distributed_trace_async + async def get_batch(self, batch_id: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Generate Image, Audio, or Text-to-Speech Using fal Models. + """Retrieve a Batch Inference Job. - Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous - job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll - for the result. + Returns the current state of a batch job. Poll until ``status`` reaches a terminal value (\\ + ``completed``\\ , ``failed``\\ , ``expired``\\ , or ``cancelled``\\ ). - :param body: Required. - :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 batch_id: The batch job identifier. Required. + :type batch_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -256624,74 +258958,171 @@ async def create_async_invoke( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "input": { - "enable_safety_checker": bool, # Optional. Whether to enable the - safety checker for generated content. - "guidance_scale": 0.0, # Optional. Controls how closely the image - generation model follows the prompt. Higher values produce output more - closely matching the prompt. - "num_images": 0, # Optional. The number of images to generate. - "num_inference_steps": 0, # Optional. The number of inference steps - to use during image generation. More steps generally produce higher quality - output but take longer. - "output_format": "str", # Optional. The desired output format or - aspect ratio for image generation. - "prompt": "str", # Optional. The text prompt describing the desired - output. Used for image generation and audio generation models. - "seconds_total": 0, # Optional. The total duration in seconds for - generated audio. Used for audio generation models. - "text": "str" # Optional. The text content to convert to speech. - Used for text-to-speech models. - }, - "model_id": "str", # The ID of the model to invoke asynchronously. Required. - "tags": [ + # response body for status code(s): 200 + response == { + "batch_id": "str", # Unique identifier for the batch job. Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is dispatched to. + Required. + "input_file_id": "str", # The uploaded JSONL input file. Required. + "provider": "str", # Required. Known values are: "openai" and "anthropic". + "status": "str", # Lifecycle status. Terminal states: ``completed``"" , + ``failed``"" , ``expired``"" , ``cancelled``. Required. Known values are: + "validating", "in_progress", "finalizing", "completed", "failed", "expired", + "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. + "completed_at": "2020-02-20 00:00:00", # Optional. + "error_file_id": "str", # Optional. Error sidecar file. Null when no errors + were produced. + "errors": [ { - "key": "str", # The tag key. Required. - "value": "str" # The tag value. Required. + "code": "str", # Optional. Top-level errors that prevented + the batch from completing. + "line": 0, # Optional. 1-based JSONL line number, if + applicable. + "message": "str" # Optional. Top-level errors that prevented + the batch from completing. } - ] + ], + "expires_at": "2020-02-20 00:00:00", # Optional. Derived from ``created_at`` + plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. + "finalizing_at": "2020-02-20 00:00:00", # Optional. + "in_progress_at": "2020-02-20 00:00:00", # Optional. + "metadata": { + "str": "str" # Optional. Metadata attached at creation. + }, + "output_file_id": "str", # Optional. Output JSONL file. Populated once the + job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied at creation. } - - # response body for status code(s): 200, 202 + # response body for status code(s): 403, 404 response == { - "created_at": "2020-02-20 00:00:00", # The timestamp when the request was - created. Required. - "model_id": "str", # The model ID that was invoked. Required. - "request_id": "str", # A unique identifier for the async invocation request. - Use this ID to check the status and retrieve the result. Required. - "status": "str", # The current status of the async invocation. Required. - Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". - "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the - job completed. Null until finished. - "error": "str", # Optional. Error message if the job failed. Null on - success. - "output": { - "str": {} # Optional. The output of the invocation. Null while the - job is queued or in progress. Contains the result once completed. - }, - "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job - started processing. Null while queued. + "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 {}) - @overload - async def create_async_invoke( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_inference_get_batch_request( + batch_id=batch_id, + 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, 403, 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 == 403: + 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_batch(self, batch_id: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Generate Image, Audio, or Text-to-Speech Using fal Models. + """Cancel a Batch Inference Job. - Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous - job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll - for the result. + Requests cancellation of a batch job. The job transitions to ``cancelling`` and, once in-flight + requests drain, to ``cancelled``. Jobs already in a terminal state (\\ ``completed``\\ , + ``failed``\\ , ``expired``\\ , ``cancelled``\\ ) cannot be cancelled and return ``409 + Conflict``. - :param body: Required. - :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 + Partial results produced before cancellation remain available via ``GET + /v1/batches/{batch_id}/results``. + + :param batch_id: The batch job identifier. Required. + :type batch_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -256699,41 +259130,184 @@ async def create_async_invoke( Example: .. code-block:: python - # response body for status code(s): 200, 202 + # response body for status code(s): 200 response == { - "created_at": "2020-02-20 00:00:00", # The timestamp when the request was - created. Required. - "model_id": "str", # The model ID that was invoked. Required. - "request_id": "str", # A unique identifier for the async invocation request. - Use this ID to check the status and retrieve the result. Required. - "status": "str", # The current status of the async invocation. Required. - Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". - "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the - job completed. Null until finished. - "error": "str", # Optional. Error message if the job failed. Null on - success. - "output": { - "str": {} # Optional. The output of the invocation. Null while the - job is queued or in progress. Contains the result once completed. + "batch_id": "str", # Unique identifier for the batch job. Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is dispatched to. + Required. + "input_file_id": "str", # The uploaded JSONL input file. Required. + "provider": "str", # Required. Known values are: "openai" and "anthropic". + "status": "str", # Lifecycle status. Terminal states: ``completed``"" , + ``failed``"" , ``expired``"" , ``cancelled``. Required. Known values are: + "validating", "in_progress", "finalizing", "completed", "failed", "expired", + "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. + "completed_at": "2020-02-20 00:00:00", # Optional. + "error_file_id": "str", # Optional. Error sidecar file. Null when no errors + were produced. + "errors": [ + { + "code": "str", # Optional. Top-level errors that prevented + the batch from completing. + "line": 0, # Optional. 1-based JSONL line number, if + applicable. + "message": "str" # Optional. Top-level errors that prevented + the batch from completing. + } + ], + "expires_at": "2020-02-20 00:00:00", # Optional. Derived from ``created_at`` + plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. + "finalizing_at": "2020-02-20 00:00:00", # Optional. + "in_progress_at": "2020-02-20 00:00:00", # Optional. + "metadata": { + "str": "str" # Optional. Metadata attached at creation. }, - "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job - started processing. Null while queued. + "output_file_id": "str", # Optional. Output JSONL file. Populated once the + job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied at creation. + } + # response body for status code(s): 403, 404, 409 + 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_inference_cancel_batch_request( + batch_id=batch_id, + 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, 403, 404, 409]: + 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 == 403: + 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 response.status_code == 409: + 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 create_async_invoke( - self, body: Union[JSON, IO[bytes]], **kwargs: Any - ) -> JSON: + async def get_batch_results(self, batch_id: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Generate Image, Audio, or Text-to-Speech Using fal Models. + """Get Batch Inference Results Download Links. - Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous - job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll - for the result. + Returns short-lived presigned download URLs for the output (and optional error sidecar) of a + completed batch job. If results are not yet ready, the response sets ``result_available: + false`` or returns ``412 Precondition Failed``\\ ; in both cases, keep polling batch status and + retry. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param batch_id: The batch job identifier. Required. + :type batch_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -256741,55 +259315,28 @@ async def create_async_invoke( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "input": { - "enable_safety_checker": bool, # Optional. Whether to enable the - safety checker for generated content. - "guidance_scale": 0.0, # Optional. Controls how closely the image - generation model follows the prompt. Higher values produce output more - closely matching the prompt. - "num_images": 0, # Optional. The number of images to generate. - "num_inference_steps": 0, # Optional. The number of inference steps - to use during image generation. More steps generally produce higher quality - output but take longer. - "output_format": "str", # Optional. The desired output format or - aspect ratio for image generation. - "prompt": "str", # Optional. The text prompt describing the desired - output. Used for image generation and audio generation models. - "seconds_total": 0, # Optional. The total duration in seconds for - generated audio. Used for audio generation models. - "text": "str" # Optional. The text content to convert to speech. - Used for text-to-speech models. - }, - "model_id": "str", # The ID of the model to invoke asynchronously. Required. - "tags": [ - { - "key": "str", # The tag key. Required. - "value": "str" # The tag value. Required. - } - ] + # response body for status code(s): 200 + response == { + "batch_id": "str", # Required. + "result_available": bool, # When ``false``"" , keep polling batch status and + retry later. Required. + "error_file_url": "str", # Optional. Presigned URL for the error sidecar + JSONL, if any. + "expires_at": "2020-02-20 00:00:00", # Optional. When the presigned URLs + expire. + "output_file_url": "str" # Optional. Presigned URL for the main results + JSONL. } - - # response body for status code(s): 200, 202 + # response body for status code(s): 403, 404, 412 response == { - "created_at": "2020-02-20 00:00:00", # The timestamp when the request was - created. Required. - "model_id": "str", # The model ID that was invoked. Required. - "request_id": "str", # A unique identifier for the async invocation request. - Use this ID to check the status and retrieve the result. Required. - "status": "str", # The current status of the async invocation. Required. - Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". - "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the - job completed. Null until finished. - "error": "str", # Optional. Error message if the job failed. Null on - success. - "output": { - "str": {} # Optional. The output of the invocation. Null while the - job is queued or in progress. Contains the result once completed. - }, - "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job - started processing. Null while queued. + "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]] = { @@ -256805,26 +259352,13 @@ async def create_async_invoke( } 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: - _json = body - - _request = build_inference_create_async_invoke_request( - content_type=content_type, - json=_json, - content=_content, + _request = build_inference_get_batch_results_request( + batch_id=batch_id, headers=_headers, params=_params, ) @@ -256839,7 +259373,7 @@ async def create_async_invoke( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 403, 404, 412]: 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 @@ -256862,7 +259396,39 @@ async def create_async_invoke( else: deserialized = None - if response.status_code == 202: + if response.status_code == 403: + 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 response.status_code == 412: response_headers["ratelimit-limit"] = self._deserialize( "int", response.headers.get("ratelimit-limit") ) diff --git a/src/pydo/operations/_operations.py b/src/pydo/operations/_operations.py index 0c9cd483..e5994cb6 100644 --- a/src/pydo/operations/_operations.py +++ b/src/pydo/operations/_operations.py @@ -14264,6 +14264,166 @@ def build_genai_regenerate_model_api_key_request( # pylint: disable=name-too-lo return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) +def build_genai_list_model_routers_request( + *, 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/models/routers" + + # 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_create_model_router_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/models/routers" + + # 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_model_router_presets_request( # pylint: disable=name-too-long + *, 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/models/routers/presets" + + # 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_list_model_router_task_presets_request( # pylint: disable=name-too-long + *, 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/models/routers/tasks/presets" + + # 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_model_router_request(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/models/routers/{uuid}" + path_format_arguments = { + "uuid": _SERIALIZER.url("uuid", 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_model_router_request(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/models/routers/{uuid}" + path_format_arguments = { + "uuid": _SERIALIZER.url("uuid", 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_model_router_request(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/models/routers/{uuid}" + path_format_arguments = { + "uuid": _SERIALIZER.url("uuid", 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_create_oauth2_dropbox_tokens_request( **kwargs: Any, ) -> HttpRequest: # pylint: disable=name-too-long @@ -14900,6 +15060,161 @@ def build_inference_create_async_invoke_request( return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) +def build_inference_create_batch_file_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 = "/v1/batches/files" + + # 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_inference_upload_batch_file_request( # pylint: disable=name-too-long + *, content: IO[bytes], **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 = "/" + + # 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, content=content, **kwargs + ) + + +def build_inference_list_batches_request( + *, after: Optional[str] = None, limit: int = 20, **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 = "/v1/batches" + + # Construct parameters + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if limit is not None: + _params["limit"] = _SERIALIZER.query( + "limit", limit, "int", maximum=100, minimum=1 + ) + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest( + method="GET", url=_url, params=_params, headers=_headers, **kwargs + ) + + +def build_inference_create_batch_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 = "/v1/batches" + + # 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_inference_get_batch_request(batch_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v1/batches/{batch_id}" + path_format_arguments = { + "batch_id": _SERIALIZER.url("batch_id", batch_id, "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_inference_cancel_batch_request(batch_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v1/batches/{batch_id}/cancel" + path_format_arguments = { + "batch_id": _SERIALIZER.url("batch_id", batch_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_inference_get_batch_results_request( # pylint: disable=name-too-long + batch_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v1/batches/{batch_id}/results" + path_format_arguments = { + "batch_id": _SERIALIZER.url("batch_id", batch_id, "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_agent_inference_create_chat_completion_request( # pylint: disable=name-too-long *, agent: bool = True, **kwargs: Any ) -> HttpRequest: @@ -18294,8 +18609,9 @@ def list( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -18593,21 +18909,6 @@ def list( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -18809,17 +19110,24 @@ def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -19387,7 +19695,9 @@ def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -19397,7 +19707,7 @@ def list( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -19830,8 +20140,10 @@ def list( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -20142,21 +20454,6 @@ def list( }, "jobs": [ { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -20370,17 +20667,24 @@ def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 + target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target + number of requests per second per instance + for the component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -20976,7 +21280,9 @@ def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. Default value is @@ -20986,7 +21292,7 @@ def list( }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -21523,8 +21829,10 @@ def list( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -21835,21 +22143,6 @@ def list( }, "jobs": [ { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -22063,17 +22356,24 @@ def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 + target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target + number of requests per second per instance + for the component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -22669,7 +22969,9 @@ def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. Default value is @@ -22679,7 +22981,7 @@ def list( }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -23154,8 +23456,10 @@ def list( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -23466,21 +23770,6 @@ def list( }, "jobs": [ { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -23694,17 +23983,24 @@ def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 + target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target + number of requests per second per instance + for the component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -24300,7 +24596,9 @@ def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. Default value is @@ -24310,7 +24608,7 @@ def list( }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -24776,8 +25074,10 @@ def list( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -25088,21 +25388,6 @@ def list( }, "jobs": [ { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -25316,17 +25601,24 @@ def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 + target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target + number of requests per second per instance + for the component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -25922,7 +26214,9 @@ def list( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. Default value is @@ -25932,7 +26226,7 @@ def list( }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -26393,7 +26687,8 @@ def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -26664,21 +26959,6 @@ def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -26859,18 +27139,23 @@ def create( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -27377,8 +27662,9 @@ def create( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -27387,8 +27673,7 @@ def create( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -27677,8 +27962,8 @@ def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -27963,21 +28248,6 @@ def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -28168,18 +28438,23 @@ def create( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -28711,8 +28986,9 @@ def create( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -28721,8 +28997,7 @@ def create( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -29130,8 +29405,9 @@ def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -29429,21 +29705,6 @@ def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -29645,17 +29906,24 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -30223,7 +30491,9 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -30233,7 +30503,7 @@ def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -30744,8 +31014,9 @@ def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -31043,21 +31314,6 @@ def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -31259,17 +31515,24 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -31837,7 +32100,9 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -31847,7 +32112,7 @@ def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -32297,8 +32562,9 @@ def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -32596,21 +32862,6 @@ def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -32812,17 +33063,24 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -33390,7 +33648,9 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -33400,7 +33660,7 @@ def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -33842,8 +34102,9 @@ def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -34141,21 +34402,6 @@ def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -34357,17 +34603,24 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -34935,7 +35188,9 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -34945,7 +35200,7 @@ def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -35332,8 +35587,8 @@ def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -35618,21 +35873,6 @@ def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -35823,18 +36063,23 @@ def create( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -36366,8 +36611,9 @@ def create( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -36376,8 +36622,7 @@ def create( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -36785,8 +37030,9 @@ def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -37084,21 +37330,6 @@ def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -37300,17 +37531,24 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -37878,7 +38116,9 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -37888,7 +38128,7 @@ def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -38399,8 +38639,9 @@ def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -38698,21 +38939,6 @@ def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -38914,17 +39140,24 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -39492,7 +39725,9 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -39502,7 +39737,7 @@ def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -39952,8 +40187,9 @@ def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -40251,21 +40487,6 @@ def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -40467,17 +40688,24 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -41045,7 +41273,9 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -41055,7 +41285,7 @@ def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -41497,8 +41727,9 @@ def create( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -41796,21 +42027,6 @@ def create( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -42012,17 +42228,24 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -42590,7 +42813,9 @@ def create( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -42600,7 +42825,7 @@ def create( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -42977,7 +43202,8 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -43248,21 +43474,6 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -43443,18 +43654,23 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -43961,8 +44177,9 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -43971,8 +44188,7 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -44261,8 +44477,8 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -44547,21 +44763,6 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -44752,18 +44953,23 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -45295,8 +45501,9 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -45305,8 +45512,7 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -45714,8 +45920,9 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -46013,21 +46220,6 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -46229,17 +46421,24 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -46807,7 +47006,9 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -46817,7 +47018,7 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -47328,8 +47529,9 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -47627,21 +47829,6 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -47843,17 +48030,24 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -48421,7 +48615,9 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -48431,7 +48627,7 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -48881,8 +49077,9 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -49180,21 +49377,6 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -49396,17 +49578,24 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -49974,7 +50163,9 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -49984,7 +50175,7 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -50426,8 +50617,9 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -50725,21 +50917,6 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -50941,17 +51118,24 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -51519,7 +51703,9 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -51529,7 +51715,7 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -52098,8 +52284,8 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -52384,21 +52570,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -52589,18 +52760,23 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -53132,8 +53308,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -53142,8 +53319,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -53551,8 +53727,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -53850,21 +54027,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -54066,17 +54228,24 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -54644,7 +54813,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -54654,7 +54825,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -55165,8 +55336,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -55464,21 +55636,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -55680,17 +55837,24 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -56258,7 +56422,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -56268,7 +56434,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -56718,8 +56884,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -57017,21 +57184,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -57233,17 +57385,24 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -57811,7 +57970,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -57821,7 +57982,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -58263,8 +58424,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -58562,21 +58724,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -58778,17 +58925,24 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -59356,7 +59510,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -59366,7 +59522,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -59844,7 +60000,8 @@ def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -60115,21 +60272,6 @@ def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -60310,18 +60452,23 @@ def update( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -60828,8 +60975,9 @@ def update( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -60838,8 +60986,7 @@ def update( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -61130,8 +61277,8 @@ def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -61416,21 +61563,6 @@ def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -61621,18 +61753,23 @@ def update( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -62164,8 +62301,9 @@ def update( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -62174,8 +62312,7 @@ def update( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -62583,8 +62720,9 @@ def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -62882,21 +63020,6 @@ def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -63098,17 +63221,24 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -63676,7 +63806,9 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -63686,7 +63818,7 @@ def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -64197,8 +64329,9 @@ def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -64496,21 +64629,6 @@ def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -64712,17 +64830,24 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -65290,7 +65415,9 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -65300,7 +65427,7 @@ def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -65750,8 +65877,9 @@ def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -66049,21 +66177,6 @@ def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -66265,17 +66378,24 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -66843,7 +66963,9 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -66853,7 +66975,7 @@ def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -67295,8 +67417,9 @@ def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -67594,21 +67717,6 @@ def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -67810,17 +67918,24 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -68388,7 +68503,9 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -68398,7 +68515,7 @@ def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -68803,8 +68920,8 @@ def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -69089,21 +69206,6 @@ def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -69294,18 +69396,23 @@ def update( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -69837,8 +69944,9 @@ def update( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -69847,8 +69955,7 @@ def update( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -70256,8 +70363,9 @@ def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -70555,21 +70663,6 @@ def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -70771,17 +70864,24 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -71349,7 +71449,9 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -71359,7 +71461,7 @@ def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -71870,8 +71972,9 @@ def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -72169,21 +72272,6 @@ def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -72385,17 +72473,24 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -72963,7 +73058,9 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -72973,7 +73070,7 @@ def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -73423,8 +73520,9 @@ def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -73722,21 +73820,6 @@ def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -73938,17 +74021,24 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -74516,7 +74606,9 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -74526,7 +74618,7 @@ def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -74968,8 +75060,9 @@ def update( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -75267,21 +75360,6 @@ def update( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -75483,17 +75561,24 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -76061,7 +76146,9 @@ def update( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -76071,7 +76158,7 @@ def update( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -76461,7 +76548,8 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -76732,21 +76820,6 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -76927,18 +77000,23 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -77445,8 +77523,9 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -77455,8 +77534,7 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -77747,8 +77825,8 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -78033,21 +78111,6 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -78238,18 +78301,23 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -78781,8 +78849,9 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -78791,8 +78860,7 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -79200,8 +79268,9 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -79499,21 +79568,6 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -79715,17 +79769,24 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -80293,7 +80354,9 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -80303,7 +80366,7 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -80814,8 +80877,9 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -81113,21 +81177,6 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -81329,17 +81378,24 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -81907,7 +81963,9 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -81917,7 +81975,7 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -82367,8 +82425,9 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -82666,21 +82725,6 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -82882,17 +82926,24 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -83460,7 +83511,9 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -83470,7 +83523,7 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -83912,8 +83965,9 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -84211,21 +84265,6 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -84427,17 +84466,24 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -85005,7 +85051,9 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -85015,7 +85063,7 @@ def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -85620,8 +85668,8 @@ def restart( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -85906,21 +85954,6 @@ def restart( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -86111,18 +86144,23 @@ def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -86654,8 +86692,9 @@ def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -86664,8 +86703,7 @@ def restart( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -87124,8 +87162,8 @@ def restart( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -87410,21 +87448,6 @@ def restart( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -87615,18 +87638,23 @@ def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -88158,8 +88186,9 @@ def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -88168,8 +88197,7 @@ def restart( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -88628,8 +88656,8 @@ def restart( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -88914,21 +88942,6 @@ def restart( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -89119,18 +89132,23 @@ def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -89662,8 +89680,9 @@ def restart( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -89672,8 +89691,7 @@ def restart( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -90657,8 +90675,9 @@ def list_deployments( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -90956,21 +90975,6 @@ def list_deployments( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -91172,17 +91176,24 @@ def list_deployments( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -91750,7 +91761,9 @@ def list_deployments( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -91760,7 +91773,7 @@ def list_deployments( }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -92324,8 +92337,8 @@ def create_deployment( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -92610,21 +92623,6 @@ def create_deployment( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -92815,18 +92813,23 @@ def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -93358,8 +93361,9 @@ def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -93368,8 +93372,7 @@ def create_deployment( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -93829,8 +93832,8 @@ def create_deployment( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -94115,21 +94118,6 @@ def create_deployment( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -94320,18 +94308,23 @@ def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -94863,8 +94856,9 @@ def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -94873,8 +94867,7 @@ def create_deployment( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -95332,8 +95325,8 @@ def create_deployment( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -95618,21 +95611,6 @@ def create_deployment( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -95823,18 +95801,23 @@ def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -96366,8 +96349,9 @@ def create_deployment( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -96376,8 +96360,7 @@ def create_deployment( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -96917,8 +96900,8 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -97203,21 +97186,6 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -97408,18 +97376,23 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -97951,8 +97924,9 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -97961,8 +97935,7 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -98489,8 +98462,8 @@ def cancel_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> J "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -98775,21 +98748,6 @@ def cancel_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> J }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -98980,18 +98938,23 @@ def cancel_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> J { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -99523,8 +99486,9 @@ def cancel_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> J { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -99533,8 +99497,7 @@ def cancel_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> J } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -101347,8 +101310,10 @@ def list_events( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -101659,21 +101624,6 @@ def list_events( }, "jobs": [ { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -101887,17 +101837,24 @@ def list_events( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 + target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target + number of requests per second per instance + for the component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -102493,7 +102450,9 @@ def list_events( "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. + this component. Maximum 250. Consider using a larger + instance size if your application requires more than + 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. Default value is @@ -102503,7 +102462,7 @@ def list_events( }, "min_instance_count": 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + this component. }, "bitbucket": { "branch": "str", # @@ -103101,8 +103060,9 @@ def get_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -103400,21 +103360,6 @@ def get_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -103616,17 +103561,24 @@ def get_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -104194,7 +104146,9 @@ def get_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -104204,7 +104158,7 @@ def get_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -104785,8 +104739,9 @@ def cancel_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -105084,21 +105039,6 @@ def cancel_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -105300,17 +105240,24 @@ def cancel_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "request_duration": { + "p95_milliseconds": 0 # Optional. The p95 target + request duration in milliseconds for the + component. + }, + "requests_per_second": { + "per_instance": 0 # Optional. The target number + of requests per second per instance for the + component. } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -105878,7 +105825,9 @@ def cancel_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: "autoscaling": { "max_instance_count": 0, # Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. + component. Maximum 250. Consider using a larger instance + size if your application requires more than 250 + instances. "metrics": { "cpu": { "percent": 80 @@ -105888,7 +105837,7 @@ def cancel_event(self, app_id: str, event_id: str, **kwargs: Any) -> JSON: }, "min_instance_count": 0 # Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + component. }, "bitbucket": { "branch": "str", # Optional. @@ -106826,7 +106775,8 @@ def validate_app_spec( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -107097,21 +107047,6 @@ def validate_app_spec( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -107292,18 +107227,23 @@ def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -107810,8 +107750,9 @@ def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -107820,8 +107761,7 @@ def validate_app_spec( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -108119,7 +108059,8 @@ def validate_app_spec( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -108390,21 +108331,6 @@ def validate_app_spec( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -108585,18 +108511,23 @@ def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -109103,8 +109034,9 @@ def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -109113,8 +109045,7 @@ def validate_app_spec( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -109434,7 +109365,8 @@ def validate_app_spec( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -109705,21 +109637,6 @@ def validate_app_spec( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -109900,18 +109817,23 @@ def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -110418,8 +110340,9 @@ def validate_app_spec( { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -110428,8 +110351,7 @@ def validate_app_spec( } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -110730,7 +110652,8 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -111001,21 +110924,6 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -111196,18 +111104,23 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -111714,8 +111627,9 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -111724,8 +111638,7 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -112023,7 +111936,8 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # @@ -112294,21 +112208,6 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -112489,18 +112388,23 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization + "request_duration": { + "p95_milliseconds": 0 # + Optional. The p95 target request duration in milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second per + instance for the component. } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -113007,8 +112911,9 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON { "autoscaling": { "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. + maximum amount of instances for this component. Maximum 250. + Consider using a larger instance size if your application + requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # Optional. @@ -113017,8 +112922,7 @@ def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON } }, "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. + minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The name of the @@ -113345,7 +113249,8 @@ def list_alerts(self, app_id: str, **kwargs: Any) -> JSON: "DOMAIN_LIVE", "AUTOSCALE_FAILED", "AUTOSCALE_SUCCEEDED", "FUNCTIONS_ACTIVATION_COUNT", "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # Optional. Default value is "UNSPECIFIED_WINDOW". Known values are: @@ -113542,8 +113447,9 @@ def assign_alert_destinations( "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", "AUTOSCALE_FAILED", "AUTOSCALE_SUCCEEDED", "FUNCTIONS_ACTIVATION_COUNT", "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # Optional. Default value is "UNSPECIFIED_WINDOW". Known values are: "UNSPECIFIED_WINDOW", @@ -113647,8 +113553,9 @@ def assign_alert_destinations( "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", "AUTOSCALE_FAILED", "AUTOSCALE_SUCCEEDED", "FUNCTIONS_ACTIVATION_COUNT", "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # Optional. Default value is "UNSPECIFIED_WINDOW". Known values are: "UNSPECIFIED_WINDOW", @@ -113757,8 +113664,9 @@ def assign_alert_destinations( "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", "AUTOSCALE_FAILED", "AUTOSCALE_SUCCEEDED", "FUNCTIONS_ACTIVATION_COUNT", "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + "FUNCTIONS_GB_RATE_PER_SECOND", "REQUESTS_PER_SECOND", and + "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": "UNSPECIFIED_WINDOW" # Optional. Default value is "UNSPECIFIED_WINDOW". Known values are: "UNSPECIFIED_WINDOW", @@ -114128,8 +114036,8 @@ def create_rollback( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -114414,21 +114322,6 @@ def create_rollback( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -114619,18 +114512,23 @@ def create_rollback( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -115162,8 +115060,9 @@ def create_rollback( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -115172,8 +115071,7 @@ def create_rollback( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -115641,8 +115539,8 @@ def create_rollback( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -115927,21 +115825,6 @@ def create_rollback( }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -116132,18 +116015,23 @@ def create_rollback( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -116675,8 +116563,9 @@ def create_rollback( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -116685,8 +116574,7 @@ def create_rollback( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -117157,8 +117045,8 @@ def create_rollback( "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -117442,21 +117330,214 @@ def create_rollback( ] }, "jobs": [ + { + "bitbucket": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": {}, + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": [ + { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "basic_auth": { + "password": + "str", # Optional. Password for user defined in + User. Is required when ``endpoint`` is set. + Cannot be set if using a DigitalOcean DBaaS + OpenSearch cluster. + "user": "str" + # Optional. Username to authenticate with. Only + required when ``endpoint`` is set. Defaults to + ``doadmin`` when ``cluster_name`` is set. + }, + "cluster_name": + "str", # Optional. The name of a DigitalOcean DBaaS + OpenSearch cluster to use as a log forwarding + destination. Cannot be specified if ``endpoint`` is + also specified. + "endpoint": "str", # + Optional. OpenSearch API Endpoint. Only HTTPS is + supported. Format: + https://:code:``::code:``. Cannot be + specified if ``cluster_name`` is also specified. + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + } + ], + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "maintenance": { + "archive": bool, # Optional. Indicates whether the + app should be archived. Setting this to true implies that enabled is + set to true. + "enabled": bool, # Optional. Indicates whether + maintenance mode should be enabled for the app. + "offline_page_url": "str" # Optional. A custom + offline page to display when maintenance mode is enabled or the app + is archived. + }, + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "atl", "nyc", "sfo", "tor", "ams", "fra", "lon", "blr", + "sgp", and "syd". + "services": [ { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -117470,251 +117551,48 @@ def create_rollback( "build_command": "str", # Optional. An optional build command to run while building this component from source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time * BUILD_TIME: Made available only at build-time - * RUN_AND_BUILD_TIME: Made available at both build and - run-time. Known values are: "UNSET", "RUN_TIME", - "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable * SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used. * - "$username:$access_token" for registries of type - ``DOCKER_HUB``. * "$username:$access_token" for registries of - type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type. * DOCR: - The DigitalOcean container registry type. * GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": {}, - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job - that runs before an app deployment. * POST_DEPLOY: Indicates a - job that runs after an app deployment. * FAILED_DEPLOY: Indicates - a job that runs after a component fails to deploy. Known values - are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": [ - { - "name": "str", # Required. - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "open_search": { - "basic_auth": { - "password": - "str", # Optional. Password for user defined in - User. Is required when ``endpoint`` is set. - Cannot be set if using a DigitalOcean DBaaS - OpenSearch cluster. - "user": "str" - # Optional. Username to authenticate with. Only - required when ``endpoint`` is set. Defaults to - ``doadmin`` when ``cluster_name`` is set. - }, - "cluster_name": - "str", # Optional. The name of a DigitalOcean DBaaS - OpenSearch cluster to use as a log forwarding - destination. Cannot be specified if ``endpoint`` is - also specified. - "endpoint": "str", # - Optional. OpenSearch API Endpoint. Only HTTPS is - supported. Format: - https://:code:``::code:``. Cannot be - specified if ``cluster_name`` is also specified. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - } - ], - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "maintenance": { - "archive": bool, # Optional. Indicates whether the - app should be archived. Setting this to true implies that enabled is - set to true. - "enabled": bool, # Optional. Indicates whether - maintenance mode should be enabled for the app. - "offline_page_url": "str" # Optional. A custom - offline page to display when maintenance mode is enabled or the app - is archived. - }, - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "atl", "nyc", "sfo", "tor", "ams", "fra", "lon", "blr", - "sgp", and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "bitbucket": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, "dockerfile_path": "str", # Optional. The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform @@ -118191,8 +118069,9 @@ def create_rollback( { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -118201,8 +118080,7 @@ def create_rollback( } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -119268,8 +119146,8 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". + "FUNCTIONS_ERROR_COUNT", "FUNCTIONS_GB_RATE_PER_SECOND", + "REQUESTS_PER_SECOND", and "REQUEST_DURATION_P95_MS". "value": 0.0, # Optional. Threshold value for alert. "window": @@ -119554,21 +119432,6 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: }, "jobs": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, "bitbucket": { "branch": "str", # Optional. The name of the branch to use. @@ -119759,18 +119622,23 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "request_duration": { + "p95_milliseconds": 0 + # Optional. The p95 target request duration in + milliseconds for the component. + }, + "requests_per_second": { + "per_instance": 0 # + Optional. The target number of requests per second + per instance for the component. } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -120302,8 +120170,9 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: { "autoscaling": { "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. + The maximum amount of instances for this component. Maximum + 250. Consider using a larger instance size if your + application requires more than 250 instances. "metrics": { "cpu": { "percent": 80 # @@ -120312,8 +120181,7 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: } }, "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + The minimum amount of instances for this component. }, "bitbucket": { "branch": "str", # Optional. The @@ -253024,8 +252892,180 @@ def regenerate_model_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore + @distributed_trace + def list_model_routers( + self, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """List Model Routers. + + To list model routers, send a GET request to ``/v2/gen-ai/models/routers``. + + :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. + }, + "model_routers": [ + { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback + models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # + Optional. Short task description. + "name": "str" # Optional. + Task name. + }, + "models": [ + "str" # Optional. Models + assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. + One of: none, cheapest, fastest. Known values are: + "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task + slug. + } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation + date / time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last + modified. + "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_model_routers_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_oauth2_dropbox_tokens( + def create_model_router( self, body: Optional[JSON] = None, *, @@ -253033,11 +253073,9 @@ def create_oauth2_dropbox_tokens( **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Get Oauth2 Dropbox Tokens. + """Create a Model Router. - To obtain the refresh token, needed for creation of data sources, send a GET request to - ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the - field 'code'. + To create a model router, send a POST request to ``/v2/gen-ai/models/routers``. :param body: Default value is None. :type body: JSON @@ -253053,14 +253091,70 @@ def create_oauth2_dropbox_tokens( # JSON input template you can fill out and use as your body input. body = { - "code": "str", # Optional. The oauth2 code from google. - "redirect_url": "str" # Optional. Redirect url. + "description": "str", # Optional. Model router description. + "fallback_models": [ + "str" # Optional. Fallback models. + ], + "name": "str", # Optional. Model router name. + "policies": [ + { + "custom_task": { + "description": "str", # Optional. Short task + description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: none, cheapest, + fastest. Known values are: "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ], + "regions": [ + "str" # Optional. Target regions for the router. + ] } # response body for status code(s): 200 response == { - "refresh_token": "str", # Optional. The refresh token. - "token": "str" # Optional. The access token. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. + } } # response body for status code(s): 404 response == { @@ -253076,7 +253170,7 @@ def create_oauth2_dropbox_tokens( """ @overload - def create_oauth2_dropbox_tokens( + def create_model_router( self, body: Optional[IO[bytes]] = None, *, @@ -253084,11 +253178,9 @@ def create_oauth2_dropbox_tokens( **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Get Oauth2 Dropbox Tokens. + """Create a Model Router. - To obtain the refresh token, needed for creation of data sources, send a GET request to - ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the - field 'code'. + To create a model router, send a POST request to ``/v2/gen-ai/models/routers``. :param body: Default value is None. :type body: IO[bytes] @@ -253104,8 +253196,41 @@ def create_oauth2_dropbox_tokens( # response body for status code(s): 200 response == { - "refresh_token": "str", # Optional. The refresh token. - "token": "str" # Optional. The access token. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. + } } # response body for status code(s): 404 response == { @@ -253121,15 +253246,13 @@ def create_oauth2_dropbox_tokens( """ @distributed_trace - def create_oauth2_dropbox_tokens( + def create_model_router( self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Get Oauth2 Dropbox Tokens. + """Create a Model Router. - To obtain the refresh token, needed for creation of data sources, send a GET request to - ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the - field 'code'. + To create a model router, send a POST request to ``/v2/gen-ai/models/routers``. :param body: Is either a JSON type or a IO[bytes] type. Default value is None. :type body: JSON or IO[bytes] @@ -253142,14 +253265,70 @@ def create_oauth2_dropbox_tokens( # JSON input template you can fill out and use as your body input. body = { - "code": "str", # Optional. The oauth2 code from google. - "redirect_url": "str" # Optional. Redirect url. + "description": "str", # Optional. Model router description. + "fallback_models": [ + "str" # Optional. Fallback models. + ], + "name": "str", # Optional. Model router name. + "policies": [ + { + "custom_task": { + "description": "str", # Optional. Short task + description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: none, cheapest, + fastest. Known values are: "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ], + "regions": [ + "str" # Optional. Target regions for the router. + ] } # response body for status code(s): 200 response == { - "refresh_token": "str", # Optional. The refresh token. - "token": "str" # Optional. The access token. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "uuid": "str" # Optional. Unique id. + } } # response body for status code(s): 404 response == { @@ -253195,7 +253374,7 @@ def create_oauth2_dropbox_tokens( else: _json = None - _request = build_genai_create_oauth2_dropbox_tokens_request( + _request = build_genai_create_model_router_request( content_type=content_type, json=_json, content=_content, @@ -253258,23 +253437,22 @@ def create_oauth2_dropbox_tokens( return cast(JSON, deserialized) # type: ignore @distributed_trace - def get_oauth2_url( + def list_model_router_presets( self, *, - type: Optional[str] = None, - redirect_url: Optional[str] = None, + page: Optional[int] = None, + per_page: Optional[int] = None, **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Get Oauth2 URL. + """List Model Router Presets. - To generate an Oauth2-URL for use with your localhost, send a GET request to - ``/v2/gen-ai/oauth2/url``. Pass 'http://localhost:3000 as redirect_url. + To list model router presets, send a GET request to ``/v2/gen-ai/models/routers/presets``. - :keyword type: Type "google" / "dropbox". Default value is None. - :paramtype type: str - :keyword redirect_url: The redirect url. Default value is None. - :paramtype redirect_url: 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: @@ -253284,7 +253462,57 @@ def get_oauth2_url( # response body for status code(s): 200 response == { - "url": "str" # Optional. The oauth2 url. + "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. + }, + "presets": [ + { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback + models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # + Optional. Short task description. + "name": "str" # Optional. + Task name. + }, + "models": [ + "str" # Optional. Models + assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. + One of: none, cheapest, fastest. Known values are: + "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task + slug. + } + ] + }, + "display_name": "str", # Optional. Display name for UI + surfaces. + "long_description": "str", # Optional. Long description for + details views. + "short_description": "str", # Optional. Short description + for list views. + "slug": "str" # Optional. Stable slug for routing usage. + } + ] } # response body for status code(s): 404 response == { @@ -253316,9 +253544,9 @@ def get_oauth2_url( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_get_oauth2_url_request( - type=type, - redirect_url=redirect_url, + _request = build_genai_list_model_router_presets_request( + page=page, + per_page=per_page, headers=_headers, params=_params, ) @@ -253378,7 +253606,7 @@ def get_oauth2_url( return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_openai_api_keys( + def list_model_router_task_presets( self, *, page: Optional[int] = None, @@ -253386,9 +253614,10 @@ def list_openai_api_keys( **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """List OpenAI API Keys. + """List Model Router Task Presets. - To list all OpenAI API keys, send a GET request to ``/v2/gen-ai/openai/keys``. + To list model router task presets, send a GET request to + ``/v2/gen-ai/models/routers/tasks/presets``. :keyword page: Page number. Default value is None. :paramtype page: int @@ -253403,76 +253632,6 @@ def list_openai_api_keys( # 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. - "kb_default_chunk_size": 0, # Optional. - Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum - chunk size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum - chunking size token limits if model supports KNOWLEDGEBASE - usecase. - "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. @@ -253485,7 +253644,27 @@ def list_openai_api_keys( "page": 0, # Optional. The current page. "pages": 0, # Optional. Total number of pages. "total": 0 # Optional. Total amount of items over all pages. - } + }, + "tasks": [ + { + "category": "str", # Optional. Higher-level grouping used by + the UI. + "description": "str", # Optional. Task description. + "models": [ + "str" # Optional. Default models assigned to this + task. + ], + "name": "str", # Optional. Display name. + "selection_policy": { + "prefer": "str" # Optional. One of: none, cheapest, + fastest. Known values are: "none", "cheapest", and "fastest". + }, + "tags": [ + "str" # Optional. Lightweight labels for filtering. + ], + "task_slug": "str" # Optional. Task slug. + } + ] } # response body for status code(s): 404 response == { @@ -253517,7 +253696,7 @@ def list_openai_api_keys( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_openai_api_keys_request( + _request = build_genai_list_model_router_task_presets_request( page=page, per_page=per_page, headers=_headers, @@ -253578,19 +253757,167 @@ def list_openai_api_keys( return cast(JSON, deserialized) # type: ignore + @distributed_trace + def get_model_router(self, uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve an Existing Model Router. + + To retrieve details of a model router, send a GET request to + ``/v2/gen-ai/models/routers/{uuid}``. + + :param uuid: Model router 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 == { + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. Last modified. + "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_model_router_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 + @overload - def create_openai_api_key( + def update_model_router( self, + uuid: str, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Create OpenAI API Key. + """Update a Model Router. - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + To update a model router, send a PUT request to ``/v2/gen-ai/models/routers/{uuid}``. + :param uuid: Model router 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. @@ -253605,72 +253932,70 @@ def create_openai_api_key( # 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. + "description": "str", # Optional. Model router description. + "fallback_models": [ + "str" # Optional. Fallback models. + ], + "name": "str", # Optional. Model router name. + "policies": [ + { + "custom_task": { + "description": "str", # Optional. Short task + description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: none, cheapest, + fastest. Known values are: "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ], + "regions": [ + "str" # Optional. Target regions for the router. + ], + "uuid": "str" # Optional. Model router 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. } - } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. ], - "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. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -253687,18 +254012,21 @@ def create_openai_api_key( """ @overload - def create_openai_api_key( + def update_model_router( self, + uuid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Create OpenAI API Key. + """Update a Model Router. - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + To update a model router, send a PUT request to ``/v2/gen-ai/models/routers/{uuid}``. + :param uuid: Model router 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. @@ -253713,66 +254041,40 @@ def create_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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. } - } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. ], - "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. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -253789,14 +254091,16 @@ def create_openai_api_key( """ @distributed_trace - def create_openai_api_key( - self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + def update_model_router( + self, uuid: str, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create OpenAI API Key. + """Update a Model Router. - To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. + To update a model router, send a PUT request to ``/v2/gen-ai/models/routers/{uuid}``. + :param uuid: Model router 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 @@ -253808,72 +254112,70 @@ def create_openai_api_key( # 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. + "description": "str", # Optional. Model router description. + "fallback_models": [ + "str" # Optional. Fallback models. + ], + "name": "str", # Optional. Model router name. + "policies": [ + { + "custom_task": { + "description": "str", # Optional. Short task + description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: none, cheapest, + fastest. Known values are: "none", "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. + } + ], + "regions": [ + "str" # Optional. Target regions for the router. + ], + "uuid": "str" # Optional. Model router 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. + "model_router": { + "config": { + "fallback_models": [ + "str" # Optional. Router-level fallback models. + ], + "policies": [ + { + "custom_task": { + "description": "str", # Optional. + Short task description. + "name": "str" # Optional. Task name. + }, + "models": [ + "str" # Optional. Models assigned to + the task. + ], + "selection_policy": { + "prefer": "str" # Optional. One of: + none, cheapest, fastest. Known values are: "none", + "cheapest", and "fastest". + }, + "task_slug": "str" # Optional. Task slug. } - } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. Creation date / + time. + "description": "str", # Optional. Description. + "name": "str", # Optional. Name of the model router. + "regions": [ + "str" # Optional. Target regions for the router. ], - "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. + "uuid": "str" # Optional. Unique id. } } # response body for status code(s): 404 @@ -253920,7 +254222,8 @@ def create_openai_api_key( else: _json = None - _request = build_genai_create_openai_api_key_request( + _request = build_genai_update_model_router_request( + uuid=uuid, content_type=content_type, json=_json, content=_content, @@ -253983,15 +254286,14 @@ 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 delete_model_router(self, uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Get OpenAI API Key. + """Delete a Model Router. - To retrieve details of an OpenAI API key, send a GET request to - ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To delete a model router, send a DELETE request to ``/v2/gen-ai/models/routers/{uuid}``. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str + :param uuid: Model router id. Required. + :type uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -254001,67 +254303,7 @@ 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } + "uuid": "str" # Optional. The id of the deleted model router. } # response body for status code(s): 404 response == { @@ -254093,8 +254335,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_delete_model_router_request( + uuid=uuid, headers=_headers, params=_params, ) @@ -254154,21 +254396,20 @@ 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 create_oauth2_dropbox_tokens( 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. + """Get Oauth2 Dropbox Tokens. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To obtain the refresh token, needed for creation of data sources, send a GET request to + ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the + field 'code'. - :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. @@ -254183,74 +254424,14 @@ 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. + "code": "str", # Optional. The oauth2 code from google. + "redirect_url": "str" # Optional. Redirect url. } # 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } + "refresh_token": "str", # Optional. The refresh token. + "token": "str" # Optional. The access token. } # response body for status code(s): 404 response == { @@ -254266,21 +254447,20 @@ def update_openai_api_key( """ @overload - def update_openai_api_key( + def create_oauth2_dropbox_tokens( 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. + """Get Oauth2 Dropbox Tokens. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To obtain the refresh token, needed for creation of data sources, send a GET request to + ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the + field 'code'. - :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. @@ -254295,67 +254475,8 @@ 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } + "refresh_token": "str", # Optional. The refresh token. + "token": "str" # Optional. The access token. } # response body for status code(s): 404 response == { @@ -254371,19 +254492,16 @@ 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_oauth2_dropbox_tokens( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Update OpenAI API Key. + """Get Oauth2 Dropbox Tokens. - To update an OpenAI API key, send a PUT request to ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To obtain the refresh token, needed for creation of data sources, send a GET request to + ``/v2/gen-ai/oauth2/dropbox/tokens``. Pass the code you obtrained from the oauth flow in the + field 'code'. - :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 @@ -254395,74 +254513,14 @@ 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. + "code": "str", # Optional. The oauth2 code from google. + "redirect_url": "str" # Optional. Redirect url. } # 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } + "refresh_token": "str", # Optional. The refresh token. + "token": "str" # Optional. The access token. } # response body for status code(s): 404 response == { @@ -254508,8 +254566,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_oauth2_dropbox_tokens_request( content_type=content_type, json=_json, content=_content, @@ -254572,15 +254629,23 @@ 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: + def get_oauth2_url( + self, + *, + type: Optional[str] = None, + redirect_url: Optional[str] = None, + **kwargs: Any, + ) -> JSON: # pylint: disable=line-too-long - """Delete OpenAI API Key. + """Get Oauth2 URL. - To delete an OpenAI API key, send a DELETE request to - ``/v2/gen-ai/openai/keys/{api_key_uuid}``. + To generate an Oauth2-URL for use with your localhost, send a GET request to + ``/v2/gen-ai/oauth2/url``. Pass 'http://localhost:3000 as redirect_url. - :param api_key_uuid: API key ID. Required. - :type api_key_uuid: str + :keyword type: Type "google" / "dropbox". Default value is None. + :paramtype type: str + :keyword redirect_url: The redirect url. Default value is None. + :paramtype redirect_url: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -254590,67 +254655,7 @@ def delete_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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } + "url": "str" # Optional. The oauth2 url. } # response body for status code(s): 404 response == { @@ -254682,8 +254687,9 @@ def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_delete_openai_api_key_request( - api_key_uuid=api_key_uuid, + _request = build_genai_get_oauth2_url_request( + type=type, + redirect_url=redirect_url, headers=_headers, params=_params, ) @@ -254743,21 +254749,18 @@ def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_agents_by_openai_key( + def list_openai_api_keys( 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 OpenAI API Keys. - List Agents by OpenAI Key. + To list all OpenAI API keys, send a GET request to ``/v2/gen-ai/openai/keys``. - :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. @@ -254771,668 +254774,15 @@ def list_agents_by_openai_key( # response body for status code(s): 200 response == { - "agents": [ + "api_key_infos": [ { - "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": { - "allowed_domains": [ - "str" # Optional. A 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", "STATUS_DELETED", - and "STATUS_BUILDING". - "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": [ + "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": [ { - "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_jobs": [ - { - "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", - "DATA_SOURCE_STATUS_FAILED", and - "DATA_SOURCE_STATUS_CANCELLED". - "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. - } - ], - "data_source_uuids": [ - "str" # Optional. - IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", - # Optional. IndexingJob description. - "is_report_available": bool, # - Optional. Boolean value to determine if the indexing job - details are available. - "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", "INDEX_JOB_STATUS_PENDING", - and "INDEX_JOB_STATUS_CANCELLED". - "tokens": 0, # Optional. Number of - tokens [This field is deprecated]. - "total_datasources": 0, # Optional. - Number of datasources being indexed. - "total_tokens": "str", # Optional. - Total Tokens Consumed By the Indexing Job. - "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. - "reranking_config": { - "enabled": bool, # Optional. Whether - reranking is enabled for retrieval. - "model": "str" # Optional. Reranker - model internal name. - }, - "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. - "insights_enabled": bool, # Optional. Whether - insights are enabled. - "insights_enabled_at": "2020-02-20 00:00:00", # - Optional. Timestamp when insights were enabled. - "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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum chunk - size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum chunking - size token limits if model supports KNOWLEDGEBASE usecase. - "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. - } - }, - "model_provider_key": { - "api_key_uuid": "str", # Optional. API key ID. - "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. - "kb_default_chunk_size": 0, # - Optional. Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. - Maximum chunk size limit of model. - "kb_min_chunk_size": 0, # Optional. - Minimum chunking size token limits if model supports - KNOWLEDGEBASE usecase. - "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 key. - "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. Key - last updated date. - }, - "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. - "kb_default_chunk_size": 0, # - Optional. Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. - Maximum chunk size limit of model. - "kb_min_chunk_size": 0, # Optional. - Minimum chunking size token limits if model supports - KNOWLEDGEBASE usecase. - "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_jobs": [ - { - "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", - "DATA_SOURCE_STATUS_FAILED", and - "DATA_SOURCE_STATUS_CANCELLED". - "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. - } - ], - "data_source_uuids": [ - "str" # Optional. - IndexingJob description. - ], - "finished_at": "2020-02-20 - 00:00:00", # Optional. IndexingJob description. - "is_report_available": bool, - # Optional. Boolean value to determine if the indexing - job details are available. - "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", - "INDEX_JOB_STATUS_PENDING", and - "INDEX_JOB_STATUS_CANCELLED". - "tokens": 0, # Optional. - Number of tokens [This field is deprecated]. - "total_datasources": 0, # - Optional. Number of datasources being indexed. - "total_tokens": "str", # - Optional. Total Tokens Consumed By the Indexing Job. - "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. - "reranking_config": { - "enabled": bool, # Optional. - Whether reranking is enabled for retrieval. - "model": "str" # Optional. - Reranker model internal name. - }, - "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. @@ -255486,167 +254836,12 @@ 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. - "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. - "vpc_egress_ips": [ - "str" # Optional. VPC Egress IPs. + } ], - "vpc_uuid": "str", # Optional. - "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": [ - { - "category": - "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default - value is "METRIC_CATEGORY_UNSPECIFIED". Known values - are: "METRIC_CATEGORY_UNSPECIFIED", - "METRIC_CATEGORY_CORRECTNESS", - "METRIC_CATEGORY_USER_OUTCOMES", - "METRIC_CATEGORY_SAFETY_AND_SECURITY", - "METRIC_CATEGORY_CONTEXT_QUALITY", and - "METRIC_CATEGORY_MODEL_FIT". - "description": "str", - # Optional. Evaluations. - "inverted": bool, # - Optional. If true, the metric is inverted, meaning - that a lower value is better. - "is_metric_goal": - bool, # Optional. Evaluations. - "metric_name": "str", - # Optional. Evaluations. - "metric_rank": 0, # - 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. - } + "name": "str", # Optional. Name. + "updated_at": "2020-02-20 00:00:00", # Optional. Key last + updated date. + "uuid": "str" # Optional. Uuid. } ], "links": { @@ -255693,8 +254888,7 @@ def list_agents_by_openai_key( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_agents_by_openai_key_request( - uuid=uuid, + _request = build_genai_list_openai_api_keys_request( page=page, per_page=per_page, headers=_headers, @@ -255755,24 +254949,24 @@ def list_agents_by_openai_key( return cast(JSON, deserialized) # type: ignore - @distributed_trace - def list_datacenter_regions( + @overload + def create_openai_api_key( self, + body: Optional[JSON] = None, *, - serves_inference: Optional[bool] = None, - serves_batch: Optional[bool] = None, + content_type: str = "application/json", **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """List Datacenter Regions. + """Create OpenAI API Key. - To list all datacenter regions, send a GET request to ``/v2/gen-ai/regions``. + To create an OpenAI API key, send a POST request to ``/v2/gen-ai/openai/keys``. - :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 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: @@ -255780,21 +254974,465 @@ def list_datacenter_regions( 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 == { - "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. - } - ] + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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 == { @@ -255826,9 +255464,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_get_openai_api_key_request( + api_key_uuid=api_key_uuid, headers=_headers, params=_params, ) @@ -255888,19 +255525,21 @@ def list_datacenter_regions( return cast(JSON, deserialized) # type: ignore @overload - def create_scheduled_indexing( + 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 - """Create scheduled indexing for knowledge base. + """Update OpenAI API Key. - To create scheduled indexing for a knowledge base, send a POST request to - ``/v2/gen-ai/scheduled-indexing``. + 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. @@ -255915,40 +255554,73 @@ def create_scheduled_indexing( # JSON input template you can fill out and use as your body input. body = { - "days": [ - 0 # Optional. Days for execution (day is represented same as in a - cron expression, e.g. Monday begins with 1 ). - ], - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid for which the - schedule is created. - "time": "str" # Optional. Time of execution (HH:MM) UTC. + "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 == { - "indexing_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Created at - timestamp. - "days": [ - 0 # Optional. Days for execution (day is represented same as - in a cron expression, e.g. Monday begins with 1 ). + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + } + } ], - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at - timestamp (if soft deleted). - "is_active": bool, # Optional. Whether the schedule is currently - active. - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid - associated with this schedule. - "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the - schedule was executed. - "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled - run. - "time": "str", # Optional. Scheduled time of execution (HH:MM:SS - format). - "updated_at": "2020-02-20 00:00:00", # Optional. Updated at - timestamp. - "uuid": "str" # Optional. Unique identifier for the scheduled - indexing entry. + "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 @@ -255965,19 +255637,21 @@ def create_scheduled_indexing( """ @overload - def create_scheduled_indexing( + 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 - """Create scheduled indexing for knowledge base. + """Update OpenAI API Key. - To create scheduled indexing for a knowledge base, send a POST request to - ``/v2/gen-ai/scheduled-indexing``. + 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. @@ -255992,29 +255666,66 @@ def create_scheduled_indexing( # response body for status code(s): 200 response == { - "indexing_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Created at - timestamp. - "days": [ - 0 # Optional. Days for execution (day is represented same as - in a cron expression, e.g. Monday begins with 1 ). + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + } + } ], - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at - timestamp (if soft deleted). - "is_active": bool, # Optional. Whether the schedule is currently - active. - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid - associated with this schedule. - "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the - schedule was executed. - "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled - run. - "time": "str", # Optional. Scheduled time of execution (HH:MM:SS - format). - "updated_at": "2020-02-20 00:00:00", # Optional. Updated at - timestamp. - "uuid": "str" # Optional. Unique identifier for the scheduled - indexing entry. + "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 @@ -256031,15 +255742,19 @@ def create_scheduled_indexing( """ @distributed_trace - def create_scheduled_indexing( - self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + 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 - """Create scheduled indexing for knowledge base. + """Update OpenAI API Key. - To create scheduled indexing for a knowledge base, send a POST request to - ``/v2/gen-ai/scheduled-indexing``. + 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 @@ -256051,40 +255766,73 @@ def create_scheduled_indexing( # JSON input template you can fill out and use as your body input. body = { - "days": [ - 0 # Optional. Days for execution (day is represented same as in a - cron expression, e.g. Monday begins with 1 ). - ], - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid for which the - schedule is created. - "time": "str" # Optional. Time of execution (HH:MM) UTC. + "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 == { - "indexing_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Created at - timestamp. - "days": [ - 0 # Optional. Days for execution (day is represented same as - in a cron expression, e.g. Monday begins with 1 ). + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + } + } ], - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at - timestamp (if soft deleted). - "is_active": bool, # Optional. Whether the schedule is currently - active. - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid - associated with this schedule. - "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the - schedule was executed. - "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled - run. - "time": "str", # Optional. Scheduled time of execution (HH:MM:SS - format). - "updated_at": "2020-02-20 00:00:00", # Optional. Updated at - timestamp. - "uuid": "str" # Optional. Unique identifier for the scheduled - indexing entry. + "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 @@ -256131,7 +255879,8 @@ def create_scheduled_indexing( else: _json = None - _request = build_genai_create_scheduled_indexing_request( + _request = build_genai_update_openai_api_key_request( + api_key_uuid=api_key_uuid, content_type=content_type, json=_json, content=_content, @@ -256194,15 +255943,15 @@ def create_scheduled_indexing( return cast(JSON, deserialized) # type: ignore @distributed_trace - def get_scheduled_indexing(self, knowledge_base_uuid: str, **kwargs: Any) -> JSON: + def delete_openai_api_key(self, api_key_uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Get Scheduled Indexing for Knowledge Base. + """Delete OpenAI API Key. - Get Scheduled Indexing for knowledge base using knoweldge base uuid, send a GET request to - ``/v2/gen-ai/scheduled-indexing/knowledge-base/{knowledge_base_uuid}``. + To delete an OpenAI API key, send a DELETE request to + ``/v2/gen-ai/openai/keys/{api_key_uuid}``. - :param knowledge_base_uuid: UUID of the scheduled indexing entry. Required. - :type knowledge_base_uuid: str + :param api_key_uuid: API key ID. Required. + :type api_key_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -256212,29 +255961,66 @@ def get_scheduled_indexing(self, knowledge_base_uuid: str, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { - "indexing_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Created at - timestamp. - "days": [ - 0 # Optional. Days for execution (day is represented same as - in a cron expression, e.g. Monday begins with 1 ). + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + } + } ], - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at - timestamp (if soft deleted). - "is_active": bool, # Optional. Whether the schedule is currently - active. - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid - associated with this schedule. - "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the - schedule was executed. - "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled - run. - "time": "str", # Optional. Scheduled time of execution (HH:MM:SS - format). - "updated_at": "2020-02-20 00:00:00", # Optional. Updated at - timestamp. - "uuid": "str" # Optional. Unique identifier for the scheduled - indexing entry. + "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 @@ -256267,8 +256053,8 @@ def get_scheduled_indexing(self, knowledge_base_uuid: str, **kwargs: Any) -> JSO cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_get_scheduled_indexing_request( - knowledge_base_uuid=knowledge_base_uuid, + _request = build_genai_delete_openai_api_key_request( + api_key_uuid=api_key_uuid, headers=_headers, params=_params, ) @@ -256328,15 +256114,25 @@ def get_scheduled_indexing(self, knowledge_base_uuid: str, **kwargs: Any) -> JSO return cast(JSON, deserialized) # type: ignore @distributed_trace - def delete_scheduled_indexing(self, uuid: str, **kwargs: Any) -> JSON: + 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 - """Delete Scheduled Indexing. + """List agents by OpenAI key. - Delete Scheduled Indexing for knowledge base, send a DELETE request to - ``/v2/gen-ai/scheduled-indexing/{uuid}``. + List Agents by OpenAI Key. - :param uuid: UUID of the scheduled indexing. Required. + :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: @@ -256346,459 +256142,353 @@ def delete_scheduled_indexing(self, uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "indexing_info": { - "created_at": "2020-02-20 00:00:00", # Optional. Created at - timestamp. - "days": [ - 0 # Optional. Days for execution (day is represented same as - in a cron expression, e.g. Monday begins with 1 ). - ], - "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at - timestamp (if soft deleted). - "is_active": bool, # Optional. Whether the schedule is currently - active. - "knowledge_base_uuid": "str", # Optional. Knowledge base uuid - associated with this schedule. - "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the - schedule was executed. - "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled - run. - "time": "str", # Optional. Scheduled time of execution (HH:MM:SS - format). - "updated_at": "2020-02-20 00:00:00", # Optional. Updated at - timestamp. - "uuid": "str" # Optional. Unique identifier for the scheduled - indexing entry. - } - } - # 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_scheduled_indexing_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_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": [ { - "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": { - "allowed_domains": [ - "str" # Optional. A 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. + "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": { + "allowed_domains": [ + "str" # Optional. A 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", "STATUS_DELETED", + and "STATUS_BUILDING". + "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. - "deployment": { + "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. - "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", "STATUS_DELETED", and - "STATUS_BUILDING". + "data_source_jobs": [ + { + "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", + "DATA_SOURCE_STATUS_FAILED", and + "DATA_SOURCE_STATUS_CANCELLED". + "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. + } + ], + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", + # Optional. IndexingJob description. + "is_report_available": bool, # + Optional. Boolean value to determine if the indexing job + details are available. + "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", "INDEX_JOB_STATUS_PENDING", + and "INDEX_JOB_STATUS_CANCELLED". + "tokens": 0, # Optional. Number of + tokens [This field is deprecated]. + "total_datasources": 0, # Optional. + Number of datasources being indexed. + "total_tokens": "str", # Optional. + Total Tokens Consumed By the Indexing Job. "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". + "uuid": "str" # Optional. Unique id. }, - "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_jobs": [ - { - "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", - "DATA_SOURCE_STATUS_FAILED", and - "DATA_SOURCE_STATUS_CANCELLED". - "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. - } - ], - "data_source_uuids": - [ - "str" # - Optional. IndexingJob description. - ], - "finished_at": - "2020-02-20 00:00:00", # Optional. IndexingJob - description. - "is_report_available": bool, # Optional. Boolean - value to determine if the indexing job details are - available. - "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", - "INDEX_JOB_STATUS_PENDING", and - "INDEX_JOB_STATUS_CANCELLED". - "tokens": 0, # - Optional. Number of tokens [This field is - deprecated]. - "total_datasources": - 0, # Optional. Number of datasources being indexed. - "total_tokens": - "str", # Optional. Total Tokens Consumed By the - Indexing Job. - "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. - "reranking_config": { - "enabled": bool, # - Optional. Whether reranking is enabled for retrieval. - "model": "str" # - Optional. Reranker model internal name. - }, - "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. - "insights_enabled": bool, # - Optional. Whether insights are enabled. - "insights_enabled_at": "2020-02-20 - 00:00:00", # Optional. Timestamp when insights were enabled. - "log_stream_id": "str", # Optional. - Identifier for the log stream. - "log_stream_name": "str" # Optional. - Name of the log stream. + "name": "str", # Optional. Name of knowledge + base. + "project_id": "str", # Optional. Knowledge + bases. + "region": "str", # Optional. Region code. + "reranking_config": { + "enabled": bool, # Optional. Whether + reranking is enabled for retrieval. + "model": "str" # Optional. Reranker + model internal name. }, - "max_tokens": 0, # Optional. Agents. - "model": { + "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. + "insights_enabled": bool, # Optional. Whether + insights are enabled. + "insights_enabled_at": "2020-02-20 00:00:00", # + Optional. Timestamp when insights were enabled. + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum chunk + size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum chunking + size token limits if model supports KNOWLEDGEBASE usecase. + "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. + } + }, + "model_provider_key": { + "api_key_uuid": "str", # Optional. API key ID. + "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. @@ -256855,576 +256545,625 @@ def list_workspaces(self, **kwargs: Any) -> JSON: "patch": 0 # Optional. Patch version number. } - }, - "model_provider_key": { - "api_key_uuid": "str", # Optional. - API key ID. + } + ], + "name": "str", # Optional. Name of the key. + "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. Key + last updated date. + }, + "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. 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": - 0, # Optional. Maximum chunk size limit of model. - "kb_min_chunk_size": - 0, # Optional. Minimum chunking size token limits if - model supports KNOWLEDGEBASE usecase. - "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. - } - } - ], + # 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. + "kb_default_chunk_size": 0, # + Optional. Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. + Maximum chunk size limit of model. + "kb_min_chunk_size": 0, # Optional. + Minimum chunking size token limits if model supports + KNOWLEDGEBASE usecase. + "metadata": {}, # Optional. + Additional meta data. "name": "str", # Optional. Name of - the key. + 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. Key last updated date. - }, - "name": "str", # Optional. Agent name. - "openai_api_key": { + "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. 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. - "kb_default_chunk_size": 0, # Optional. Default - chunking size limit to show in UI. - "kb_max_chunk_size": - 0, # Optional. Maximum chunk size limit of model. - "kb_min_chunk_size": - 0, # Optional. Minimum chunking size token limits if - model supports KNOWLEDGEBASE usecase. - "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. + # 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_jobs": [ + { + "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", + "DATA_SOURCE_STATUS_FAILED", and + "DATA_SOURCE_STATUS_CANCELLED". + "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. } - } + ], + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "is_report_available": bool, + # Optional. Boolean value to determine if the indexing + job details are available. + "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", + "INDEX_JOB_STATUS_PENDING", and + "INDEX_JOB_STATUS_CANCELLED". + "tokens": 0, # Optional. + Number of tokens [This field is deprecated]. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "total_tokens": "str", # + Optional. Total Tokens Consumed By the Indexing Job. + "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. + "reranking_config": { + "enabled": bool, # Optional. + Whether reranking is enabled for retrieval. + "model": "str" # Optional. + Reranker model internal name. + }, + "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. - }, - "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. + # 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. - 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_jobs": [ - { - "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", - "DATA_SOURCE_STATUS_FAILED", and - "DATA_SOURCE_STATUS_CANCELLED". - "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. - } - ], - "data_source_uuids": [ - "str" - # Optional. IndexingJob description. - ], - "finished_at": "2020-02-20 00:00:00", # - Optional. IndexingJob description. - "is_report_available": bool, # Optional. Boolean - value to determine if the indexing job details - are available. - "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", - "INDEX_JOB_STATUS_PENDING", and - "INDEX_JOB_STATUS_CANCELLED". - "tokens": 0, - # Optional. Number of tokens [This field is - deprecated]. - "total_datasources": 0, # Optional. Number of - datasources being indexed. - "total_tokens": "str", # Optional. Total Tokens - Consumed By the Indexing Job. - "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. - "reranking_config": { - "enabled": - bool, # Optional. Whether reranking is enabled - for retrieval. - "model": - "str" # Optional. Reranker model internal name. - }, - "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. - "kb_default_chunk_size": 0, - # Optional. Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # - Optional. Maximum chunk size limit of model. - "kb_min_chunk_size": 0, # - Optional. Minimum chunking size token limits if model - supports KNOWLEDGEBASE usecase. - "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. + Agreement Description. + "name": "str", # Optional. Agreement + Description. + "url": "str", # Optional. Agreement + Description. + "uuid": "str" # Optional. Agreement + Description. }, - "top_p": 0.0, # Optional. Agents. + "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. + "kb_default_chunk_size": 0, # Optional. + Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum + chunk size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum + chunking size token limits if model supports KNOWLEDGEBASE + usecase. + "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. - "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. - "vpc_egress_ips": [ - "str" # Optional. VPC Egress IPs. + "upload_complete": bool, # Optional. Model + has been fully uploaded. + "url": "str", # Optional. Download url. + "usecases": [ + "str" # Optional. Usecases of the + model. ], - "vpc_uuid": "str", # Optional. Agents. - "workspace": ... - } + "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. + "vpc_egress_ips": [ + "str" # Optional. VPC Egress IPs. ], - "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": { + "vpc_uuid": "str", # Optional. + "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. Time created at. + # 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. - Name of the dataset. + Evaluations. "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": [ - { - "category": - "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default value - is "METRIC_CATEGORY_UNSPECIFIED". Known values are: - "METRIC_CATEGORY_UNSPECIFIED", - "METRIC_CATEGORY_CORRECTNESS", - "METRIC_CATEGORY_USER_OUTCOMES", - "METRIC_CATEGORY_SAFETY_AND_SECURITY", - "METRIC_CATEGORY_CONTEXT_QUALITY", and - "METRIC_CATEGORY_MODEL_FIT". - "description": "str", # - Optional. Evaluations. - "inverted": bool, # - Optional. If true, the metric is inverted, meaning that a - lower value is better. - "is_metric_goal": bool, # - Optional. Evaluations. - "metric_name": "str", # - Optional. Evaluations. - "metric_rank": 0, # - 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". + Evaluations. + "description": "str", # Optional. + Evaluations. + "latest_version_number_of_runs": 0, + # Optional. Evaluations. + "metrics": [ + { + "category": + "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default + value is "METRIC_CATEGORY_UNSPECIFIED". Known values + are: "METRIC_CATEGORY_UNSPECIFIED", + "METRIC_CATEGORY_CORRECTNESS", + "METRIC_CATEGORY_USER_OUTCOMES", + "METRIC_CATEGORY_SAFETY_AND_SECURITY", + "METRIC_CATEGORY_CONTEXT_QUALITY", and + "METRIC_CATEGORY_MODEL_FIT". + "description": "str", + # Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning + that a lower value is better. + "is_metric_goal": + bool, # Optional. Evaluations. + "metric_name": "str", + # Optional. Evaluations. + "metric_rank": 0, # + 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. - "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. + "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. - "name": "str", # Optional. + "total_runs": 0, # 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. + "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. } ] } @@ -257458,7 +257197,9 @@ def list_workspaces(self, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_workspaces_request( + _request = build_genai_list_datacenter_regions_request( + serves_inference=serves_inference, + serves_batch=serves_batch, headers=_headers, params=_params, ) @@ -257518,7 +257259,7 @@ def list_workspaces(self, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @overload - def create_workspace( + def create_scheduled_indexing( self, body: Optional[JSON] = None, *, @@ -257526,10 +257267,10 @@ def create_workspace( **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long - """Create a Workspace. + """Create scheduled indexing for knowledge base. - 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. + To create scheduled indexing for a knowledge base, send a POST request to + ``/v2/gen-ai/scheduled-indexing``. :param body: Default value is None. :type body: JSON @@ -257545,568 +257286,739 @@ def create_workspace( # 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. + "days": [ + 0 # Optional. Days for execution (day is represented same as in a + cron expression, e.g. Monday begins with 1 ). ], - "description": "str", # Optional. Description of the workspace. - "name": "str" # Optional. Name of the workspace. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid for which the + schedule is created. + "time": "str" # Optional. Time of execution (HH:MM) UTC. } # 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": { - "allowed_domains": [ - "str" # Optional. A 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", "STATUS_DELETED", and - "STATUS_BUILDING". - "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_jobs": [ - { - "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", - "DATA_SOURCE_STATUS_FAILED", and - "DATA_SOURCE_STATUS_CANCELLED". - "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. - } - ], - "data_source_uuids": [ - "str" # Optional. - IndexingJob description. - ], - "finished_at": "2020-02-20 - 00:00:00", # Optional. IndexingJob description. - "is_report_available": bool, - # Optional. Boolean value to determine if the indexing - job details are available. - "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", - "INDEX_JOB_STATUS_PENDING", and - "INDEX_JOB_STATUS_CANCELLED". - "tokens": 0, # Optional. - Number of tokens [This field is deprecated]. - "total_datasources": 0, # - Optional. Number of datasources being indexed. - "total_tokens": "str", # - Optional. Total Tokens Consumed By the Indexing Job. - "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. - "reranking_config": { - "enabled": bool, # Optional. - Whether reranking is enabled for retrieval. - "model": "str" # Optional. - Reranker model internal name. - }, - "tags": [ - "str" # Optional. Tags to - organize related resources. - ], + "indexing_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Created at + timestamp. + "days": [ + 0 # Optional. Days for execution (day is represented same as + in a cron expression, e.g. Monday begins with 1 ). + ], + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at + timestamp (if soft deleted). + "is_active": bool, # Optional. Whether the schedule is currently + active. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid + associated with this schedule. + "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the + schedule was executed. + "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled + run. + "time": "str", # Optional. Scheduled time of execution (HH:MM:SS + format). + "updated_at": "2020-02-20 00:00:00", # Optional. Updated at + timestamp. + "uuid": "str" # Optional. Unique identifier for the scheduled + indexing entry. + } + } + # 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_scheduled_indexing( + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Create scheduled indexing for knowledge base. + + To create scheduled indexing for a knowledge base, send a POST request to + ``/v2/gen-ai/scheduled-indexing``. + + :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 == { + "indexing_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Created at + timestamp. + "days": [ + 0 # Optional. Days for execution (day is represented same as + in a cron expression, e.g. Monday begins with 1 ). + ], + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at + timestamp (if soft deleted). + "is_active": bool, # Optional. Whether the schedule is currently + active. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid + associated with this schedule. + "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the + schedule was executed. + "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled + run. + "time": "str", # Optional. Scheduled time of execution (HH:MM:SS + format). + "updated_at": "2020-02-20 00:00:00", # Optional. Updated at + timestamp. + "uuid": "str" # Optional. Unique identifier for the scheduled + indexing entry. + } + } + # 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_scheduled_indexing( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create scheduled indexing for knowledge base. + + To create scheduled indexing for a knowledge base, send a POST request to + ``/v2/gen-ai/scheduled-indexing``. + + :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 = { + "days": [ + 0 # Optional. Days for execution (day is represented same as in a + cron expression, e.g. Monday begins with 1 ). + ], + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid for which the + schedule is created. + "time": "str" # Optional. Time of execution (HH:MM) UTC. + } + + # response body for status code(s): 200 + response == { + "indexing_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Created at + timestamp. + "days": [ + 0 # Optional. Days for execution (day is represented same as + in a cron expression, e.g. Monday begins with 1 ). + ], + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at + timestamp (if soft deleted). + "is_active": bool, # Optional. Whether the schedule is currently + active. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid + associated with this schedule. + "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the + schedule was executed. + "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled + run. + "time": "str", # Optional. Scheduled time of execution (HH:MM:SS + format). + "updated_at": "2020-02-20 00:00:00", # Optional. Updated at + timestamp. + "uuid": "str" # Optional. Unique identifier for the scheduled + indexing entry. + } + } + # 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_scheduled_indexing_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_scheduled_indexing(self, knowledge_base_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get Scheduled Indexing for Knowledge Base. + + Get Scheduled Indexing for knowledge base using knoweldge base uuid, send a GET request to + ``/v2/gen-ai/scheduled-indexing/knowledge-base/{knowledge_base_uuid}``. + + :param knowledge_base_uuid: UUID of the scheduled indexing entry. Required. + :type knowledge_base_uuid: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "indexing_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Created at + timestamp. + "days": [ + 0 # Optional. Days for execution (day is represented same as + in a cron expression, e.g. Monday begins with 1 ). + ], + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at + timestamp (if soft deleted). + "is_active": bool, # Optional. Whether the schedule is currently + active. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid + associated with this schedule. + "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the + schedule was executed. + "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled + run. + "time": "str", # Optional. Scheduled time of execution (HH:MM:SS + format). + "updated_at": "2020-02-20 00:00:00", # Optional. Updated at + timestamp. + "uuid": "str" # Optional. Unique identifier for the scheduled + indexing entry. + } + } + # 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_scheduled_indexing_request( + knowledge_base_uuid=knowledge_base_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 delete_scheduled_indexing(self, uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete Scheduled Indexing. + + Delete Scheduled Indexing for knowledge base, send a DELETE request to + ``/v2/gen-ai/scheduled-indexing/{uuid}``. + + :param uuid: UUID of the scheduled indexing. 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 == { + "indexing_info": { + "created_at": "2020-02-20 00:00:00", # Optional. Created at + timestamp. + "days": [ + 0 # Optional. Days for execution (day is represented same as + in a cron expression, e.g. Monday begins with 1 ). + ], + "deleted_at": "2020-02-20 00:00:00", # Optional. Deleted at + timestamp (if soft deleted). + "is_active": bool, # Optional. Whether the schedule is currently + active. + "knowledge_base_uuid": "str", # Optional. Knowledge base uuid + associated with this schedule. + "last_ran_at": "2020-02-20 00:00:00", # Optional. Last time the + schedule was executed. + "next_run_at": "2020-02-20 00:00:00", # Optional. Next scheduled + run. + "time": "str", # Optional. Scheduled time of execution (HH:MM:SS + format). + "updated_at": "2020-02-20 00:00:00", # Optional. Updated at + timestamp. + "uuid": "str" # Optional. Unique identifier for the scheduled + indexing entry. + } + } + # 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_scheduled_indexing_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_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. 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. - "insights_enabled": bool, # Optional. - Whether insights are enabled. - "insights_enabled_at": "2020-02-20 00:00:00", - # Optional. Timestamp when insights were enabled. - "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. + # Optional. Key last updated date. + "uuid": "str" # Optional. Uuid. }, - "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. - "kb_default_chunk_size": 0, # Optional. - Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # Optional. Maximum - chunk size limit of model. - "kb_min_chunk_size": 0, # Optional. Minimum - chunking size token limits if model supports KNOWLEDGEBASE - usecase. - "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. - } - }, - "model_provider_key": { - "api_key_uuid": "str", # Optional. API key - ID. - "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": [ + "api_key_infos": [ { - "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. - "kb_default_chunk_size": 0, - # Optional. Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # - Optional. Maximum chunk size limit of model. - "kb_min_chunk_size": 0, # - Optional. Minimum chunking size token limits if model - supports KNOWLEDGEBASE usecase. - "metadata": {}, # Optional. - Additional meta data. + 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 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. + "secret_key": "str", # + Optional. Api key infos. + "uuid": "str" # Optional. + Uuid. } ], - "name": "str", # Optional. Name of the key. - "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. Key last updated date. - }, - "name": "str", # Optional. Agent name. - "openai_api_key": { + "api_keys": [ + { + "api_key": "str" # Optional. + Api key. + } + ], + "chatbot": { + "allowed_domains": [ + "str" # Optional. A 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. 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": [ + 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", "STATUS_DELETED", and + "STATUS_BUILDING". + "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": [ { - "agreement": { - "description": "str", - # Optional. Agreement Description. - "name": "str", # - Optional. Agreement Description. - "url": "str", # - Optional. Agreement Description. - "uuid": "str" # - Optional. Agreement Description. - }, + "api_key": "str", # + Optional. Api key. "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. - "kb_default_chunk_size": 0, - # Optional. Default chunking size limit to show in UI. - "kb_max_chunk_size": 0, # - Optional. Maximum chunk size limit of model. - "kb_min_chunk_size": 0, # - Optional. Minimum chunking size token limits if model - supports KNOWLEDGEBASE usecase. - "metadata": {}, # Optional. - Additional meta data. + "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 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". + Name. + "output_schema": {}, # + Optional. Any object. "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. + Download your agent here. + "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": [ { + "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. - Priority of the guardrail. + 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. - Uuid of the guardrail. + The guardrails the agent is attached to. } ], - "instruction": "str", # Optional. - Instructions for the agent template. - "k": 0, # Optional. The 'k' value for the - agent template. + "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": @@ -258115,11 +258027,9 @@ def create_workspace( "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. + Optional. Knowledge bases. "embedding_model_uuid": - "str", # Optional. List of knowledge bases associated - with the agent template. + "str", # Optional. Knowledge bases. "is_public": bool, # Optional. Whether the knowledge base is public or not. "last_indexing_job": { @@ -258223,8 +258133,7 @@ def create_workspace( "name": "str", # Optional. Name of knowledge base. "project_id": "str", # - Optional. List of knowledge bases associated with the - agent template. + Optional. Knowledge bases. "region": "str", # Optional. Region code. "reranking_config": { @@ -258245,10 +258154,21 @@ def create_workspace( 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. + "logging_config": { + "galileo_project_id": "str", # + Optional. Galileo project identifier. + "galileo_project_name": "str", # + Optional. Name of the Galileo project. + "insights_enabled": bool, # + Optional. Whether insights are enabled. + "insights_enabled_at": "2020-02-20 + 00:00:00", # Optional. Timestamp when insights were enabled. + "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", # @@ -258307,151 +258227,577 @@ def create_workspace( 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. + "model_provider_key": { + "api_key_uuid": "str", # Optional. + API key ID. + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": + 0, # Optional. Maximum chunk size limit of model. + "kb_min_chunk_size": + 0, # Optional. Minimum chunking size token limits if + model supports KNOWLEDGEBASE usecase. + "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 key. + "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. Key last updated date. + }, + "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. + "kb_default_chunk_size": 0, # Optional. Default + chunking size limit to show in UI. + "kb_max_chunk_size": + 0, # Optional. Maximum chunk size limit of model. + "kb_min_chunk_size": + 0, # Optional. Minimum chunking size token limits if + model supports KNOWLEDGEBASE usecase. + "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_jobs": [ + { + "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", + "DATA_SOURCE_STATUS_FAILED", and + "DATA_SOURCE_STATUS_CANCELLED". + "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. + } + ], + "data_source_uuids": [ + "str" + # Optional. IndexingJob description. + ], + "finished_at": "2020-02-20 00:00:00", # + Optional. IndexingJob description. + "is_report_available": bool, # Optional. Boolean + value to determine if the indexing job details + are available. + "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", + "INDEX_JOB_STATUS_PENDING", and + "INDEX_JOB_STATUS_CANCELLED". + "tokens": 0, + # Optional. Number of tokens [This field is + deprecated]. + "total_datasources": 0, # Optional. Number of + datasources being indexed. + "total_tokens": "str", # Optional. Total Tokens + Consumed By the Indexing Job. + "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. + "reranking_config": { + "enabled": + bool, # Optional. Whether reranking is enabled + for retrieval. + "model": + "str" # Optional. Reranker model internal name. + }, + "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. + "kb_default_chunk_size": 0, + # Optional. Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # + Optional. Maximum chunk size limit of model. + "kb_min_chunk_size": 0, # + Optional. Minimum chunking size token limits if model + supports KNOWLEDGEBASE usecase. + "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. 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. - "vpc_egress_ips": [ - "str" # Optional. VPC Egress IPs. - ], - "vpc_uuid": "str", # Optional. Agents. - "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": { + 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. + "vpc_egress_ips": [ + "str" # Optional. VPC Egress IPs. + ], + "vpc_uuid": "str", # Optional. Agents. + "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. 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": [ - { - "category": - "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default value is - "METRIC_CATEGORY_UNSPECIFIED". Known values are: - "METRIC_CATEGORY_UNSPECIFIED", "METRIC_CATEGORY_CORRECTNESS", - "METRIC_CATEGORY_USER_OUTCOMES", - "METRIC_CATEGORY_SAFETY_AND_SECURITY", - "METRIC_CATEGORY_CONTEXT_QUALITY", and - "METRIC_CATEGORY_MODEL_FIT". - "description": "str", # Optional. - Evaluations. - "inverted": bool, # Optional. If - true, the metric is inverted, meaning that a lower value is - better. - "is_metric_goal": bool, # Optional. - Evaluations. - "metric_name": "str", # Optional. - Evaluations. - "metric_rank": 0, # 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". + 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": [ + { + "category": + "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default value + is "METRIC_CATEGORY_UNSPECIFIED". Known values are: + "METRIC_CATEGORY_UNSPECIFIED", + "METRIC_CATEGORY_CORRECTNESS", + "METRIC_CATEGORY_USER_OUTCOMES", + "METRIC_CATEGORY_SAFETY_AND_SECURITY", + "METRIC_CATEGORY_CONTEXT_QUALITY", and + "METRIC_CATEGORY_MODEL_FIT". + "description": "str", # + Optional. Evaluations. + "inverted": bool, # + Optional. If true, the metric is inverted, meaning that a + lower value is better. + "is_metric_goal": bool, # + Optional. Evaluations. + "metric_name": "str", # + Optional. Evaluations. + "metric_rank": 0, # + 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. - "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. + "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. - "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. - } + "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 == { @@ -258465,11 +258811,87 @@ def create_workspace( 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[IO[bytes]] = None, + body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any, @@ -258481,8 +258903,8 @@ def create_workspace( 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. + :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 @@ -258492,6 +258914,15 @@ def create_workspace( 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": { @@ -259406,9 +259837,13 @@ def create_workspace( } """ - @distributed_trace + @overload def create_workspace( - self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + self, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, ) -> JSON: # pylint: disable=line-too-long """Create a Workspace. @@ -259416,8 +259851,11 @@ def create_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] + :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: @@ -259425,15 +259863,6 @@ def create_workspace( 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": { @@ -260347,110 +260776,19 @@ def create_workspace( 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: + def create_workspace( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """Retrieve an Existing Workspace. + """Create a 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. + 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 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: @@ -260458,6 +260796,15 @@ def get_workspace(self, workspace_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. 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": { @@ -261384,13 +261731,29 @@ def get_workspace(self, workspace_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_workspace_request( - workspace_uuid=workspace_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_create_workspace_request( + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -261449,28 +261812,16 @@ def get_workspace(self, workspace_uuid: str, **kwargs: Any) -> JSON: 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: + @distributed_trace + def get_workspace(self, workspace_uuid: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Update a Workspace. + """Retrieve an Existing 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. + 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 - :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: @@ -261478,13 +261829,6 @@ def update_workspace( 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": { @@ -262398,12 +262742,89 @@ def update_workspace( 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[IO[bytes]] = None, + body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any, @@ -262417,8 +262838,958 @@ def update_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. + :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": { + "allowed_domains": [ + "str" # Optional. A 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", "STATUS_DELETED", and + "STATUS_BUILDING". + "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_jobs": [ + { + "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", + "DATA_SOURCE_STATUS_FAILED", and + "DATA_SOURCE_STATUS_CANCELLED". + "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. + } + ], + "data_source_uuids": [ + "str" # Optional. + IndexingJob description. + ], + "finished_at": "2020-02-20 + 00:00:00", # Optional. IndexingJob description. + "is_report_available": bool, + # Optional. Boolean value to determine if the indexing + job details are available. + "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", + "INDEX_JOB_STATUS_PENDING", and + "INDEX_JOB_STATUS_CANCELLED". + "tokens": 0, # Optional. + Number of tokens [This field is deprecated]. + "total_datasources": 0, # + Optional. Number of datasources being indexed. + "total_tokens": "str", # + Optional. Total Tokens Consumed By the Indexing Job. + "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. + "reranking_config": { + "enabled": bool, # Optional. + Whether reranking is enabled for retrieval. + "model": "str" # Optional. + Reranker model internal name. + }, + "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. + "insights_enabled": bool, # Optional. + Whether insights are enabled. + "insights_enabled_at": "2020-02-20 00:00:00", + # Optional. Timestamp when insights were enabled. + "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. + "kb_default_chunk_size": 0, # Optional. + Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. Maximum + chunk size limit of model. + "kb_min_chunk_size": 0, # Optional. Minimum + chunking size token limits if model supports KNOWLEDGEBASE + usecase. + "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. + } + }, + "model_provider_key": { + "api_key_uuid": "str", # Optional. API key + ID. + "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. + "kb_default_chunk_size": 0, + # Optional. Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # + Optional. Maximum chunk size limit of model. + "kb_min_chunk_size": 0, # + Optional. Minimum chunking size token limits if model + supports KNOWLEDGEBASE usecase. + "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 key. + "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. Key last updated date. + }, + "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. + "kb_default_chunk_size": 0, + # Optional. Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # + Optional. Maximum chunk size limit of model. + "kb_min_chunk_size": 0, # + Optional. Minimum chunking size token limits if model + supports KNOWLEDGEBASE usecase. + "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_jobs": [ + { + "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", + "DATA_SOURCE_STATUS_FAILED", and + "DATA_SOURCE_STATUS_CANCELLED". + "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. + } + ], + "data_source_uuids": + [ + "str" # + Optional. IndexingJob description. + ], + "finished_at": + "2020-02-20 00:00:00", # Optional. IndexingJob + description. + "is_report_available": bool, # Optional. Boolean + value to determine if the indexing job details are + available. + "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", + "INDEX_JOB_STATUS_PENDING", and + "INDEX_JOB_STATUS_CANCELLED". + "tokens": 0, # + Optional. Number of tokens [This field is + deprecated]. + "total_datasources": + 0, # Optional. Number of datasources being indexed. + "total_tokens": + "str", # Optional. Total Tokens Consumed By the + Indexing Job. + "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. + "reranking_config": { + "enabled": bool, # + Optional. Whether reranking is enabled for retrieval. + "model": "str" # + Optional. Reranker model internal name. + }, + "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. + "kb_default_chunk_size": 0, # + Optional. Default chunking size limit to show in UI. + "kb_max_chunk_size": 0, # Optional. + Maximum chunk size limit of model. + "kb_min_chunk_size": 0, # Optional. + Minimum chunking size token limits if model supports + KNOWLEDGEBASE usecase. + "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. + "vpc_egress_ips": [ + "str" # Optional. VPC Egress IPs. + ], + "vpc_uuid": "str", # Optional. Agents. + "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": [ + { + "category": + "METRIC_CATEGORY_UNSPECIFIED", # Optional. Default value is + "METRIC_CATEGORY_UNSPECIFIED". Known values are: + "METRIC_CATEGORY_UNSPECIFIED", "METRIC_CATEGORY_CORRECTNESS", + "METRIC_CATEGORY_USER_OUTCOMES", + "METRIC_CATEGORY_SAFETY_AND_SECURITY", + "METRIC_CATEGORY_CONTEXT_QUALITY", and + "METRIC_CATEGORY_MODEL_FIT". + "description": "str", # Optional. + Evaluations. + "inverted": bool, # Optional. If + true, the metric is inverted, meaning that a lower value is + better. + "is_metric_goal": bool, # Optional. + Evaluations. + "metric_name": "str", # Optional. + Evaluations. + "metric_rank": 0, # 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 @@ -268336,16 +269707,1882 @@ def update_agents_workspace( "uuid": "str" # Optional. Unique id. } } - # response body for status code(s): 404 + # 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_agents_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 list_evaluation_test_cases_by_workspace( + self, workspace_uuid: str, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List Evaluation Test Cases by Workspace. + + To list all evaluation test cases by a workspace, send a GET request to + ``/v2/gen-ai/workspaces/{workspace_uuid}/evaluation_test_cases``. + + :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 == { + "evaluation_test_cases": [ + { + "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": [ + { + "category": "METRIC_CATEGORY_UNSPECIFIED", # + Optional. Default value is "METRIC_CATEGORY_UNSPECIFIED". Known + values are: "METRIC_CATEGORY_UNSPECIFIED", + "METRIC_CATEGORY_CORRECTNESS", "METRIC_CATEGORY_USER_OUTCOMES", + "METRIC_CATEGORY_SAFETY_AND_SECURITY", + "METRIC_CATEGORY_CONTEXT_QUALITY", and + "METRIC_CATEGORY_MODEL_FIT". + "description": "str", # Optional. + "inverted": bool, # Optional. If true, the + metric is inverted, meaning that a lower value is better. + "is_metric_goal": bool, # Optional. + "metric_name": "str", # Optional. + "metric_rank": 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. + "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 + 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_test_cases_by_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 + + +class InferenceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~pydo.GeneratedClient`'s + :attr:`inference` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = ( + input_args.pop(0) if input_args else kwargs.pop("deserializer") + ) + + @overload + def create_chat_completion( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a model response for the given chat conversation. + + Creates a model response for the given chat conversation. + + :param body: Required. + :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 = { + "messages": [ + { + "role": "str", # The role of the message author. Required. + Known values are: "system", "developer", "user", "assistant", and "tool". + "content": "str", # Optional. The contents of the message. + "reasoning_content": "str", # Optional. The reasoning + content generated by the model (assistant messages only). + "refusal": "str", # Optional. The refusal message generated + by the model (assistant messages only). + "tool_call_id": "str", # Optional. Tool call that this + message is responding to (tool messages only). + "tool_calls": [ + { + "function": { + "arguments": "str", # The arguments + to call the function with, as generated by the model in JSON + format. Required. + "name": "str" # The name of the + function to call. Required. + }, + "id": "str", # The ID of the tool call. + Required. + "type": "str" # The type of the tool. + Currently, only function is supported. Required. "function" + } + ] + } + ], + "model": "str", # Model ID used to generate the response. Required. + "frequency_penalty": 0, # Optional. Default value is 0. Number between -2.0 + and 2.0. Positive values penalize new tokens based on their existing frequency in + the text so far, decreasing the model's likelihood to repeat the same line + verbatim. + "logit_bias": { + "str": 0 # Optional. Modify the likelihood of specified tokens + appearing in the completion. Accepts a JSON object that maps tokens + (specified by their token ID in the tokenizer) to an associated bias value + from -100 to 100. Mathematically, the bias is added to the logits generated + by the model prior to sampling. The exact effect will vary per model, but + values between -1 and 1 should decrease or increase likelihood of selection; + values like -100 or 100 should result in a ban or exclusive selection of the + relevant token. + }, + "logprobs": False, # Optional. Default value is False. Whether to return log + probabilities of the output tokens or not. If true, returns the log probabilities + of each output token returned in the content of message. + "max_completion_tokens": 0, # Optional. The maximum number of completion + tokens that may be used over the course of the run. The run will make a best + effort to use only the number of completion tokens specified, across multiple + turns of the run. + "max_tokens": 0, # Optional. The maximum number of tokens that can be + generated in the completion. The token count of your prompt plus max_tokens + cannot exceed the model's context length. + "metadata": { + "str": "str" # Optional. Set of 16 key-value pairs that can be + attached to an object. This can be useful for storing additional information + about the object in a structured format. Keys are strings with a maximum + length of 64 characters. Values are strings with a maximum length of 512 + characters. + }, + "n": 1, # Optional. Default value is 1. How many chat completion choices to + generate for each input message. Note that you will be charged based on the + number of generated tokens across all of the choices. Keep n as 1 to minimize + costs. + "presence_penalty": 0, # Optional. Default value is 0. Number between -2.0 + and 2.0. Positive values penalize new tokens based on whether they appear in the + text so far, increasing the model's likelihood to talk about new topics. + "reasoning_effort": "str", # Optional. Constrains effort on reasoning for + reasoning models. Reducing reasoning effort can result in faster responses and + fewer tokens used on reasoning in a response. Known values are: "none", + "minimal", "low", "medium", "high", and "xhigh". + "seed": 0, # Optional. If specified, the system will make a best effort to + sample deterministically, such that repeated requests with the same seed and + parameters should return the same result. Determinism is not guaranteed. + "stop": {}, + "stream": False, # Optional. Default value is False. If set to true, the + model response data will be streamed to the client as it is generated using + server-sent events. + "stream_options": { + "include_usage": bool # Optional. If set, an additional chunk will + be streamed before the data [DONE] message. The usage field on this chunk + shows the token usage statistics for the entire request, and the choices + field will always be an empty array. + }, + "temperature": 0.0, # Optional. What sampling temperature to use, between 0 + and 2. Higher values like 0.8 will make the output more random, while lower + values like 0.2 will make it more focused and deterministic. We generally + recommend altering this or top_p but not both. + "tool_choice": {}, + "tools": [ + { + "function": { + "name": "str", # The name of the function to be + called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, + with a maximum length of 64. Required. + "description": "str", # Optional. A description of + what the function does, used by the model to choose when and how to + call the function. + "parameters": { + "str": {} # Optional. The parameters the + function accepts, described as a JSON Schema object. + } + }, + "type": "str" # The type of the tool. Currently, only + function is supported. Required. "function" + } + ], + "top_logprobs": 0, # Optional. An integer between 0 and 20 specifying the + number of most likely tokens to return at each token position, each with an + associated log probability. logprobs must be set to true if this parameter is + used. + "top_p": 0.0, # Optional. An alternative to sampling with temperature, + called nucleus sampling, where the model considers the results of the tokens with + top_p probability mass. So 0.1 means only the tokens comprising the top 10% + probability mass are considered. We generally recommend altering this or + temperature but not both. + "user": "str" # Optional. A unique identifier representing your end-user, + which can help DigitalOcean to monitor and detect abuse. + } + + # response body for status code(s): 200 + response == { + "choices": [ + { + "finish_reason": "str", # The reason the model stopped + generating tokens. stop if the model hit a natural stop point or a + provided stop sequence, length if the maximum number of tokens specified + in the request was reached, tool_calls if the model called a tool. + Required. Known values are: "stop", "length", "tool_calls", and + "content_filter". + "index": 0, # The index of the choice in the list of + choices. Required. + "logprobs": { + "content": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ], + "refusal": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ] + }, + "message": { + "content": "str", # The contents of the message. + Required. + "reasoning_content": "str", # The reasoning content + generated by the model. Required. + "refusal": "str", # The refusal message generated by + the model. Required. + "role": "str", # The role of the author of this + message. Required. "assistant" + "tool_calls": [ + { + "function": { + "arguments": "str", # The + arguments to call the function with. Required. + "name": "str" # The name of + the function to call. Required. + }, + "id": "str", # The ID of the tool + call. Required. + "type": "str" # The type of the + tool. Required. "function" + } + ] + } + } + ], + "created": 0, # The Unix timestamp (in seconds) of when the chat completion + was created. Required. + "id": "str", # A unique identifier for the chat completion. Required. + "model": "str", # The model used for the chat completion. Required. + "object": "str", # The object type, which is always chat.completion. + Required. "chat.completion" + "usage": { + "cache_created_input_tokens": 0, # Default value is 0. Number of + prompt tokens written to cache. Required. + "cache_creation": { + "ephemeral_1h_input_tokens": 0, # Default value is 0. Number + of prompt tokens written to 1h cache. Required. + "ephemeral_5m_input_tokens": 0 # Default value is 0. Number + of prompt tokens written to 5m cache. Required. + }, + "cache_read_input_tokens": 0, # Default value is 0. Number of prompt + tokens read from cache. Required. + "completion_tokens": 0, # Default value is 0. Number of tokens in + the generated completion. Required. + "prompt_tokens": 0, # Default value is 0. Number of tokens in the + prompt. Required. + "total_tokens": 0 # Default value is 0. Total number of tokens used + in the request (prompt + completion). Required. + } + } + """ + + @overload + def create_chat_completion( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a model response for the given chat conversation. + + Creates a model response for the given chat conversation. + + :param body: Required. + :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 == { + "choices": [ + { + "finish_reason": "str", # The reason the model stopped + generating tokens. stop if the model hit a natural stop point or a + provided stop sequence, length if the maximum number of tokens specified + in the request was reached, tool_calls if the model called a tool. + Required. Known values are: "stop", "length", "tool_calls", and + "content_filter". + "index": 0, # The index of the choice in the list of + choices. Required. + "logprobs": { + "content": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ], + "refusal": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ] + }, + "message": { + "content": "str", # The contents of the message. + Required. + "reasoning_content": "str", # The reasoning content + generated by the model. Required. + "refusal": "str", # The refusal message generated by + the model. Required. + "role": "str", # The role of the author of this + message. Required. "assistant" + "tool_calls": [ + { + "function": { + "arguments": "str", # The + arguments to call the function with. Required. + "name": "str" # The name of + the function to call. Required. + }, + "id": "str", # The ID of the tool + call. Required. + "type": "str" # The type of the + tool. Required. "function" + } + ] + } + } + ], + "created": 0, # The Unix timestamp (in seconds) of when the chat completion + was created. Required. + "id": "str", # A unique identifier for the chat completion. Required. + "model": "str", # The model used for the chat completion. Required. + "object": "str", # The object type, which is always chat.completion. + Required. "chat.completion" + "usage": { + "cache_created_input_tokens": 0, # Default value is 0. Number of + prompt tokens written to cache. Required. + "cache_creation": { + "ephemeral_1h_input_tokens": 0, # Default value is 0. Number + of prompt tokens written to 1h cache. Required. + "ephemeral_5m_input_tokens": 0 # Default value is 0. Number + of prompt tokens written to 5m cache. Required. + }, + "cache_read_input_tokens": 0, # Default value is 0. Number of prompt + tokens read from cache. Required. + "completion_tokens": 0, # Default value is 0. Number of tokens in + the generated completion. Required. + "prompt_tokens": 0, # Default value is 0. Number of tokens in the + prompt. Required. + "total_tokens": 0 # Default value is 0. Total number of tokens used + in the request (prompt + completion). Required. + } + } + """ + + @distributed_trace + def create_chat_completion( + self, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a model response for the given chat conversation. + + Creates a model response for the given chat conversation. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :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 = { + "messages": [ + { + "role": "str", # The role of the message author. Required. + Known values are: "system", "developer", "user", "assistant", and "tool". + "content": "str", # Optional. The contents of the message. + "reasoning_content": "str", # Optional. The reasoning + content generated by the model (assistant messages only). + "refusal": "str", # Optional. The refusal message generated + by the model (assistant messages only). + "tool_call_id": "str", # Optional. Tool call that this + message is responding to (tool messages only). + "tool_calls": [ + { + "function": { + "arguments": "str", # The arguments + to call the function with, as generated by the model in JSON + format. Required. + "name": "str" # The name of the + function to call. Required. + }, + "id": "str", # The ID of the tool call. + Required. + "type": "str" # The type of the tool. + Currently, only function is supported. Required. "function" + } + ] + } + ], + "model": "str", # Model ID used to generate the response. Required. + "frequency_penalty": 0, # Optional. Default value is 0. Number between -2.0 + and 2.0. Positive values penalize new tokens based on their existing frequency in + the text so far, decreasing the model's likelihood to repeat the same line + verbatim. + "logit_bias": { + "str": 0 # Optional. Modify the likelihood of specified tokens + appearing in the completion. Accepts a JSON object that maps tokens + (specified by their token ID in the tokenizer) to an associated bias value + from -100 to 100. Mathematically, the bias is added to the logits generated + by the model prior to sampling. The exact effect will vary per model, but + values between -1 and 1 should decrease or increase likelihood of selection; + values like -100 or 100 should result in a ban or exclusive selection of the + relevant token. + }, + "logprobs": False, # Optional. Default value is False. Whether to return log + probabilities of the output tokens or not. If true, returns the log probabilities + of each output token returned in the content of message. + "max_completion_tokens": 0, # Optional. The maximum number of completion + tokens that may be used over the course of the run. The run will make a best + effort to use only the number of completion tokens specified, across multiple + turns of the run. + "max_tokens": 0, # Optional. The maximum number of tokens that can be + generated in the completion. The token count of your prompt plus max_tokens + cannot exceed the model's context length. + "metadata": { + "str": "str" # Optional. Set of 16 key-value pairs that can be + attached to an object. This can be useful for storing additional information + about the object in a structured format. Keys are strings with a maximum + length of 64 characters. Values are strings with a maximum length of 512 + characters. + }, + "n": 1, # Optional. Default value is 1. How many chat completion choices to + generate for each input message. Note that you will be charged based on the + number of generated tokens across all of the choices. Keep n as 1 to minimize + costs. + "presence_penalty": 0, # Optional. Default value is 0. Number between -2.0 + and 2.0. Positive values penalize new tokens based on whether they appear in the + text so far, increasing the model's likelihood to talk about new topics. + "reasoning_effort": "str", # Optional. Constrains effort on reasoning for + reasoning models. Reducing reasoning effort can result in faster responses and + fewer tokens used on reasoning in a response. Known values are: "none", + "minimal", "low", "medium", "high", and "xhigh". + "seed": 0, # Optional. If specified, the system will make a best effort to + sample deterministically, such that repeated requests with the same seed and + parameters should return the same result. Determinism is not guaranteed. + "stop": {}, + "stream": False, # Optional. Default value is False. If set to true, the + model response data will be streamed to the client as it is generated using + server-sent events. + "stream_options": { + "include_usage": bool # Optional. If set, an additional chunk will + be streamed before the data [DONE] message. The usage field on this chunk + shows the token usage statistics for the entire request, and the choices + field will always be an empty array. + }, + "temperature": 0.0, # Optional. What sampling temperature to use, between 0 + and 2. Higher values like 0.8 will make the output more random, while lower + values like 0.2 will make it more focused and deterministic. We generally + recommend altering this or top_p but not both. + "tool_choice": {}, + "tools": [ + { + "function": { + "name": "str", # The name of the function to be + called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, + with a maximum length of 64. Required. + "description": "str", # Optional. A description of + what the function does, used by the model to choose when and how to + call the function. + "parameters": { + "str": {} # Optional. The parameters the + function accepts, described as a JSON Schema object. + } + }, + "type": "str" # The type of the tool. Currently, only + function is supported. Required. "function" + } + ], + "top_logprobs": 0, # Optional. An integer between 0 and 20 specifying the + number of most likely tokens to return at each token position, each with an + associated log probability. logprobs must be set to true if this parameter is + used. + "top_p": 0.0, # Optional. An alternative to sampling with temperature, + called nucleus sampling, where the model considers the results of the tokens with + top_p probability mass. So 0.1 means only the tokens comprising the top 10% + probability mass are considered. We generally recommend altering this or + temperature but not both. + "user": "str" # Optional. A unique identifier representing your end-user, + which can help DigitalOcean to monitor and detect abuse. + } + + # response body for status code(s): 200 + response == { + "choices": [ + { + "finish_reason": "str", # The reason the model stopped + generating tokens. stop if the model hit a natural stop point or a + provided stop sequence, length if the maximum number of tokens specified + in the request was reached, tool_calls if the model called a tool. + Required. Known values are: "stop", "length", "tool_calls", and + "content_filter". + "index": 0, # The index of the choice in the list of + choices. Required. + "logprobs": { + "content": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ], + "refusal": [ + { + "bytes": [ + 0 # A list of integers + representing the UTF-8 bytes representation of the token. + Can be null if there is no bytes representation for the + token. Required. + ], + "logprob": 0.0, # The log + probability of this token, if it is within the top 20 most + likely tokens. Otherwise, the value -9999.0 is used to + signify that the token is very unlikely. Required. + "token": "str", # The token. + Required. + "top_logprobs": [ + { + "bytes": [ + 0 # + Required. + ], + "logprob": 0.0, # + The log probability of this token. Required. + "token": "str" # The + token. Required. + } + ] + } + ] + }, + "message": { + "content": "str", # The contents of the message. + Required. + "reasoning_content": "str", # The reasoning content + generated by the model. Required. + "refusal": "str", # The refusal message generated by + the model. Required. + "role": "str", # The role of the author of this + message. Required. "assistant" + "tool_calls": [ + { + "function": { + "arguments": "str", # The + arguments to call the function with. Required. + "name": "str" # The name of + the function to call. Required. + }, + "id": "str", # The ID of the tool + call. Required. + "type": "str" # The type of the + tool. Required. "function" + } + ] + } + } + ], + "created": 0, # The Unix timestamp (in seconds) of when the chat completion + was created. Required. + "id": "str", # A unique identifier for the chat completion. Required. + "model": "str", # The model used for the chat completion. Required. + "object": "str", # The object type, which is always chat.completion. + Required. "chat.completion" + "usage": { + "cache_created_input_tokens": 0, # Default value is 0. Number of + prompt tokens written to cache. Required. + "cache_creation": { + "ephemeral_1h_input_tokens": 0, # Default value is 0. Number + of prompt tokens written to 1h cache. Required. + "ephemeral_5m_input_tokens": 0 # Default value is 0. Number + of prompt tokens written to 5m cache. Required. + }, + "cache_read_input_tokens": 0, # Default value is 0. Number of prompt + tokens read from cache. Required. + "completion_tokens": 0, # Default value is 0. Number of tokens in + the generated completion. Required. + "prompt_tokens": 0, # Default value is 0. Number of tokens in the + prompt. Required. + "total_tokens": 0 # Default value is 0. Total number of tokens used + in the request (prompt + completion). Required. + } + } + """ + 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: + _json = body + + _request = build_inference_create_chat_completion_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]: + 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 = {} + 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_messages( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create the next assistant message. + + Send a structured list of input messages with text and/or image content, and the model will + generate the next message in the conversation. + + :param body: Required. + :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 = { + "max_tokens": 0, # Maximum tokens to generate before stopping. Required. + "messages": [ + { + "content": {}, + "role": "str" # Speaker role for this message. Required. + Known values are: "user" and "assistant". + } + ], + "model": "str", # Model ID (for example ``claude-opus-4-6`` or a serverless + model id). Required. + "metadata": { + "user_id": "str" # Optional. Opaque identifier for the end user (for + example a UUID or hash). Do not include PII. + }, + "reasoning_effort": "str", # Optional. DigitalOcean extension for + reasoning-capable models. Ignored by executors that do not support it. Known + values are: "none", "minimal", "low", "medium", "high", and "xhigh". + "speed": "str", # Optional. DigitalOcean extension for preferred inference + speed. Ignored when not supported. Known values are: "standard" and "fast". + "stop_sequences": [ + "str" # Optional. Custom strings that stop generation when produced. + ], + "stream": False, # Optional. Default value is False. When true, the response + is streamed using server-sent events (SSE). + "system": {}, + "temperature": 0.0, # Optional. Sampling temperature between 0.0 and 1.0. + "thinking": { + "type": "str" # Thinking mode discriminator (for example enabled or + disabled). Required. + }, + "tool_choice": {}, + "tools": [ + { + "input_schema": { + "str": {} # JSON Schema (draft 2020-12 style) + describing the tool input object. Required. + }, + "name": "str", # Tool name referenced in ``tool_use`` + blocks. Required. + "description": "str" # Optional. Human-readable description + of what the tool does. + } + ], + "top_k": 0, # Optional. Top-K sampling cutoff. + "top_p": 0.0 # Optional. Nucleus sampling; use either ``temperature`` or + ``top_p``"" , not both. + } + + # response body for status code(s): 200 + response == { + "content": [ + {} + ], + "id": "str", # Unique identifier for this message object. Required. + "model": "str", # Model that produced the message. Required. + "role": "str", # Always ``assistant`` for this response. Required. + "assistant" + "stop_reason": "str", # Why generation stopped. Required. Known values are: + "end_turn", "max_tokens", "stop_sequence", and "tool_use". + "type": "str", # Object type discriminator. Required. "message" + "usage": { + "input_tokens": 0, # Number of input tokens billed for this request. + Required. + "output_tokens": 0, # Number of output tokens generated. Required. + "cache_creation_input_tokens": 0, # Optional. Input tokens used to + create a prompt cache entry, if applicable. + "cache_read_input_tokens": 0, # Optional. Input tokens read from a + prompt cache, if applicable. + "speed": "str" # Optional. Inference speed tier reflected in billing + or routing. Known values are: "standard" and "fast". + }, + "stop_sequence": "str" # Optional. When ``stop_reason`` is + ``stop_sequence``"" , the sequence that matched. + } + # response body for status code(s): 400 + response == { + "error": { + "message": "str", # Human-readable error message. Required. + "type": "str" # Machine-readable error code. Required. + }, + "type": "str" # Required. "error" + } + """ + + @overload + def create_messages( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create the next assistant message. + + Send a structured list of input messages with text and/or image content, and the model will + generate the next message in the conversation. + + :param body: Required. + :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 == { + "content": [ + {} + ], + "id": "str", # Unique identifier for this message object. Required. + "model": "str", # Model that produced the message. Required. + "role": "str", # Always ``assistant`` for this response. Required. + "assistant" + "stop_reason": "str", # Why generation stopped. Required. Known values are: + "end_turn", "max_tokens", "stop_sequence", and "tool_use". + "type": "str", # Object type discriminator. Required. "message" + "usage": { + "input_tokens": 0, # Number of input tokens billed for this request. + Required. + "output_tokens": 0, # Number of output tokens generated. Required. + "cache_creation_input_tokens": 0, # Optional. Input tokens used to + create a prompt cache entry, if applicable. + "cache_read_input_tokens": 0, # Optional. Input tokens read from a + prompt cache, if applicable. + "speed": "str" # Optional. Inference speed tier reflected in billing + or routing. Known values are: "standard" and "fast". + }, + "stop_sequence": "str" # Optional. When ``stop_reason`` is + ``stop_sequence``"" , the sequence that matched. + } + # response body for status code(s): 400 + response == { + "error": { + "message": "str", # Human-readable error message. Required. + "type": "str" # Machine-readable error code. Required. + }, + "type": "str" # Required. "error" + } + """ + + @distributed_trace + def create_messages(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create the next assistant message. + + Send a structured list of input messages with text and/or image content, and the model will + generate the next message in the conversation. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :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 = { + "max_tokens": 0, # Maximum tokens to generate before stopping. Required. + "messages": [ + { + "content": {}, + "role": "str" # Speaker role for this message. Required. + Known values are: "user" and "assistant". + } + ], + "model": "str", # Model ID (for example ``claude-opus-4-6`` or a serverless + model id). Required. + "metadata": { + "user_id": "str" # Optional. Opaque identifier for the end user (for + example a UUID or hash). Do not include PII. + }, + "reasoning_effort": "str", # Optional. DigitalOcean extension for + reasoning-capable models. Ignored by executors that do not support it. Known + values are: "none", "minimal", "low", "medium", "high", and "xhigh". + "speed": "str", # Optional. DigitalOcean extension for preferred inference + speed. Ignored when not supported. Known values are: "standard" and "fast". + "stop_sequences": [ + "str" # Optional. Custom strings that stop generation when produced. + ], + "stream": False, # Optional. Default value is False. When true, the response + is streamed using server-sent events (SSE). + "system": {}, + "temperature": 0.0, # Optional. Sampling temperature between 0.0 and 1.0. + "thinking": { + "type": "str" # Thinking mode discriminator (for example enabled or + disabled). Required. + }, + "tool_choice": {}, + "tools": [ + { + "input_schema": { + "str": {} # JSON Schema (draft 2020-12 style) + describing the tool input object. Required. + }, + "name": "str", # Tool name referenced in ``tool_use`` + blocks. Required. + "description": "str" # Optional. Human-readable description + of what the tool does. + } + ], + "top_k": 0, # Optional. Top-K sampling cutoff. + "top_p": 0.0 # Optional. Nucleus sampling; use either ``temperature`` or + ``top_p``"" , not both. + } + + # response body for status code(s): 200 + response == { + "content": [ + {} + ], + "id": "str", # Unique identifier for this message object. Required. + "model": "str", # Model that produced the message. Required. + "role": "str", # Always ``assistant`` for this response. Required. + "assistant" + "stop_reason": "str", # Why generation stopped. Required. Known values are: + "end_turn", "max_tokens", "stop_sequence", and "tool_use". + "type": "str", # Object type discriminator. Required. "message" + "usage": { + "input_tokens": 0, # Number of input tokens billed for this request. + Required. + "output_tokens": 0, # Number of output tokens generated. Required. + "cache_creation_input_tokens": 0, # Optional. Input tokens used to + create a prompt cache entry, if applicable. + "cache_read_input_tokens": 0, # Optional. Input tokens read from a + prompt cache, if applicable. + "speed": "str" # Optional. Inference speed tier reflected in billing + or routing. Known values are: "standard" and "fast". + }, + "stop_sequence": "str" # Optional. When ``stop_reason`` is + ``stop_sequence``"" , the sequence that matched. + } + # response body for status code(s): 400 + response == { + "error": { + "message": "str", # Human-readable error message. Required. + "type": "str" # Machine-readable error code. Required. + }, + "type": "str" # Required. "error" + } + """ + 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: + _json = body + + _request = build_inference_create_messages_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, 400]: + 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 == 400: + 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_embedding( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create embedding. + + Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. + Unknown fields in the request body are rejected. There is no streaming response for this + endpoint. + + :param body: Required. + :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 = { + "input": {}, + "model": "str", # Model id to use for embeddings. Must match a model your + account can access. Required. + "encoding_format": "float", # Optional. Default value is "float". How + embedding values are returned in each ``data[].embedding`` field. Known values + are: "float" and "base64". + "user": "str" # Optional. Optional end-user identifier to help with abuse + monitoring. + } + + # response body for status code(s): 200 + response == { + "data": [ + { + "embedding": {}, + "index": 0, # Zero-based index of the corresponding + ``input`` item (0 when ``input`` is a string). Required. + "object": "str" # The object type, which is always + ``embedding``. Required. "embedding" + } + ], + "model": "str", # The embedding model that produced the vectors. Required. + "object": "str", # The object type, which is always the string ``list``. + Required. "list" + "usage": { + "prompt_tokens": 0, # Number of input tokens used for the embedding. + Required. + "total_tokens": 0 # Total billable tokens for the request. Required. + } + } + """ + + @overload + def create_embedding( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create embedding. + + Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. + Unknown fields in the request body are rejected. There is no streaming response for this + endpoint. + + :param body: Required. + :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 == { + "data": [ + { + "embedding": {}, + "index": 0, # Zero-based index of the corresponding + ``input`` item (0 when ``input`` is a string). Required. + "object": "str" # The object type, which is always + ``embedding``. Required. "embedding" + } + ], + "model": "str", # The embedding model that produced the vectors. Required. + "object": "str", # The object type, which is always the string ``list``. + Required. "list" + "usage": { + "prompt_tokens": 0, # Number of input tokens used for the embedding. + Required. + "total_tokens": 0 # Total billable tokens for the request. Required. + } + } + """ + + @distributed_trace + def create_embedding(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create embedding. + + Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. + Unknown fields in the request body are rejected. There is no streaming response for this + endpoint. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :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 = { + "input": {}, + "model": "str", # Model id to use for embeddings. Must match a model your + account can access. Required. + "encoding_format": "float", # Optional. Default value is "float". How + embedding values are returned in each ``data[].embedding`` field. Known values + are: "float" and "base64". + "user": "str" # Optional. Optional end-user identifier to help with abuse + monitoring. + } + + # response body for status code(s): 200 + response == { + "data": [ + { + "embedding": {}, + "index": 0, # Zero-based index of the corresponding + ``input`` item (0 when ``input`` is a string). Required. + "object": "str" # The object type, which is always + ``embedding``. Required. "embedding" + } + ], + "model": "str", # The embedding model that produced the vectors. Required. + "object": "str", # The object type, which is always the string ``list``. + Required. "list" + "usage": { + "prompt_tokens": 0, # Number of input tokens used for the embedding. + Required. + "total_tokens": 0 # Total billable tokens for the request. Required. + } + } + """ + 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: + _json = body + + _request = build_inference_create_embedding_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]: + 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 = {} + 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_image( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Generate images from text prompts. + + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation + model with automatic prompt optimization and enhanced visual capabilities. + + :param body: Required. + :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 = { + "model": "str", # The model to use for image generation. Required. + "n": 0, # The number of images to generate. Must be between 1 and 10. + Required. + "prompt": "str", # A text description of the desired image(s). Supports up + to 32,000 characters and provides automatic prompt optimization for best results. + Required. + "background": "str", # Optional. The background setting for the image + generation. Supported values: transparent, opaque, auto. + "moderation": "str", # Optional. The moderation setting for the image + generation. Supported values: low, auto. + "output_compression": 0, # Optional. The output compression level for the + image generation (0-100). + "output_format": "str", # Optional. The output format for the image + generation. Supported values: png, webp, jpeg. + "partial_images": 0, # Optional. The number of partial image chunks to + return during streaming generation. Defaults to 0. When stream=true, this must be + greater than 0 to receive progressive updates of the image as it is being + generated. + "quality": "str", # Optional. The quality of the image that will be + generated. Supported values: auto, high, medium, low. + "size": "str", # Optional. The size of the generated images. GPT-IMAGE-1 + supports: auto (automatically select best size), 1536x1024 (landscape), 1024x1536 + (portrait). Known values are: "auto", "1536x1024", and "1024x1536". + "stream": False, # Optional. Default value is False. If set to true, partial + image data will be streamed as the image is being generated. The response will be + sent as server-sent events with partial image chunks. When stream is true, + partial_images must be greater than 0. + "user": "str" # Optional. A unique identifier representing your end-user, + which can help DigitalOcean to monitor and detect abuse. + } + + # response body for status code(s): 200 + response == { + "created": 0, # The Unix timestamp (in seconds) of when the images were + created. Required. + "data": [ + { + "b64_json": "str", # The base64-encoded JSON of the + generated image. Required. + "revised_prompt": "str" # Optional. The optimized prompt + that was used to generate the image. + } + ], + "background": "str", # Optional. The background setting used for the image + generation. + "output_format": "str", # Optional. The output format of the generated + image. + "quality": "str", # Optional. The quality setting used for the image + generation. + "size": "str", # Optional. The size of the generated image. + "usage": { + "input_tokens": 0, # The number of tokens (images and text) in the + input prompt. Required. + "input_tokens_details": { + "image_tokens": 0, # The number of image tokens in the input + prompt. Required. + "text_tokens": 0 # The number of text tokens in the input + prompt. Required. + }, + "output_tokens": 0, # The number of image tokens in the output + image. Required. + "total_tokens": 0 # The total number of tokens (images and text) + used for the image generation. Required. + } + } + """ + + @overload + def create_image( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + """Generate images from text prompts. + + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation + model with automatic prompt optimization and enhanced visual capabilities. + + :param body: Required. + :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 == { - "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. + "created": 0, # The Unix timestamp (in seconds) of when the images were + created. Required. + "data": [ + { + "b64_json": "str", # The base64-encoded JSON of the + generated image. Required. + "revised_prompt": "str" # Optional. The optimized prompt + that was used to generate the image. + } + ], + "background": "str", # Optional. The background setting used for the image + generation. + "output_format": "str", # Optional. The output format of the generated + image. + "quality": "str", # Optional. The quality setting used for the image + generation. + "size": "str", # Optional. The size of the generated image. + "usage": { + "input_tokens": 0, # The number of tokens (images and text) in the + input prompt. Required. + "input_tokens_details": { + "image_tokens": 0, # The number of image tokens in the input + prompt. Required. + "text_tokens": 0 # The number of text tokens in the input + prompt. Required. + }, + "output_tokens": 0, # The number of image tokens in the output + image. Required. + "total_tokens": 0 # The total number of tokens (images and text) + used for the image generation. Required. + } + } + """ + + @distributed_trace + def create_image(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Generate images from text prompts. + + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation + model with automatic prompt optimization and enhanced visual capabilities. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :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 = { + "model": "str", # The model to use for image generation. Required. + "n": 0, # The number of images to generate. Must be between 1 and 10. + Required. + "prompt": "str", # A text description of the desired image(s). Supports up + to 32,000 characters and provides automatic prompt optimization for best results. + Required. + "background": "str", # Optional. The background setting for the image + generation. Supported values: transparent, opaque, auto. + "moderation": "str", # Optional. The moderation setting for the image + generation. Supported values: low, auto. + "output_compression": 0, # Optional. The output compression level for the + image generation (0-100). + "output_format": "str", # Optional. The output format for the image + generation. Supported values: png, webp, jpeg. + "partial_images": 0, # Optional. The number of partial image chunks to + return during streaming generation. Defaults to 0. When stream=true, this must be + greater than 0 to receive progressive updates of the image as it is being + generated. + "quality": "str", # Optional. The quality of the image that will be + generated. Supported values: auto, high, medium, low. + "size": "str", # Optional. The size of the generated images. GPT-IMAGE-1 + supports: auto (automatically select best size), 1536x1024 (landscape), 1024x1536 + (portrait). Known values are: "auto", "1536x1024", and "1024x1536". + "stream": False, # Optional. Default value is False. If set to true, partial + image data will be streamed as the image is being generated. The response will be + sent as server-sent events with partial image chunks. When stream is true, + partial_images must be greater than 0. + "user": "str" # Optional. A unique identifier representing your end-user, + which can help DigitalOcean to monitor and detect abuse. + } + + # response body for status code(s): 200 + response == { + "created": 0, # The Unix timestamp (in seconds) of when the images were + created. Required. + "data": [ + { + "b64_json": "str", # The base64-encoded JSON of the + generated image. Required. + "revised_prompt": "str" # Optional. The optimized prompt + that was used to generate the image. + } + ], + "background": "str", # Optional. The background setting used for the image + generation. + "output_format": "str", # Optional. The output format of the generated + image. + "quality": "str", # Optional. The quality setting used for the image + generation. + "size": "str", # Optional. The size of the generated image. + "usage": { + "input_tokens": 0, # The number of tokens (images and text) in the + input prompt. Required. + "input_tokens_details": { + "image_tokens": 0, # The number of image tokens in the input + prompt. Required. + "text_tokens": 0 # The number of text tokens in the input + prompt. Required. + }, + "output_tokens": 0, # The number of image tokens in the output + image. Required. + "total_tokens": 0 # The total number of tokens (images and text) + used for the image generation. Required. + } } """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -268375,13 +271612,9 @@ def update_agents_workspace( if isinstance(body, (IOBase, bytes)): _content = body else: - if body is not None: - _json = body - else: - _json = None + _json = body - _request = build_genai_update_agents_workspace_request( - workspace_uuid=workspace_uuid, + _request = build_inference_create_image_request( content_type=content_type, json=_json, content=_content, @@ -268399,44 +271632,27 @@ def update_agents_workspace( response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: 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") - ) + 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.content: + deserialized = response.json() + else: + deserialized = None if cls: return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore @@ -268444,17 +271660,12 @@ def update_agents_workspace( return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_evaluation_test_cases_by_workspace( - self, workspace_uuid: str, **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """List Evaluation Test Cases by Workspace. + def list_models(self, **kwargs: Any) -> JSON: + """List available models. - To list all evaluation test cases by a workspace, send a GET request to - ``/v2/gen-ai/workspaces/{workspace_uuid}/evaluation_test_cases``. + Lists the currently available models, and provides basic information about each one such as the + owner and availability. - :param workspace_uuid: Workspace UUID. Required. - :type workspace_uuid: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -268464,91 +271675,19 @@ def list_evaluation_test_cases_by_workspace( # response body for status code(s): 200 response == { - "evaluation_test_cases": [ + "data": [ { - "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": [ - { - "category": "METRIC_CATEGORY_UNSPECIFIED", # - Optional. Default value is "METRIC_CATEGORY_UNSPECIFIED". Known - values are: "METRIC_CATEGORY_UNSPECIFIED", - "METRIC_CATEGORY_CORRECTNESS", "METRIC_CATEGORY_USER_OUTCOMES", - "METRIC_CATEGORY_SAFETY_AND_SECURITY", - "METRIC_CATEGORY_CONTEXT_QUALITY", and - "METRIC_CATEGORY_MODEL_FIT". - "description": "str", # Optional. - "inverted": bool, # Optional. If true, the - metric is inverted, meaning that a lower value is better. - "is_metric_goal": bool, # Optional. - "metric_name": "str", # Optional. - "metric_rank": 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. - "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. + "created": 0, # The Unix timestamp (in seconds) when the + model was created. Required. + "id": "str", # The model identifier, which can be referenced + in the API endpoints. Required. + "object": "str", # The object type, which is always "model". + Required. "model" + "owned_by": "str" # The organization that owns the model. + Required. } - ] - } - # 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. + ], + "object": "str" # The object type, which is always "list". Required. "list" } """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -268569,8 +271708,7 @@ def list_evaluation_test_cases_by_workspace( cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_genai_list_evaluation_test_cases_by_workspace_request( - workspace_uuid=workspace_uuid, + _request = build_inference_list_models_request( headers=_headers, params=_params, ) @@ -268585,78 +271723,42 @@ def list_evaluation_test_cases_by_workspace( response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: 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") - ) + 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.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 - -class InferenceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~pydo.GeneratedClient`'s - :attr:`inference` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = ( - input_args.pop(0) if input_args else kwargs.pop("deserializer") - ) - @overload - def create_chat_completion( + def create_response( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a model response for the given chat conversation. + """Send Prompt to a Model Using the Responses API. - Creates a model response for the given chat conversation. + Generate text responses from text prompts. This endpoint supports both streaming and + non-streaming responses for supported text models. :param body: Required. :type body: JSON @@ -268672,257 +271774,129 @@ def create_chat_completion( # JSON input template you can fill out and use as your body input. body = { - "messages": [ - { - "role": "str", # The role of the message author. Required. - Known values are: "system", "developer", "user", "assistant", and "tool". - "content": "str", # Optional. The contents of the message. - "reasoning_content": "str", # Optional. The reasoning - content generated by the model (assistant messages only). - "refusal": "str", # Optional. The refusal message generated - by the model (assistant messages only). - "tool_call_id": "str", # Optional. Tool call that this - message is responding to (tool messages only). - "tool_calls": [ - { - "function": { - "arguments": "str", # The arguments - to call the function with, as generated by the model in JSON - format. Required. - "name": "str" # The name of the - function to call. Required. - }, - "id": "str", # The ID of the tool call. - Required. - "type": "str" # The type of the tool. - Currently, only function is supported. Required. "function" - } - ] - } - ], - "model": "str", # Model ID used to generate the response. Required. - "frequency_penalty": 0, # Optional. Default value is 0. Number between -2.0 - and 2.0. Positive values penalize new tokens based on their existing frequency in - the text so far, decreasing the model's likelihood to repeat the same line - verbatim. - "logit_bias": { - "str": 0 # Optional. Modify the likelihood of specified tokens - appearing in the completion. Accepts a JSON object that maps tokens - (specified by their token ID in the tokenizer) to an associated bias value - from -100 to 100. Mathematically, the bias is added to the logits generated - by the model prior to sampling. The exact effect will vary per model, but - values between -1 and 1 should decrease or increase likelihood of selection; - values like -100 or 100 should result in a ban or exclusive selection of the - relevant token. - }, - "logprobs": False, # Optional. Default value is False. Whether to return log - probabilities of the output tokens or not. If true, returns the log probabilities - of each output token returned in the content of message. - "max_completion_tokens": 0, # Optional. The maximum number of completion - tokens that may be used over the course of the run. The run will make a best - effort to use only the number of completion tokens specified, across multiple - turns of the run. - "max_tokens": 0, # Optional. The maximum number of tokens that can be - generated in the completion. The token count of your prompt plus max_tokens - cannot exceed the model's context length. + "input": {}, + "model": "str", # The model ID of the model you want to use. Get the model + ID using ``/v1/models`` or on the available models page. Required. + "instructions": "str", # Optional. System-level instructions for the model. + This sets the behavior and context for the response generation. + "max_output_tokens": 0, # Optional. The maximum number of tokens to generate + in the response. "metadata": { - "str": "str" # Optional. Set of 16 key-value pairs that can be - attached to an object. This can be useful for storing additional information - about the object in a structured format. Keys are strings with a maximum - length of 64 characters. Values are strings with a maximum length of 512 - characters. + "str": "str" # Optional. Set of key-value pairs that can be attached + to the request. }, - "n": 1, # Optional. Default value is 1. How many chat completion choices to - generate for each input message. Note that you will be charged based on the - number of generated tokens across all of the choices. Keep n as 1 to minimize - costs. - "presence_penalty": 0, # Optional. Default value is 0. Number between -2.0 - and 2.0. Positive values penalize new tokens based on whether they appear in the - text so far, increasing the model's likelihood to talk about new topics. - "reasoning_effort": "str", # Optional. Constrains effort on reasoning for - reasoning models. Reducing reasoning effort can result in faster responses and - fewer tokens used on reasoning in a response. Known values are: "none", - "minimal", "low", "medium", "high", and "xhigh". - "seed": 0, # Optional. If specified, the system will make a best effort to - sample deterministically, such that repeated requests with the same seed and - parameters should return the same result. Determinism is not guaranteed. "stop": {}, - "stream": False, # Optional. Default value is False. If set to true, the - model response data will be streamed to the client as it is generated using - server-sent events. + "stream": False, # Optional. Default value is False. Set to true to stream + partial responses as Server-Sent Events. "stream_options": { "include_usage": bool # Optional. If set, an additional chunk will - be streamed before the data [DONE] message. The usage field on this chunk - shows the token usage statistics for the entire request, and the choices - field will always be an empty array. + be streamed before the data: [DONE] message with token usage statistics for + the entire request. }, - "temperature": 0.0, # Optional. What sampling temperature to use, between 0 - and 2. Higher values like 0.8 will make the output more random, while lower - values like 0.2 will make it more focused and deterministic. We generally - recommend altering this or top_p but not both. + "temperature": 0.0, # Optional. A value between 0.0 and 2.0 to control + randomness and creativity. Lower values like 0.2 make the output more focused and + deterministic, while higher values like 0.8 make it more random. "tool_choice": {}, "tools": [ { - "function": { - "name": "str", # The name of the function to be - called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, - with a maximum length of 64. Required. - "description": "str", # Optional. A description of - what the function does, used by the model to choose when and how to - call the function. - "parameters": { - "str": {} # Optional. The parameters the - function accepts, described as a JSON Schema object. - } - }, - "type": "str" # The type of the tool. Currently, only - function is supported. Required. "function" + "type": "str", # The type of the tool. Required. "function" + "description": "str", # Optional. A description of what the + function does. + "name": "str", # Optional. The name of the function to be + called. + "parameters": { + "str": {} # Optional. The parameters the function + accepts, described as a JSON Schema object. + } } ], - "top_logprobs": 0, # Optional. An integer between 0 and 20 specifying the - number of most likely tokens to return at each token position, each with an - associated log probability. logprobs must be set to true if this parameter is - used. "top_p": 0.0, # Optional. An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with - top_p probability mass. So 0.1 means only the tokens comprising the top 10% - probability mass are considered. We generally recommend altering this or - temperature but not both. - "user": "str" # Optional. A unique identifier representing your end-user, - which can help DigitalOcean to monitor and detect abuse. + top_p probability mass. + "user": "str" # Optional. A unique identifier representing your end-user. } # response body for status code(s): 200 response == { - "choices": [ + "created": 0, # The Unix timestamp (in seconds) of when the response was + created. Required. + "id": "str", # A unique identifier for the response. Required. + "model": "str", # The model used to generate the response. Required. + "object": "str", # The object type, which is always ``response``. Required. + "response" + "output": [ { - "finish_reason": "str", # The reason the model stopped - generating tokens. stop if the model hit a natural stop point or a - provided stop sequence, length if the maximum number of tokens specified - in the request was reached, tool_calls if the model called a tool. - Required. Known values are: "stop", "length", "tool_calls", and - "content_filter". - "index": 0, # The index of the choice in the list of - choices. Required. - "logprobs": { - "content": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ], - "refusal": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ] - }, - "message": { - "content": "str", # The contents of the message. - Required. - "reasoning_content": "str", # The reasoning content - generated by the model. Required. - "refusal": "str", # The refusal message generated by - the model. Required. - "role": "str", # The role of the author of this - message. Required. "assistant" - "tool_calls": [ - { - "function": { - "arguments": "str", # The - arguments to call the function with. Required. - "name": "str" # The name of - the function to call. Required. - }, - "id": "str", # The ID of the tool - call. Required. - "type": "str" # The type of the - tool. Required. "function" - } - ] - } + "content": [ + { + "text": "str", # The text content. Required. + "type": "str" # The type of content part. + ``reasoning_text`` for reasoning content, ``output_text`` for + final output text. Required. Known values are: "reasoning_text" + and "output_text". + } + ], + "type": "str", # The type of output item. One of + ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known + values are: "reasoning", "message", and "function_call". + "arguments": "str", # Optional. JSON string of function + arguments (present when type is ``function_call``"" ). + "call_id": "str", # Optional. The unique ID of the function + tool call (present when type is ``function_call``"" ). + "id": "str", # Optional. The unique ID of the output item. + "name": "str", # Optional. The name of the function to call + (present when type is ``function_call``"" ). + "role": "str", # Optional. The role associated with this + output item (typically ``assistant``"" ). + "status": "str" # Optional. Status of the item. } ], - "created": 0, # The Unix timestamp (in seconds) of when the chat completion - was created. Required. - "id": "str", # A unique identifier for the chat completion. Required. - "model": "str", # The model used for the chat completion. Required. - "object": "str", # The object type, which is always chat.completion. - Required. "chat.completion" "usage": { - "cache_created_input_tokens": 0, # Default value is 0. Number of - prompt tokens written to cache. Required. - "cache_creation": { - "ephemeral_1h_input_tokens": 0, # Default value is 0. Number - of prompt tokens written to 1h cache. Required. - "ephemeral_5m_input_tokens": 0 # Default value is 0. Number - of prompt tokens written to 5m cache. Required. + "input_tokens": 0, # The number of input tokens. Required. + "input_tokens_details": { + "cached_tokens": 0 # The number of tokens that were + retrieved from the cache. Required. }, - "cache_read_input_tokens": 0, # Default value is 0. Number of prompt - tokens read from cache. Required. - "completion_tokens": 0, # Default value is 0. Number of tokens in - the generated completion. Required. - "prompt_tokens": 0, # Default value is 0. Number of tokens in the - prompt. Required. - "total_tokens": 0 # Default value is 0. Total number of tokens used - in the request (prompt + completion). Required. - } + "output_tokens": 0, # The number of output tokens. Required. + "output_tokens_details": { + "reasoning_tokens": 0, # The number of reasoning tokens. + Required. + "tool_output_tokens": 0 # The number of tool output tokens. + Required. + }, + "total_tokens": 0 # The total number of tokens used. Required. + }, + "max_output_tokens": 0, # Optional. Maximum output tokens setting. + "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are + enabled. + "status": "str", # Optional. Status of the response. + "temperature": 0.0, # Optional. Temperature setting used for the response. + "tool_choice": "str", # Optional. Tool choice setting used for the response. + "tools": [ + { + "type": "str", # The type of the tool. Required. "function" + "description": "str", # Optional. A description of what the + function does. + "name": "str", # Optional. The name of the function. + "parameters": { + "str": {} # Optional. The parameters the function + accepts. + } + } + ], + "top_p": 0.0, # Optional. Top-p setting used for the response. + "user": "str" # Optional. User identifier. } """ @overload - def create_chat_completion( + def create_response( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create a model response for the given chat conversation. + """Send Prompt to a Model Using the Responses API. - Creates a model response for the given chat conversation. + Generate text responses from text prompts. This endpoint supports both streaming and + non-streaming responses for supported text models. :param body: Required. :type body: IO[bytes] @@ -268938,387 +271912,206 @@ def create_chat_completion( # response body for status code(s): 200 response == { - "choices": [ - { - "finish_reason": "str", # The reason the model stopped - generating tokens. stop if the model hit a natural stop point or a - provided stop sequence, length if the maximum number of tokens specified - in the request was reached, tool_calls if the model called a tool. - Required. Known values are: "stop", "length", "tool_calls", and - "content_filter". - "index": 0, # The index of the choice in the list of - choices. Required. - "logprobs": { - "content": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ], - "refusal": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ] - }, - "message": { - "content": "str", # The contents of the message. - Required. - "reasoning_content": "str", # The reasoning content - generated by the model. Required. - "refusal": "str", # The refusal message generated by - the model. Required. - "role": "str", # The role of the author of this - message. Required. "assistant" - "tool_calls": [ - { - "function": { - "arguments": "str", # The - arguments to call the function with. Required. - "name": "str" # The name of - the function to call. Required. - }, - "id": "str", # The ID of the tool - call. Required. - "type": "str" # The type of the - tool. Required. "function" - } - ] - } - } - ], - "created": 0, # The Unix timestamp (in seconds) of when the chat completion - was created. Required. - "id": "str", # A unique identifier for the chat completion. Required. - "model": "str", # The model used for the chat completion. Required. - "object": "str", # The object type, which is always chat.completion. - Required. "chat.completion" - "usage": { - "cache_created_input_tokens": 0, # Default value is 0. Number of - prompt tokens written to cache. Required. - "cache_creation": { - "ephemeral_1h_input_tokens": 0, # Default value is 0. Number - of prompt tokens written to 1h cache. Required. - "ephemeral_5m_input_tokens": 0 # Default value is 0. Number - of prompt tokens written to 5m cache. Required. - }, - "cache_read_input_tokens": 0, # Default value is 0. Number of prompt - tokens read from cache. Required. - "completion_tokens": 0, # Default value is 0. Number of tokens in - the generated completion. Required. - "prompt_tokens": 0, # Default value is 0. Number of tokens in the - prompt. Required. - "total_tokens": 0 # Default value is 0. Total number of tokens used - in the request (prompt + completion). Required. - } - } - """ - - @distributed_trace - def create_chat_completion( - self, body: Union[JSON, IO[bytes]], **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Create a model response for the given chat conversation. - - Creates a model response for the given chat conversation. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :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 = { - "messages": [ + "created": 0, # The Unix timestamp (in seconds) of when the response was + created. Required. + "id": "str", # A unique identifier for the response. Required. + "model": "str", # The model used to generate the response. Required. + "object": "str", # The object type, which is always ``response``. Required. + "response" + "output": [ { - "role": "str", # The role of the message author. Required. - Known values are: "system", "developer", "user", "assistant", and "tool". - "content": "str", # Optional. The contents of the message. - "reasoning_content": "str", # Optional. The reasoning - content generated by the model (assistant messages only). - "refusal": "str", # Optional. The refusal message generated - by the model (assistant messages only). - "tool_call_id": "str", # Optional. Tool call that this - message is responding to (tool messages only). - "tool_calls": [ + "content": [ { - "function": { - "arguments": "str", # The arguments - to call the function with, as generated by the model in JSON - format. Required. - "name": "str" # The name of the - function to call. Required. - }, - "id": "str", # The ID of the tool call. - Required. - "type": "str" # The type of the tool. - Currently, only function is supported. Required. "function" + "text": "str", # The text content. Required. + "type": "str" # The type of content part. + ``reasoning_text`` for reasoning content, ``output_text`` for + final output text. Required. Known values are: "reasoning_text" + and "output_text". } - ] + ], + "type": "str", # The type of output item. One of + ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known + values are: "reasoning", "message", and "function_call". + "arguments": "str", # Optional. JSON string of function + arguments (present when type is ``function_call``"" ). + "call_id": "str", # Optional. The unique ID of the function + tool call (present when type is ``function_call``"" ). + "id": "str", # Optional. The unique ID of the output item. + "name": "str", # Optional. The name of the function to call + (present when type is ``function_call``"" ). + "role": "str", # Optional. The role associated with this + output item (typically ``assistant``"" ). + "status": "str" # Optional. Status of the item. } ], - "model": "str", # Model ID used to generate the response. Required. - "frequency_penalty": 0, # Optional. Default value is 0. Number between -2.0 - and 2.0. Positive values penalize new tokens based on their existing frequency in - the text so far, decreasing the model's likelihood to repeat the same line - verbatim. - "logit_bias": { - "str": 0 # Optional. Modify the likelihood of specified tokens - appearing in the completion. Accepts a JSON object that maps tokens - (specified by their token ID in the tokenizer) to an associated bias value - from -100 to 100. Mathematically, the bias is added to the logits generated - by the model prior to sampling. The exact effect will vary per model, but - values between -1 and 1 should decrease or increase likelihood of selection; - values like -100 or 100 should result in a ban or exclusive selection of the - relevant token. + "usage": { + "input_tokens": 0, # The number of input tokens. Required. + "input_tokens_details": { + "cached_tokens": 0 # The number of tokens that were + retrieved from the cache. Required. + }, + "output_tokens": 0, # The number of output tokens. Required. + "output_tokens_details": { + "reasoning_tokens": 0, # The number of reasoning tokens. + Required. + "tool_output_tokens": 0 # The number of tool output tokens. + Required. + }, + "total_tokens": 0 # The total number of tokens used. Required. }, - "logprobs": False, # Optional. Default value is False. Whether to return log - probabilities of the output tokens or not. If true, returns the log probabilities - of each output token returned in the content of message. - "max_completion_tokens": 0, # Optional. The maximum number of completion - tokens that may be used over the course of the run. The run will make a best - effort to use only the number of completion tokens specified, across multiple - turns of the run. - "max_tokens": 0, # Optional. The maximum number of tokens that can be - generated in the completion. The token count of your prompt plus max_tokens - cannot exceed the model's context length. + "max_output_tokens": 0, # Optional. Maximum output tokens setting. + "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are + enabled. + "status": "str", # Optional. Status of the response. + "temperature": 0.0, # Optional. Temperature setting used for the response. + "tool_choice": "str", # Optional. Tool choice setting used for the response. + "tools": [ + { + "type": "str", # The type of the tool. Required. "function" + "description": "str", # Optional. A description of what the + function does. + "name": "str", # Optional. The name of the function. + "parameters": { + "str": {} # Optional. The parameters the function + accepts. + } + } + ], + "top_p": 0.0, # Optional. Top-p setting used for the response. + "user": "str" # Optional. User identifier. + } + """ + + @distributed_trace + def create_response(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Send Prompt to a Model Using the Responses API. + + Generate text responses from text prompts. This endpoint supports both streaming and + non-streaming responses for supported text models. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :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 = { + "input": {}, + "model": "str", # The model ID of the model you want to use. Get the model + ID using ``/v1/models`` or on the available models page. Required. + "instructions": "str", # Optional. System-level instructions for the model. + This sets the behavior and context for the response generation. + "max_output_tokens": 0, # Optional. The maximum number of tokens to generate + in the response. "metadata": { - "str": "str" # Optional. Set of 16 key-value pairs that can be - attached to an object. This can be useful for storing additional information - about the object in a structured format. Keys are strings with a maximum - length of 64 characters. Values are strings with a maximum length of 512 - characters. + "str": "str" # Optional. Set of key-value pairs that can be attached + to the request. }, - "n": 1, # Optional. Default value is 1. How many chat completion choices to - generate for each input message. Note that you will be charged based on the - number of generated tokens across all of the choices. Keep n as 1 to minimize - costs. - "presence_penalty": 0, # Optional. Default value is 0. Number between -2.0 - and 2.0. Positive values penalize new tokens based on whether they appear in the - text so far, increasing the model's likelihood to talk about new topics. - "reasoning_effort": "str", # Optional. Constrains effort on reasoning for - reasoning models. Reducing reasoning effort can result in faster responses and - fewer tokens used on reasoning in a response. Known values are: "none", - "minimal", "low", "medium", "high", and "xhigh". - "seed": 0, # Optional. If specified, the system will make a best effort to - sample deterministically, such that repeated requests with the same seed and - parameters should return the same result. Determinism is not guaranteed. "stop": {}, - "stream": False, # Optional. Default value is False. If set to true, the - model response data will be streamed to the client as it is generated using - server-sent events. + "stream": False, # Optional. Default value is False. Set to true to stream + partial responses as Server-Sent Events. "stream_options": { "include_usage": bool # Optional. If set, an additional chunk will - be streamed before the data [DONE] message. The usage field on this chunk - shows the token usage statistics for the entire request, and the choices - field will always be an empty array. + be streamed before the data: [DONE] message with token usage statistics for + the entire request. }, - "temperature": 0.0, # Optional. What sampling temperature to use, between 0 - and 2. Higher values like 0.8 will make the output more random, while lower - values like 0.2 will make it more focused and deterministic. We generally - recommend altering this or top_p but not both. + "temperature": 0.0, # Optional. A value between 0.0 and 2.0 to control + randomness and creativity. Lower values like 0.2 make the output more focused and + deterministic, while higher values like 0.8 make it more random. "tool_choice": {}, "tools": [ { - "function": { - "name": "str", # The name of the function to be - called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, - with a maximum length of 64. Required. - "description": "str", # Optional. A description of - what the function does, used by the model to choose when and how to - call the function. - "parameters": { - "str": {} # Optional. The parameters the - function accepts, described as a JSON Schema object. - } - }, - "type": "str" # The type of the tool. Currently, only - function is supported. Required. "function" + "type": "str", # The type of the tool. Required. "function" + "description": "str", # Optional. A description of what the + function does. + "name": "str", # Optional. The name of the function to be + called. + "parameters": { + "str": {} # Optional. The parameters the function + accepts, described as a JSON Schema object. + } } ], - "top_logprobs": 0, # Optional. An integer between 0 and 20 specifying the - number of most likely tokens to return at each token position, each with an - associated log probability. logprobs must be set to true if this parameter is - used. "top_p": 0.0, # Optional. An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with - top_p probability mass. So 0.1 means only the tokens comprising the top 10% - probability mass are considered. We generally recommend altering this or - temperature but not both. - "user": "str" # Optional. A unique identifier representing your end-user, - which can help DigitalOcean to monitor and detect abuse. + top_p probability mass. + "user": "str" # Optional. A unique identifier representing your end-user. } # response body for status code(s): 200 response == { - "choices": [ + "created": 0, # The Unix timestamp (in seconds) of when the response was + created. Required. + "id": "str", # A unique identifier for the response. Required. + "model": "str", # The model used to generate the response. Required. + "object": "str", # The object type, which is always ``response``. Required. + "response" + "output": [ { - "finish_reason": "str", # The reason the model stopped - generating tokens. stop if the model hit a natural stop point or a - provided stop sequence, length if the maximum number of tokens specified - in the request was reached, tool_calls if the model called a tool. - Required. Known values are: "stop", "length", "tool_calls", and - "content_filter". - "index": 0, # The index of the choice in the list of - choices. Required. - "logprobs": { - "content": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ], - "refusal": [ - { - "bytes": [ - 0 # A list of integers - representing the UTF-8 bytes representation of the token. - Can be null if there is no bytes representation for the - token. Required. - ], - "logprob": 0.0, # The log - probability of this token, if it is within the top 20 most - likely tokens. Otherwise, the value -9999.0 is used to - signify that the token is very unlikely. Required. - "token": "str", # The token. - Required. - "top_logprobs": [ - { - "bytes": [ - 0 # - Required. - ], - "logprob": 0.0, # - The log probability of this token. Required. - "token": "str" # The - token. Required. - } - ] - } - ] - }, - "message": { - "content": "str", # The contents of the message. - Required. - "reasoning_content": "str", # The reasoning content - generated by the model. Required. - "refusal": "str", # The refusal message generated by - the model. Required. - "role": "str", # The role of the author of this - message. Required. "assistant" - "tool_calls": [ - { - "function": { - "arguments": "str", # The - arguments to call the function with. Required. - "name": "str" # The name of - the function to call. Required. - }, - "id": "str", # The ID of the tool - call. Required. - "type": "str" # The type of the - tool. Required. "function" - } - ] - } + "content": [ + { + "text": "str", # The text content. Required. + "type": "str" # The type of content part. + ``reasoning_text`` for reasoning content, ``output_text`` for + final output text. Required. Known values are: "reasoning_text" + and "output_text". + } + ], + "type": "str", # The type of output item. One of + ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known + values are: "reasoning", "message", and "function_call". + "arguments": "str", # Optional. JSON string of function + arguments (present when type is ``function_call``"" ). + "call_id": "str", # Optional. The unique ID of the function + tool call (present when type is ``function_call``"" ). + "id": "str", # Optional. The unique ID of the output item. + "name": "str", # Optional. The name of the function to call + (present when type is ``function_call``"" ). + "role": "str", # Optional. The role associated with this + output item (typically ``assistant``"" ). + "status": "str" # Optional. Status of the item. } ], - "created": 0, # The Unix timestamp (in seconds) of when the chat completion - was created. Required. - "id": "str", # A unique identifier for the chat completion. Required. - "model": "str", # The model used for the chat completion. Required. - "object": "str", # The object type, which is always chat.completion. - Required. "chat.completion" "usage": { - "cache_created_input_tokens": 0, # Default value is 0. Number of - prompt tokens written to cache. Required. - "cache_creation": { - "ephemeral_1h_input_tokens": 0, # Default value is 0. Number - of prompt tokens written to 1h cache. Required. - "ephemeral_5m_input_tokens": 0 # Default value is 0. Number - of prompt tokens written to 5m cache. Required. + "input_tokens": 0, # The number of input tokens. Required. + "input_tokens_details": { + "cached_tokens": 0 # The number of tokens that were + retrieved from the cache. Required. }, - "cache_read_input_tokens": 0, # Default value is 0. Number of prompt - tokens read from cache. Required. - "completion_tokens": 0, # Default value is 0. Number of tokens in - the generated completion. Required. - "prompt_tokens": 0, # Default value is 0. Number of tokens in the - prompt. Required. - "total_tokens": 0 # Default value is 0. Total number of tokens used - in the request (prompt + completion). Required. - } + "output_tokens": 0, # The number of output tokens. Required. + "output_tokens_details": { + "reasoning_tokens": 0, # The number of reasoning tokens. + Required. + "tool_output_tokens": 0 # The number of tool output tokens. + Required. + }, + "total_tokens": 0 # The total number of tokens used. Required. + }, + "max_output_tokens": 0, # Optional. Maximum output tokens setting. + "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are + enabled. + "status": "str", # Optional. Status of the response. + "temperature": 0.0, # Optional. Temperature setting used for the response. + "tool_choice": "str", # Optional. Tool choice setting used for the response. + "tools": [ + { + "type": "str", # The type of the tool. Required. "function" + "description": "str", # Optional. A description of what the + function does. + "name": "str", # Optional. The name of the function. + "parameters": { + "str": {} # Optional. The parameters the function + accepts. + } + } + ], + "top_p": 0.0, # Optional. Top-p setting used for the response. + "user": "str" # Optional. User identifier. } """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -269350,7 +272143,7 @@ def create_chat_completion( else: _json = body - _request = build_inference_create_chat_completion_request( + _request = build_inference_create_response_request( content_type=content_type, json=_json, content=_content, @@ -269396,14 +272189,15 @@ def create_chat_completion( return cast(JSON, deserialized) # type: ignore @overload - def create_messages( + def create_async_invoke( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create the next assistant message. + """Generate Image, Audio, or Text-to-Speech Using fal Models. - Send a structured list of input messages with text and/or image content, and the model will - generate the next message in the conversation. + Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous + job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll + for the result. :param body: Required. :type body: JSON @@ -269419,99 +272213,66 @@ def create_messages( # JSON input template you can fill out and use as your body input. body = { - "max_tokens": 0, # Maximum tokens to generate before stopping. Required. - "messages": [ - { - "content": {}, - "role": "str" # Speaker role for this message. Required. - Known values are: "user" and "assistant". - } - ], - "model": "str", # Model ID (for example ``claude-opus-4-6`` or a serverless - model id). Required. - "metadata": { - "user_id": "str" # Optional. Opaque identifier for the end user (for - example a UUID or hash). Do not include PII. - }, - "reasoning_effort": "str", # Optional. DigitalOcean extension for - reasoning-capable models. Ignored by executors that do not support it. Known - values are: "none", "minimal", "low", "medium", "high", and "xhigh". - "speed": "str", # Optional. DigitalOcean extension for preferred inference - speed. Ignored when not supported. Known values are: "standard" and "fast". - "stop_sequences": [ - "str" # Optional. Custom strings that stop generation when produced. - ], - "stream": False, # Optional. Default value is False. When true, the response - is streamed using server-sent events (SSE). - "system": {}, - "temperature": 0.0, # Optional. Sampling temperature between 0.0 and 1.0. - "thinking": { - "type": "str" # Thinking mode discriminator (for example enabled or - disabled). Required. + "input": { + "enable_safety_checker": bool, # Optional. Whether to enable the + safety checker for generated content. + "guidance_scale": 0.0, # Optional. Controls how closely the image + generation model follows the prompt. Higher values produce output more + closely matching the prompt. + "num_images": 0, # Optional. The number of images to generate. + "num_inference_steps": 0, # Optional. The number of inference steps + to use during image generation. More steps generally produce higher quality + output but take longer. + "output_format": "str", # Optional. The desired output format or + aspect ratio for image generation. + "prompt": "str", # Optional. The text prompt describing the desired + output. Used for image generation and audio generation models. + "seconds_total": 0, # Optional. The total duration in seconds for + generated audio. Used for audio generation models. + "text": "str" # Optional. The text content to convert to speech. + Used for text-to-speech models. }, - "tool_choice": {}, - "tools": [ + "model_id": "str", # The ID of the model to invoke asynchronously. Required. + "tags": [ { - "input_schema": { - "str": {} # JSON Schema (draft 2020-12 style) - describing the tool input object. Required. - }, - "name": "str", # Tool name referenced in ``tool_use`` - blocks. Required. - "description": "str" # Optional. Human-readable description - of what the tool does. + "key": "str", # The tag key. Required. + "value": "str" # The tag value. Required. } - ], - "top_k": 0, # Optional. Top-K sampling cutoff. - "top_p": 0.0 # Optional. Nucleus sampling; use either ``temperature`` or - ``top_p``"" , not both. + ] } - # response body for status code(s): 200 - response == { - "content": [ - {} - ], - "id": "str", # Unique identifier for this message object. Required. - "model": "str", # Model that produced the message. Required. - "role": "str", # Always ``assistant`` for this response. Required. - "assistant" - "stop_reason": "str", # Why generation stopped. Required. Known values are: - "end_turn", "max_tokens", "stop_sequence", and "tool_use". - "type": "str", # Object type discriminator. Required. "message" - "usage": { - "input_tokens": 0, # Number of input tokens billed for this request. - Required. - "output_tokens": 0, # Number of output tokens generated. Required. - "cache_creation_input_tokens": 0, # Optional. Input tokens used to - create a prompt cache entry, if applicable. - "cache_read_input_tokens": 0, # Optional. Input tokens read from a - prompt cache, if applicable. - "speed": "str" # Optional. Inference speed tier reflected in billing - or routing. Known values are: "standard" and "fast". - }, - "stop_sequence": "str" # Optional. When ``stop_reason`` is - ``stop_sequence``"" , the sequence that matched. - } - # response body for status code(s): 400 + # response body for status code(s): 200, 202 response == { - "error": { - "message": "str", # Human-readable error message. Required. - "type": "str" # Machine-readable error code. Required. + "created_at": "2020-02-20 00:00:00", # The timestamp when the request was + created. Required. + "model_id": "str", # The model ID that was invoked. Required. + "request_id": "str", # A unique identifier for the async invocation request. + Use this ID to check the status and retrieve the result. Required. + "status": "str", # The current status of the async invocation. Required. + Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". + "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the + job completed. Null until finished. + "error": "str", # Optional. Error message if the job failed. Null on + success. + "output": { + "str": {} # Optional. The output of the invocation. Null while the + job is queued or in progress. Contains the result once completed. }, - "type": "str" # Required. "error" + "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job + started processing. Null while queued. } """ @overload - def create_messages( + def create_async_invoke( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create the next assistant message. + """Generate Image, Audio, or Text-to-Speech Using fal Models. - Send a structured list of input messages with text and/or image content, and the model will - generate the next message in the conversation. + Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous + job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll + for the result. :param body: Required. :type body: IO[bytes] @@ -269525,49 +272286,36 @@ def create_messages( Example: .. code-block:: python - # response body for status code(s): 200 - response == { - "content": [ - {} - ], - "id": "str", # Unique identifier for this message object. Required. - "model": "str", # Model that produced the message. Required. - "role": "str", # Always ``assistant`` for this response. Required. - "assistant" - "stop_reason": "str", # Why generation stopped. Required. Known values are: - "end_turn", "max_tokens", "stop_sequence", and "tool_use". - "type": "str", # Object type discriminator. Required. "message" - "usage": { - "input_tokens": 0, # Number of input tokens billed for this request. - Required. - "output_tokens": 0, # Number of output tokens generated. Required. - "cache_creation_input_tokens": 0, # Optional. Input tokens used to - create a prompt cache entry, if applicable. - "cache_read_input_tokens": 0, # Optional. Input tokens read from a - prompt cache, if applicable. - "speed": "str" # Optional. Inference speed tier reflected in billing - or routing. Known values are: "standard" and "fast". - }, - "stop_sequence": "str" # Optional. When ``stop_reason`` is - ``stop_sequence``"" , the sequence that matched. - } - # response body for status code(s): 400 + # response body for status code(s): 200, 202 response == { - "error": { - "message": "str", # Human-readable error message. Required. - "type": "str" # Machine-readable error code. Required. + "created_at": "2020-02-20 00:00:00", # The timestamp when the request was + created. Required. + "model_id": "str", # The model ID that was invoked. Required. + "request_id": "str", # A unique identifier for the async invocation request. + Use this ID to check the status and retrieve the result. Required. + "status": "str", # The current status of the async invocation. Required. + Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". + "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the + job completed. Null until finished. + "error": "str", # Optional. Error message if the job failed. Null on + success. + "output": { + "str": {} # Optional. The output of the invocation. Null while the + job is queued or in progress. Contains the result once completed. }, - "type": "str" # Required. "error" + "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job + started processing. Null while queued. } """ @distributed_trace - def create_messages(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + def create_async_invoke(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Create the next assistant message. + """Generate Image, Audio, or Text-to-Speech Using fal Models. - Send a structured list of input messages with text and/or image content, and the model will - generate the next message in the conversation. + Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous + job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll + for the result. :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] @@ -269580,87 +272328,53 @@ def create_messages(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: # JSON input template you can fill out and use as your body input. body = { - "max_tokens": 0, # Maximum tokens to generate before stopping. Required. - "messages": [ - { - "content": {}, - "role": "str" # Speaker role for this message. Required. - Known values are: "user" and "assistant". - } - ], - "model": "str", # Model ID (for example ``claude-opus-4-6`` or a serverless - model id). Required. - "metadata": { - "user_id": "str" # Optional. Opaque identifier for the end user (for - example a UUID or hash). Do not include PII. - }, - "reasoning_effort": "str", # Optional. DigitalOcean extension for - reasoning-capable models. Ignored by executors that do not support it. Known - values are: "none", "minimal", "low", "medium", "high", and "xhigh". - "speed": "str", # Optional. DigitalOcean extension for preferred inference - speed. Ignored when not supported. Known values are: "standard" and "fast". - "stop_sequences": [ - "str" # Optional. Custom strings that stop generation when produced. - ], - "stream": False, # Optional. Default value is False. When true, the response - is streamed using server-sent events (SSE). - "system": {}, - "temperature": 0.0, # Optional. Sampling temperature between 0.0 and 1.0. - "thinking": { - "type": "str" # Thinking mode discriminator (for example enabled or - disabled). Required. + "input": { + "enable_safety_checker": bool, # Optional. Whether to enable the + safety checker for generated content. + "guidance_scale": 0.0, # Optional. Controls how closely the image + generation model follows the prompt. Higher values produce output more + closely matching the prompt. + "num_images": 0, # Optional. The number of images to generate. + "num_inference_steps": 0, # Optional. The number of inference steps + to use during image generation. More steps generally produce higher quality + output but take longer. + "output_format": "str", # Optional. The desired output format or + aspect ratio for image generation. + "prompt": "str", # Optional. The text prompt describing the desired + output. Used for image generation and audio generation models. + "seconds_total": 0, # Optional. The total duration in seconds for + generated audio. Used for audio generation models. + "text": "str" # Optional. The text content to convert to speech. + Used for text-to-speech models. }, - "tool_choice": {}, - "tools": [ + "model_id": "str", # The ID of the model to invoke asynchronously. Required. + "tags": [ { - "input_schema": { - "str": {} # JSON Schema (draft 2020-12 style) - describing the tool input object. Required. - }, - "name": "str", # Tool name referenced in ``tool_use`` - blocks. Required. - "description": "str" # Optional. Human-readable description - of what the tool does. + "key": "str", # The tag key. Required. + "value": "str" # The tag value. Required. } - ], - "top_k": 0, # Optional. Top-K sampling cutoff. - "top_p": 0.0 # Optional. Nucleus sampling; use either ``temperature`` or - ``top_p``"" , not both. + ] } - # response body for status code(s): 200 - response == { - "content": [ - {} - ], - "id": "str", # Unique identifier for this message object. Required. - "model": "str", # Model that produced the message. Required. - "role": "str", # Always ``assistant`` for this response. Required. - "assistant" - "stop_reason": "str", # Why generation stopped. Required. Known values are: - "end_turn", "max_tokens", "stop_sequence", and "tool_use". - "type": "str", # Object type discriminator. Required. "message" - "usage": { - "input_tokens": 0, # Number of input tokens billed for this request. - Required. - "output_tokens": 0, # Number of output tokens generated. Required. - "cache_creation_input_tokens": 0, # Optional. Input tokens used to - create a prompt cache entry, if applicable. - "cache_read_input_tokens": 0, # Optional. Input tokens read from a - prompt cache, if applicable. - "speed": "str" # Optional. Inference speed tier reflected in billing - or routing. Known values are: "standard" and "fast". - }, - "stop_sequence": "str" # Optional. When ``stop_reason`` is - ``stop_sequence``"" , the sequence that matched. - } - # response body for status code(s): 400 + # response body for status code(s): 200, 202 response == { - "error": { - "message": "str", # Human-readable error message. Required. - "type": "str" # Machine-readable error code. Required. + "created_at": "2020-02-20 00:00:00", # The timestamp when the request was + created. Required. + "model_id": "str", # The model ID that was invoked. Required. + "request_id": "str", # A unique identifier for the async invocation request. + Use this ID to check the status and retrieve the result. Required. + "status": "str", # The current status of the async invocation. Required. + Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". + "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the + job completed. Null until finished. + "error": "str", # Optional. Error message if the job failed. Null on + success. + "output": { + "str": {} # Optional. The output of the invocation. Null while the + job is queued or in progress. Contains the result once completed. }, - "type": "str" # Required. "error" + "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job + started processing. Null while queued. } """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -269692,7 +272406,7 @@ def create_messages(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: else: _json = body - _request = build_inference_create_messages_request( + _request = build_inference_create_async_invoke_request( content_type=content_type, json=_json, content=_content, @@ -269710,7 +272424,7 @@ def create_messages(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: response = pipeline_response.http_response - if response.status_code not in [200, 400]: + if response.status_code not in [200, 202]: 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 @@ -269733,7 +272447,7 @@ def create_messages(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: else: deserialized = None - if response.status_code == 400: + if response.status_code == 202: response_headers["ratelimit-limit"] = self._deserialize( "int", response.headers.get("ratelimit-limit") ) @@ -269755,15 +272469,15 @@ def create_messages(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @overload - def create_embedding( + def create_batch_file( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create embedding. + """Create a Batch Inference Input File. - Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. - Unknown fields in the request body are rejected. There is no streaming response for this - endpoint. + Creates a file record and returns a ``file_id`` plus a short-lived presigned ``PUT`` URL + (typically valid for ~15 minutes). Upload the raw JSONL bytes to ``upload_url`` (see ``PUT + /{upload_path}``\\ ) before calling ``POST /v1/batches``. :param body: Required. :type body: JSON @@ -269779,48 +272493,43 @@ def create_embedding( # JSON input template you can fill out and use as your body input. body = { - "input": {}, - "model": "str", # Model id to use for embeddings. Must match a model your - account can access. Required. - "encoding_format": "float", # Optional. Default value is "float". How - embedding values are returned in each ``data[].embedding`` field. Known values - are: "float" and "base64". - "user": "str" # Optional. Optional end-user identifier to help with abuse - monitoring. + "file_name": "str" # The file you plan to upload. Must end with ``.jsonl`` + (case-insensitive) and contain one request per line in the schema expected by the + target ``provider``. Required. } - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "data": [ - { - "embedding": {}, - "index": 0, # Zero-based index of the corresponding - ``input`` item (0 when ``input`` is a string). Required. - "object": "str" # The object type, which is always - ``embedding``. Required. "embedding" - } - ], - "model": "str", # The embedding model that produced the vectors. Required. - "object": "str", # The object type, which is always the string ``list``. - Required. "list" - "usage": { - "prompt_tokens": 0, # Number of input tokens used for the embedding. - Required. - "total_tokens": 0 # Total billable tokens for the request. Required. - } + "file_id": "str", # Pass this value as ``file_id`` when creating a batch + job. Required. + "upload_url": "str", # Short-lived presigned ``PUT`` URL (typically valid + for ~15 minutes). If it expires before upload, create a new file intent. + Required. + "expires_at": "2020-02-20 00:00:00" # Optional. When ``upload_url`` expires. + } + # response body for status code(s): 400, 403, 422 + 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_embedding( + def create_batch_file( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Create embedding. + """Create a Batch Inference Input File. - Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. - Unknown fields in the request body are rejected. There is no streaming response for this - endpoint. + Creates a file record and returns a ``file_id`` plus a short-lived presigned ``PUT`` URL + (typically valid for ~15 minutes). Upload the raw JSONL bytes to ``upload_url`` (see ``PUT + /{upload_path}``\\ ) before calling ``POST /v1/batches``. :param body: Required. :type body: IO[bytes] @@ -269834,36 +272543,36 @@ def create_embedding( Example: .. code-block:: python - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "data": [ - { - "embedding": {}, - "index": 0, # Zero-based index of the corresponding - ``input`` item (0 when ``input`` is a string). Required. - "object": "str" # The object type, which is always - ``embedding``. Required. "embedding" - } - ], - "model": "str", # The embedding model that produced the vectors. Required. - "object": "str", # The object type, which is always the string ``list``. - Required. "list" - "usage": { - "prompt_tokens": 0, # Number of input tokens used for the embedding. - Required. - "total_tokens": 0 # Total billable tokens for the request. Required. - } + "file_id": "str", # Pass this value as ``file_id`` when creating a batch + job. Required. + "upload_url": "str", # Short-lived presigned ``PUT`` URL (typically valid + for ~15 minutes). If it expires before upload, create a new file intent. + Required. + "expires_at": "2020-02-20 00:00:00" # Optional. When ``upload_url`` expires. + } + # response body for status code(s): 400, 403, 422 + 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_embedding(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + def create_batch_file(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Create embedding. + """Create a Batch Inference Input File. - Create vector embeddings for one or more text inputs. OpenAI-compatible request and response. - Unknown fields in the request body are rejected. There is no streaming response for this - endpoint. + Creates a file record and returns a ``file_id`` plus a short-lived presigned ``PUT`` URL + (typically valid for ~15 minutes). Upload the raw JSONL bytes to ``upload_url`` (see ``PUT + /{upload_path}``\\ ) before calling ``POST /v1/batches``. :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] @@ -269876,35 +272585,30 @@ def create_embedding(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: # JSON input template you can fill out and use as your body input. body = { - "input": {}, - "model": "str", # Model id to use for embeddings. Must match a model your - account can access. Required. - "encoding_format": "float", # Optional. Default value is "float". How - embedding values are returned in each ``data[].embedding`` field. Known values - are: "float" and "base64". - "user": "str" # Optional. Optional end-user identifier to help with abuse - monitoring. + "file_name": "str" # The file you plan to upload. Must end with ``.jsonl`` + (case-insensitive) and contain one request per line in the schema expected by the + target ``provider``. Required. } - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "data": [ - { - "embedding": {}, - "index": 0, # Zero-based index of the corresponding - ``input`` item (0 when ``input`` is a string). Required. - "object": "str" # The object type, which is always - ``embedding``. Required. "embedding" - } - ], - "model": "str", # The embedding model that produced the vectors. Required. - "object": "str", # The object type, which is always the string ``list``. - Required. "list" - "usage": { - "prompt_tokens": 0, # Number of input tokens used for the embedding. - Required. - "total_tokens": 0 # Total billable tokens for the request. Required. - } + "file_id": "str", # Pass this value as ``file_id`` when creating a batch + job. Required. + "upload_url": "str", # Short-lived presigned ``PUT`` URL (typically valid + for ~15 minutes). If it expires before upload, create a new file intent. + Required. + "expires_at": "2020-02-20 00:00:00" # Optional. When ``upload_url`` expires. + } + # response body for status code(s): 400, 403, 422 + 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]] = { @@ -269936,7 +272640,7 @@ def create_embedding(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: else: _json = body - _request = build_inference_create_embedding_request( + _request = build_inference_create_batch_file_request( content_type=content_type, json=_json, content=_content, @@ -269954,265 +272658,104 @@ def create_embedding(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [201, 400, 403, 422]: 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 = {} - 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_image( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Generate images from text prompts. - - Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation - model with automatic prompt optimization and enhanced visual capabilities. - - :param body: Required. - :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 = { - "model": "str", # The model to use for image generation. Required. - "n": 0, # The number of images to generate. Must be between 1 and 10. - Required. - "prompt": "str", # A text description of the desired image(s). Supports up - to 32,000 characters and provides automatic prompt optimization for best results. - Required. - "background": "str", # Optional. The background setting for the image - generation. Supported values: transparent, opaque, auto. - "moderation": "str", # Optional. The moderation setting for the image - generation. Supported values: low, auto. - "output_compression": 0, # Optional. The output compression level for the - image generation (0-100). - "output_format": "str", # Optional. The output format for the image - generation. Supported values: png, webp, jpeg. - "partial_images": 0, # Optional. The number of partial image chunks to - return during streaming generation. Defaults to 0. When stream=true, this must be - greater than 0 to receive progressive updates of the image as it is being - generated. - "quality": "str", # Optional. The quality of the image that will be - generated. Supported values: auto, high, medium, low. - "size": "str", # Optional. The size of the generated images. GPT-IMAGE-1 - supports: auto (automatically select best size), 1536x1024 (landscape), 1024x1536 - (portrait). Known values are: "auto", "1536x1024", and "1024x1536". - "stream": False, # Optional. Default value is False. If set to true, partial - image data will be streamed as the image is being generated. The response will be - sent as server-sent events with partial image chunks. When stream is true, - partial_images must be greater than 0. - "user": "str" # Optional. A unique identifier representing your end-user, - which can help DigitalOcean to monitor and detect abuse. - } - - # response body for status code(s): 200 - response == { - "created": 0, # The Unix timestamp (in seconds) of when the images were - created. Required. - "data": [ - { - "b64_json": "str", # The base64-encoded JSON of the - generated image. Required. - "revised_prompt": "str" # Optional. The optimized prompt - that was used to generate the image. - } - ], - "background": "str", # Optional. The background setting used for the image - generation. - "output_format": "str", # Optional. The output format of the generated - image. - "quality": "str", # Optional. The quality setting used for the image - generation. - "size": "str", # Optional. The size of the generated image. - "usage": { - "input_tokens": 0, # The number of tokens (images and text) in the - input prompt. Required. - "input_tokens_details": { - "image_tokens": 0, # The number of image tokens in the input - prompt. Required. - "text_tokens": 0 # The number of text tokens in the input - prompt. Required. - }, - "output_tokens": 0, # The number of image tokens in the output - image. Required. - "total_tokens": 0 # The total number of tokens (images and text) - used for the image generation. Required. - } - } - """ - - @overload - def create_image( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Generate images from text prompts. - - Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation - model with automatic prompt optimization and enhanced visual capabilities. - - :param body: Required. - :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 + if response.status_code == 201: + 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") + ) - # response body for status code(s): 200 - response == { - "created": 0, # The Unix timestamp (in seconds) of when the images were - created. Required. - "data": [ - { - "b64_json": "str", # The base64-encoded JSON of the - generated image. Required. - "revised_prompt": "str" # Optional. The optimized prompt - that was used to generate the image. - } - ], - "background": "str", # Optional. The background setting used for the image - generation. - "output_format": "str", # Optional. The output format of the generated - image. - "quality": "str", # Optional. The quality setting used for the image - generation. - "size": "str", # Optional. The size of the generated image. - "usage": { - "input_tokens": 0, # The number of tokens (images and text) in the - input prompt. Required. - "input_tokens_details": { - "image_tokens": 0, # The number of image tokens in the input - prompt. Required. - "text_tokens": 0 # The number of text tokens in the input - prompt. Required. - }, - "output_tokens": 0, # The number of image tokens in the output - image. Required. - "total_tokens": 0 # The total number of tokens (images and text) - used for the image generation. Required. - } - } - """ + if response.content: + deserialized = response.json() + else: + deserialized = None - @distributed_trace - def create_image(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: - # pylint: disable=line-too-long - """Generate images from text prompts. + if response.status_code == 400: + 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") + ) - Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation - model with automatic prompt optimization and enhanced visual capabilities. + if response.content: + deserialized = response.json() + else: + deserialized = None - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: + if response.status_code == 403: + 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") + ) - Example: - .. code-block:: python + if response.content: + deserialized = response.json() + else: + deserialized = None - # JSON input template you can fill out and use as your body input. - body = { - "model": "str", # The model to use for image generation. Required. - "n": 0, # The number of images to generate. Must be between 1 and 10. - Required. - "prompt": "str", # A text description of the desired image(s). Supports up - to 32,000 characters and provides automatic prompt optimization for best results. - Required. - "background": "str", # Optional. The background setting for the image - generation. Supported values: transparent, opaque, auto. - "moderation": "str", # Optional. The moderation setting for the image - generation. Supported values: low, auto. - "output_compression": 0, # Optional. The output compression level for the - image generation (0-100). - "output_format": "str", # Optional. The output format for the image - generation. Supported values: png, webp, jpeg. - "partial_images": 0, # Optional. The number of partial image chunks to - return during streaming generation. Defaults to 0. When stream=true, this must be - greater than 0 to receive progressive updates of the image as it is being - generated. - "quality": "str", # Optional. The quality of the image that will be - generated. Supported values: auto, high, medium, low. - "size": "str", # Optional. The size of the generated images. GPT-IMAGE-1 - supports: auto (automatically select best size), 1536x1024 (landscape), 1024x1536 - (portrait). Known values are: "auto", "1536x1024", and "1024x1536". - "stream": False, # Optional. Default value is False. If set to true, partial - image data will be streamed as the image is being generated. The response will be - sent as server-sent events with partial image chunks. When stream is true, - partial_images must be greater than 0. - "user": "str" # Optional. A unique identifier representing your end-user, - which can help DigitalOcean to monitor and detect abuse. - } + if response.status_code == 422: + 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") + ) - # response body for status code(s): 200 - response == { - "created": 0, # The Unix timestamp (in seconds) of when the images were - created. Required. - "data": [ - { - "b64_json": "str", # The base64-encoded JSON of the - generated image. Required. - "revised_prompt": "str" # Optional. The optimized prompt - that was used to generate the image. - } - ], - "background": "str", # Optional. The background setting used for the image - generation. - "output_format": "str", # Optional. The output format of the generated - image. - "quality": "str", # Optional. The quality setting used for the image - generation. - "size": "str", # Optional. The size of the generated image. - "usage": { - "input_tokens": 0, # The number of tokens (images and text) in the - input prompt. Required. - "input_tokens_details": { - "image_tokens": 0, # The number of image tokens in the input - prompt. Required. - "text_tokens": 0 # The number of text tokens in the input - prompt. Required. - }, - "output_tokens": 0, # The number of image tokens in the output - image. Required. - "total_tokens": 0 # The total number of tokens (images and text) - used for the image generation. Required. - } - } + 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 upload_batch_file( # pylint: disable=inconsistent-return-statements + self, data: IO[bytes], **kwargs: Any + ) -> None: + """Upload a Batch Inference Input File. + + Uploads the raw JSONL bytes to the presigned ``upload_url`` returned by ``POST + /v1/batches/files``. + + **The URL is dynamic — do not construct it.** Use the ``upload_url`` value from the previous + step verbatim. Its host, path, and query parameters are part of the short-lived (~15 minute) + signature and change per request; the server and path shown here are illustrative. If the URL + expires before the upload completes, create a new file intent and retry. + + ``POST /v1/batches`` performs a ``HEAD`` check on the uploaded object and will reject the batch + if this upload has not completed. + + :param data: Raw JSONL bytes — one request per line. Required. + :type data: IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, @@ -270230,22 +272773,15 @@ def create_image(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: _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) + content_type: str = kwargs.pop( + "content_type", _headers.pop("Content-Type", "application/octet-stream") ) - cls: ClsType[JSON] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = body + _content = data - _request = build_inference_create_image_request( + _request = build_inference_upload_batch_file_request( content_type=content_type, - json=_json, content=_content, headers=_headers, params=_params, @@ -270261,40 +272797,53 @@ def create_image(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 403]: 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 = {} - 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.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 == 403: + 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 cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace - def list_models(self, **kwargs: Any) -> JSON: - """List available models. + def list_batches( + self, *, after: Optional[str] = None, limit: int = 20, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List Batch Inference Jobs. - Lists the currently available models, and provides basic information about each one such as the - owner and availability. + Returns a cursor-paginated list of batch jobs, ordered newest first. Use ``limit`` to control + page size and ``after`` to page forward using the ``last_id`` from the previous response. + :keyword after: Cursor for pagination. Pass the ``last_id`` value from the previous response to + fetch the next page. Omit for the first page. Default value is None. + :paramtype after: str + :keyword limit: Maximum number of batches to return per page. Default value is 20. + :paramtype limit: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -270306,17 +272855,78 @@ def list_models(self, **kwargs: Any) -> JSON: response == { "data": [ { - "created": 0, # The Unix timestamp (in seconds) when the - model was created. Required. - "id": "str", # The model identifier, which can be referenced - in the API endpoints. Required. - "object": "str", # The object type, which is always "model". - Required. "model" - "owned_by": "str" # The organization that owns the model. + "batch_id": "str", # Unique identifier for the batch job. + Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is + dispatched to. Required. + "input_file_id": "str", # The uploaded JSONL input file. Required. + "provider": "str", # Required. Known values are: "openai" + and "anthropic". + "status": "str", # Lifecycle status. Terminal states: + ``completed``"" , ``failed``"" , ``expired``"" , ``cancelled``. Required. + Known values are: "validating", "in_progress", "finalizing", "completed", + "failed", "expired", "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. Batch + jobs on this page, ordered newest first. Required. + "completed_at": "2020-02-20 00:00:00", # Optional. Batch + jobs on this page, ordered newest first. Required. + "error_file_id": "str", # Optional. Error sidecar file. Null + when no errors were produced. + "errors": [ + { + "code": "str", # Optional. Top-level errors + that prevented the batch from completing. + "line": 0, # Optional. 1-based JSONL line + number, if applicable. + "message": "str" # Optional. Top-level + errors that prevented the batch from completing. + } + ], + "expires_at": "2020-02-20 00:00:00", # Optional. Derived + from ``created_at`` plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. Batch jobs + on this page, ordered newest first. Required. + "finalizing_at": "2020-02-20 00:00:00", # Optional. Batch + jobs on this page, ordered newest first. Required. + "in_progress_at": "2020-02-20 00:00:00", # Optional. Batch + jobs on this page, ordered newest first. Required. + "metadata": { + "str": "str" # Optional. Metadata attached at + creation. + }, + "output_file_id": "str", # Optional. Output JSONL file. + Populated once the job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request + counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied + at creation. } ], - "object": "str" # The object type, which is always "list". Required. "list" + "has_more": bool, # Whether additional batches exist beyond this page. + Required. + "object": "str", # The object type, always ``list``. Required. "list" + "first_id": "str", # Optional. ID of the first batch on this page. Null when + the page is empty. + "last_id": "str" # Optional. ID of the last batch on this page. Pass as + ``after`` to fetch the next page. + } + # response body for status code(s): 403 + 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]] = { @@ -270337,7 +272947,9 @@ def list_models(self, **kwargs: Any) -> JSON: cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_inference_list_models_request( + _request = build_inference_list_batches_request( + after=after, + limit=limit, headers=_headers, params=_params, ) @@ -270352,27 +272964,44 @@ def list_models(self, **kwargs: Any) -> JSON: response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 403]: 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 = {} - 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.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.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 403: + 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 @@ -270380,14 +273009,18 @@ def list_models(self, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore @overload - def create_response( + def create_batch( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Send Prompt to a Model Using the Responses API. + """Create a Batch Inference Job. - Generate text responses from text prompts. This endpoint supports both streaming and - non-streaming responses for supported text models. + Submits a batch job against a previously uploaded JSONL input file. The upload must have + completed before this call; otherwise the request is rejected. + + Supply a unique ``request_id`` to make the submission idempotent — retries with the same value + return the existing job. When ``provider`` is ``openai``\\ , the ``url`` on each JSONL line + must match ``endpoint``. :param body: Required. :type body: JSON @@ -270403,129 +273036,98 @@ def create_response( # JSON input template you can fill out and use as your body input. body = { - "input": {}, - "model": "str", # The model ID of the model you want to use. Get the model - ID using ``/v1/models`` or on the available models page. Required. - "instructions": "str", # Optional. System-level instructions for the model. - This sets the behavior and context for the response generation. - "max_output_tokens": 0, # Optional. The maximum number of tokens to generate - in the response. + "endpoint": "str", # Inference endpoint each request is dispatched to. When + ``provider`` is ``openai``"" , must match the ``url`` on every JSONL line. + Required. Known values are: "/v1/chat/completions", "/v1/embeddings", and + "/v1/messages". + "file_id": "str", # The ``file_id`` returned by ``POST /v1/batches/files``. + Required. + "provider": "str", # The inference provider whose JSONL schema the input + file conforms to. ``openai`` follows the OpenAI Batch API input schema ("" + ``custom_id``"" , ``method``"" , ``url``"" , ``body``"" ); ``anthropic`` follows + the Anthropic Message Batches JSONL conventions. Required. Known values are: + "openai" and "anthropic". + "request_id": "str", # Client-supplied idempotency key. Retries with the + same value return the existing job. Required. + "completion_window": "24h", # Optional. Default value is "24h". Time window + in which the job must complete. Jobs that do not finish in time transition to + ``expired``. "24h" "metadata": { - "str": "str" # Optional. Set of key-value pairs that can be attached - to the request. - }, - "stop": {}, - "stream": False, # Optional. Default value is False. Set to true to stream - partial responses as Server-Sent Events. - "stream_options": { - "include_usage": bool # Optional. If set, an additional chunk will - be streamed before the data: [DONE] message with token usage statistics for - the entire request. - }, - "temperature": 0.0, # Optional. A value between 0.0 and 2.0 to control - randomness and creativity. Lower values like 0.2 make the output more focused and - deterministic, while higher values like 0.8 make it more random. - "tool_choice": {}, - "tools": [ - { - "type": "str", # The type of the tool. Required. "function" - "description": "str", # Optional. A description of what the - function does. - "name": "str", # Optional. The name of the function to be - called. - "parameters": { - "str": {} # Optional. The parameters the function - accepts, described as a JSON Schema object. - } - } - ], - "top_p": 0.0, # Optional. An alternative to sampling with temperature, - called nucleus sampling, where the model considers the results of the tokens with - top_p probability mass. - "user": "str" # Optional. A unique identifier representing your end-user. + "str": "str" # Optional. Optional string-valued metadata to attach + to the job. + } } - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "created": 0, # The Unix timestamp (in seconds) of when the response was - created. Required. - "id": "str", # A unique identifier for the response. Required. - "model": "str", # The model used to generate the response. Required. - "object": "str", # The object type, which is always ``response``. Required. - "response" - "output": [ + "batch_id": "str", # Unique identifier for the batch job. Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is dispatched to. + Required. + "input_file_id": "str", # The uploaded JSONL input file. Required. + "provider": "str", # Required. Known values are: "openai" and "anthropic". + "status": "str", # Lifecycle status. Terminal states: ``completed``"" , + ``failed``"" , ``expired``"" , ``cancelled``. Required. Known values are: + "validating", "in_progress", "finalizing", "completed", "failed", "expired", + "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. + "completed_at": "2020-02-20 00:00:00", # Optional. + "error_file_id": "str", # Optional. Error sidecar file. Null when no errors + were produced. + "errors": [ { - "content": [ - { - "text": "str", # The text content. Required. - "type": "str" # The type of content part. - ``reasoning_text`` for reasoning content, ``output_text`` for - final output text. Required. Known values are: "reasoning_text" - and "output_text". - } - ], - "type": "str", # The type of output item. One of - ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known - values are: "reasoning", "message", and "function_call". - "arguments": "str", # Optional. JSON string of function - arguments (present when type is ``function_call``"" ). - "call_id": "str", # Optional. The unique ID of the function - tool call (present when type is ``function_call``"" ). - "id": "str", # Optional. The unique ID of the output item. - "name": "str", # Optional. The name of the function to call - (present when type is ``function_call``"" ). - "role": "str", # Optional. The role associated with this - output item (typically ``assistant``"" ). - "status": "str" # Optional. Status of the item. + "code": "str", # Optional. Top-level errors that prevented + the batch from completing. + "line": 0, # Optional. 1-based JSONL line number, if + applicable. + "message": "str" # Optional. Top-level errors that prevented + the batch from completing. } ], - "usage": { - "input_tokens": 0, # The number of input tokens. Required. - "input_tokens_details": { - "cached_tokens": 0 # The number of tokens that were - retrieved from the cache. Required. - }, - "output_tokens": 0, # The number of output tokens. Required. - "output_tokens_details": { - "reasoning_tokens": 0, # The number of reasoning tokens. - Required. - "tool_output_tokens": 0 # The number of tool output tokens. - Required. - }, - "total_tokens": 0 # The total number of tokens used. Required. + "expires_at": "2020-02-20 00:00:00", # Optional. Derived from ``created_at`` + plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. + "finalizing_at": "2020-02-20 00:00:00", # Optional. + "in_progress_at": "2020-02-20 00:00:00", # Optional. + "metadata": { + "str": "str" # Optional. Metadata attached at creation. }, - "max_output_tokens": 0, # Optional. Maximum output tokens setting. - "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are - enabled. - "status": "str", # Optional. Status of the response. - "temperature": 0.0, # Optional. Temperature setting used for the response. - "tool_choice": "str", # Optional. Tool choice setting used for the response. - "tools": [ - { - "type": "str", # The type of the tool. Required. "function" - "description": "str", # Optional. A description of what the - function does. - "name": "str", # Optional. The name of the function. - "parameters": { - "str": {} # Optional. The parameters the function - accepts. - } - } - ], - "top_p": 0.0, # Optional. Top-p setting used for the response. - "user": "str" # Optional. User identifier. + "output_file_id": "str", # Optional. Output JSONL file. Populated once the + job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied at creation. + } + # response body for status code(s): 400, 403, 404, 409, 422 + 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_response( + def create_batch( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: # pylint: disable=line-too-long - """Send Prompt to a Model Using the Responses API. + """Create a Batch Inference Job. - Generate text responses from text prompts. This endpoint supports both streaming and - non-streaming responses for supported text models. + Submits a batch job against a previously uploaded JSONL input file. The upload must have + completed before this call; otherwise the request is rejected. + + Supply a unique ``request_id`` to make the submission idempotent — retries with the same value + return the existing job. When ``provider`` is ``openai``\\ , the ``url`` on each JSONL line + must match ``endpoint``. :param body: Required. :type body: IO[bytes] @@ -270539,85 +273141,74 @@ def create_response( Example: .. code-block:: python - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "created": 0, # The Unix timestamp (in seconds) of when the response was - created. Required. - "id": "str", # A unique identifier for the response. Required. - "model": "str", # The model used to generate the response. Required. - "object": "str", # The object type, which is always ``response``. Required. - "response" - "output": [ + "batch_id": "str", # Unique identifier for the batch job. Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is dispatched to. + Required. + "input_file_id": "str", # The uploaded JSONL input file. Required. + "provider": "str", # Required. Known values are: "openai" and "anthropic". + "status": "str", # Lifecycle status. Terminal states: ``completed``"" , + ``failed``"" , ``expired``"" , ``cancelled``. Required. Known values are: + "validating", "in_progress", "finalizing", "completed", "failed", "expired", + "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. + "completed_at": "2020-02-20 00:00:00", # Optional. + "error_file_id": "str", # Optional. Error sidecar file. Null when no errors + were produced. + "errors": [ { - "content": [ - { - "text": "str", # The text content. Required. - "type": "str" # The type of content part. - ``reasoning_text`` for reasoning content, ``output_text`` for - final output text. Required. Known values are: "reasoning_text" - and "output_text". - } - ], - "type": "str", # The type of output item. One of - ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known - values are: "reasoning", "message", and "function_call". - "arguments": "str", # Optional. JSON string of function - arguments (present when type is ``function_call``"" ). - "call_id": "str", # Optional. The unique ID of the function - tool call (present when type is ``function_call``"" ). - "id": "str", # Optional. The unique ID of the output item. - "name": "str", # Optional. The name of the function to call - (present when type is ``function_call``"" ). - "role": "str", # Optional. The role associated with this - output item (typically ``assistant``"" ). - "status": "str" # Optional. Status of the item. + "code": "str", # Optional. Top-level errors that prevented + the batch from completing. + "line": 0, # Optional. 1-based JSONL line number, if + applicable. + "message": "str" # Optional. Top-level errors that prevented + the batch from completing. } ], - "usage": { - "input_tokens": 0, # The number of input tokens. Required. - "input_tokens_details": { - "cached_tokens": 0 # The number of tokens that were - retrieved from the cache. Required. - }, - "output_tokens": 0, # The number of output tokens. Required. - "output_tokens_details": { - "reasoning_tokens": 0, # The number of reasoning tokens. - Required. - "tool_output_tokens": 0 # The number of tool output tokens. - Required. - }, - "total_tokens": 0 # The total number of tokens used. Required. + "expires_at": "2020-02-20 00:00:00", # Optional. Derived from ``created_at`` + plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. + "finalizing_at": "2020-02-20 00:00:00", # Optional. + "in_progress_at": "2020-02-20 00:00:00", # Optional. + "metadata": { + "str": "str" # Optional. Metadata attached at creation. }, - "max_output_tokens": 0, # Optional. Maximum output tokens setting. - "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are - enabled. - "status": "str", # Optional. Status of the response. - "temperature": 0.0, # Optional. Temperature setting used for the response. - "tool_choice": "str", # Optional. Tool choice setting used for the response. - "tools": [ - { - "type": "str", # The type of the tool. Required. "function" - "description": "str", # Optional. A description of what the - function does. - "name": "str", # Optional. The name of the function. - "parameters": { - "str": {} # Optional. The parameters the function - accepts. - } - } - ], - "top_p": 0.0, # Optional. Top-p setting used for the response. - "user": "str" # Optional. User identifier. + "output_file_id": "str", # Optional. Output JSONL file. Populated once the + job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied at creation. + } + # response body for status code(s): 400, 403, 404, 409, 422 + 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_response(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + def create_batch(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Send Prompt to a Model Using the Responses API. + """Create a Batch Inference Job. - Generate text responses from text prompts. This endpoint supports both streaming and - non-streaming responses for supported text models. + Submits a batch job against a previously uploaded JSONL input file. The upload must have + completed before this call; otherwise the request is rejected. + + Supply a unique ``request_id`` to make the submission idempotent — retries with the same value + return the existing job. When ``provider`` is ``openai``\\ , the ``url`` on each JSONL line + must match ``endpoint``. :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] @@ -270630,117 +273221,82 @@ def create_response(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: # JSON input template you can fill out and use as your body input. body = { - "input": {}, - "model": "str", # The model ID of the model you want to use. Get the model - ID using ``/v1/models`` or on the available models page. Required. - "instructions": "str", # Optional. System-level instructions for the model. - This sets the behavior and context for the response generation. - "max_output_tokens": 0, # Optional. The maximum number of tokens to generate - in the response. + "endpoint": "str", # Inference endpoint each request is dispatched to. When + ``provider`` is ``openai``"" , must match the ``url`` on every JSONL line. + Required. Known values are: "/v1/chat/completions", "/v1/embeddings", and + "/v1/messages". + "file_id": "str", # The ``file_id`` returned by ``POST /v1/batches/files``. + Required. + "provider": "str", # The inference provider whose JSONL schema the input + file conforms to. ``openai`` follows the OpenAI Batch API input schema ("" + ``custom_id``"" , ``method``"" , ``url``"" , ``body``"" ); ``anthropic`` follows + the Anthropic Message Batches JSONL conventions. Required. Known values are: + "openai" and "anthropic". + "request_id": "str", # Client-supplied idempotency key. Retries with the + same value return the existing job. Required. + "completion_window": "24h", # Optional. Default value is "24h". Time window + in which the job must complete. Jobs that do not finish in time transition to + ``expired``. "24h" "metadata": { - "str": "str" # Optional. Set of key-value pairs that can be attached - to the request. - }, - "stop": {}, - "stream": False, # Optional. Default value is False. Set to true to stream - partial responses as Server-Sent Events. - "stream_options": { - "include_usage": bool # Optional. If set, an additional chunk will - be streamed before the data: [DONE] message with token usage statistics for - the entire request. - }, - "temperature": 0.0, # Optional. A value between 0.0 and 2.0 to control - randomness and creativity. Lower values like 0.2 make the output more focused and - deterministic, while higher values like 0.8 make it more random. - "tool_choice": {}, - "tools": [ - { - "type": "str", # The type of the tool. Required. "function" - "description": "str", # Optional. A description of what the - function does. - "name": "str", # Optional. The name of the function to be - called. - "parameters": { - "str": {} # Optional. The parameters the function - accepts, described as a JSON Schema object. - } - } - ], - "top_p": 0.0, # Optional. An alternative to sampling with temperature, - called nucleus sampling, where the model considers the results of the tokens with - top_p probability mass. - "user": "str" # Optional. A unique identifier representing your end-user. + "str": "str" # Optional. Optional string-valued metadata to attach + to the job. + } } - # response body for status code(s): 200 + # response body for status code(s): 201 response == { - "created": 0, # The Unix timestamp (in seconds) of when the response was - created. Required. - "id": "str", # A unique identifier for the response. Required. - "model": "str", # The model used to generate the response. Required. - "object": "str", # The object type, which is always ``response``. Required. - "response" - "output": [ + "batch_id": "str", # Unique identifier for the batch job. Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is dispatched to. + Required. + "input_file_id": "str", # The uploaded JSONL input file. Required. + "provider": "str", # Required. Known values are: "openai" and "anthropic". + "status": "str", # Lifecycle status. Terminal states: ``completed``"" , + ``failed``"" , ``expired``"" , ``cancelled``. Required. Known values are: + "validating", "in_progress", "finalizing", "completed", "failed", "expired", + "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. + "completed_at": "2020-02-20 00:00:00", # Optional. + "error_file_id": "str", # Optional. Error sidecar file. Null when no errors + were produced. + "errors": [ { - "content": [ - { - "text": "str", # The text content. Required. - "type": "str" # The type of content part. - ``reasoning_text`` for reasoning content, ``output_text`` for - final output text. Required. Known values are: "reasoning_text" - and "output_text". - } - ], - "type": "str", # The type of output item. One of - ``reasoning``"" , ``message``"" , or ``function_call``. Required. Known - values are: "reasoning", "message", and "function_call". - "arguments": "str", # Optional. JSON string of function - arguments (present when type is ``function_call``"" ). - "call_id": "str", # Optional. The unique ID of the function - tool call (present when type is ``function_call``"" ). - "id": "str", # Optional. The unique ID of the output item. - "name": "str", # Optional. The name of the function to call - (present when type is ``function_call``"" ). - "role": "str", # Optional. The role associated with this - output item (typically ``assistant``"" ). - "status": "str" # Optional. Status of the item. + "code": "str", # Optional. Top-level errors that prevented + the batch from completing. + "line": 0, # Optional. 1-based JSONL line number, if + applicable. + "message": "str" # Optional. Top-level errors that prevented + the batch from completing. } ], - "usage": { - "input_tokens": 0, # The number of input tokens. Required. - "input_tokens_details": { - "cached_tokens": 0 # The number of tokens that were - retrieved from the cache. Required. - }, - "output_tokens": 0, # The number of output tokens. Required. - "output_tokens_details": { - "reasoning_tokens": 0, # The number of reasoning tokens. - Required. - "tool_output_tokens": 0 # The number of tool output tokens. - Required. - }, - "total_tokens": 0 # The total number of tokens used. Required. + "expires_at": "2020-02-20 00:00:00", # Optional. Derived from ``created_at`` + plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. + "finalizing_at": "2020-02-20 00:00:00", # Optional. + "in_progress_at": "2020-02-20 00:00:00", # Optional. + "metadata": { + "str": "str" # Optional. Metadata attached at creation. }, - "max_output_tokens": 0, # Optional. Maximum output tokens setting. - "parallel_tool_calls": bool, # Optional. Whether parallel tool calls are - enabled. - "status": "str", # Optional. Status of the response. - "temperature": 0.0, # Optional. Temperature setting used for the response. - "tool_choice": "str", # Optional. Tool choice setting used for the response. - "tools": [ - { - "type": "str", # The type of the tool. Required. "function" - "description": "str", # Optional. A description of what the - function does. - "name": "str", # Optional. The name of the function. - "parameters": { - "str": {} # Optional. The parameters the function - accepts. - } - } - ], - "top_p": 0.0, # Optional. Top-p setting used for the response. - "user": "str" # Optional. User identifier. + "output_file_id": "str", # Optional. Output JSONL file. Populated once the + job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied at creation. + } + # response body for status code(s): 400, 403, 404, 409, 422 + 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]] = { @@ -270772,7 +273328,7 @@ def create_response(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: else: _json = body - _request = build_inference_create_response_request( + _request = build_inference_create_batch_request( content_type=content_type, json=_json, content=_content, @@ -270790,49 +273346,124 @@ def create_response(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [201, 400, 403, 404, 409, 422]: 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 = {} - 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.status_code == 201: + 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.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 400: + 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 == 403: + 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 response.status_code == 409: + 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 == 422: + 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_async_invoke( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: + @distributed_trace + def get_batch(self, batch_id: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Generate Image, Audio, or Text-to-Speech Using fal Models. + """Retrieve a Batch Inference Job. - Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous - job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll - for the result. + Returns the current state of a batch job. Poll until ``status`` reaches a terminal value (\\ + ``completed``\\ , ``failed``\\ , ``expired``\\ , or ``cancelled``\\ ). - :param body: Required. - :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 batch_id: The batch job identifier. Required. + :type batch_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -270840,74 +273471,171 @@ def create_async_invoke( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "input": { - "enable_safety_checker": bool, # Optional. Whether to enable the - safety checker for generated content. - "guidance_scale": 0.0, # Optional. Controls how closely the image - generation model follows the prompt. Higher values produce output more - closely matching the prompt. - "num_images": 0, # Optional. The number of images to generate. - "num_inference_steps": 0, # Optional. The number of inference steps - to use during image generation. More steps generally produce higher quality - output but take longer. - "output_format": "str", # Optional. The desired output format or - aspect ratio for image generation. - "prompt": "str", # Optional. The text prompt describing the desired - output. Used for image generation and audio generation models. - "seconds_total": 0, # Optional. The total duration in seconds for - generated audio. Used for audio generation models. - "text": "str" # Optional. The text content to convert to speech. - Used for text-to-speech models. - }, - "model_id": "str", # The ID of the model to invoke asynchronously. Required. - "tags": [ + # response body for status code(s): 200 + response == { + "batch_id": "str", # Unique identifier for the batch job. Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is dispatched to. + Required. + "input_file_id": "str", # The uploaded JSONL input file. Required. + "provider": "str", # Required. Known values are: "openai" and "anthropic". + "status": "str", # Lifecycle status. Terminal states: ``completed``"" , + ``failed``"" , ``expired``"" , ``cancelled``. Required. Known values are: + "validating", "in_progress", "finalizing", "completed", "failed", "expired", + "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. + "completed_at": "2020-02-20 00:00:00", # Optional. + "error_file_id": "str", # Optional. Error sidecar file. Null when no errors + were produced. + "errors": [ { - "key": "str", # The tag key. Required. - "value": "str" # The tag value. Required. + "code": "str", # Optional. Top-level errors that prevented + the batch from completing. + "line": 0, # Optional. 1-based JSONL line number, if + applicable. + "message": "str" # Optional. Top-level errors that prevented + the batch from completing. } - ] + ], + "expires_at": "2020-02-20 00:00:00", # Optional. Derived from ``created_at`` + plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. + "finalizing_at": "2020-02-20 00:00:00", # Optional. + "in_progress_at": "2020-02-20 00:00:00", # Optional. + "metadata": { + "str": "str" # Optional. Metadata attached at creation. + }, + "output_file_id": "str", # Optional. Output JSONL file. Populated once the + job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied at creation. } - - # response body for status code(s): 200, 202 + # response body for status code(s): 403, 404 response == { - "created_at": "2020-02-20 00:00:00", # The timestamp when the request was - created. Required. - "model_id": "str", # The model ID that was invoked. Required. - "request_id": "str", # A unique identifier for the async invocation request. - Use this ID to check the status and retrieve the result. Required. - "status": "str", # The current status of the async invocation. Required. - Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". - "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the - job completed. Null until finished. - "error": "str", # Optional. Error message if the job failed. Null on - success. - "output": { - "str": {} # Optional. The output of the invocation. Null while the - job is queued or in progress. Contains the result once completed. - }, - "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job - started processing. Null while queued. + "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 {}) - @overload - def create_async_invoke( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_inference_get_batch_request( + batch_id=batch_id, + 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, 403, 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 == 403: + 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_batch(self, batch_id: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Generate Image, Audio, or Text-to-Speech Using fal Models. + """Cancel a Batch Inference Job. - Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous - job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll - for the result. + Requests cancellation of a batch job. The job transitions to ``cancelling`` and, once in-flight + requests drain, to ``cancelled``. Jobs already in a terminal state (\\ ``completed``\\ , + ``failed``\\ , ``expired``\\ , ``cancelled``\\ ) cannot be cancelled and return ``409 + Conflict``. - :param body: Required. - :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 + Partial results produced before cancellation remain available via ``GET + /v1/batches/{batch_id}/results``. + + :param batch_id: The batch job identifier. Required. + :type batch_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -270915,39 +273643,184 @@ def create_async_invoke( Example: .. code-block:: python - # response body for status code(s): 200, 202 + # response body for status code(s): 200 response == { - "created_at": "2020-02-20 00:00:00", # The timestamp when the request was - created. Required. - "model_id": "str", # The model ID that was invoked. Required. - "request_id": "str", # A unique identifier for the async invocation request. - Use this ID to check the status and retrieve the result. Required. - "status": "str", # The current status of the async invocation. Required. - Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". - "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the - job completed. Null until finished. - "error": "str", # Optional. Error message if the job failed. Null on - success. - "output": { - "str": {} # Optional. The output of the invocation. Null while the - job is queued or in progress. Contains the result once completed. + "batch_id": "str", # Unique identifier for the batch job. Required. + "completion_window": "str", # Required. "24h" + "created_at": "2020-02-20 00:00:00", # Required. + "endpoint": "str", # Inference endpoint each request is dispatched to. + Required. + "input_file_id": "str", # The uploaded JSONL input file. Required. + "provider": "str", # Required. Known values are: "openai" and "anthropic". + "status": "str", # Lifecycle status. Terminal states: ``completed``"" , + ``failed``"" , ``expired``"" , ``cancelled``. Required. Known values are: + "validating", "in_progress", "finalizing", "completed", "failed", "expired", + "cancelling", and "cancelled". + "cancelled_at": "2020-02-20 00:00:00", # Optional. + "completed_at": "2020-02-20 00:00:00", # Optional. + "error_file_id": "str", # Optional. Error sidecar file. Null when no errors + were produced. + "errors": [ + { + "code": "str", # Optional. Top-level errors that prevented + the batch from completing. + "line": 0, # Optional. 1-based JSONL line number, if + applicable. + "message": "str" # Optional. Top-level errors that prevented + the batch from completing. + } + ], + "expires_at": "2020-02-20 00:00:00", # Optional. Derived from ``created_at`` + plus ``completion_window``. + "failed_at": "2020-02-20 00:00:00", # Optional. + "finalizing_at": "2020-02-20 00:00:00", # Optional. + "in_progress_at": "2020-02-20 00:00:00", # Optional. + "metadata": { + "str": "str" # Optional. Metadata attached at creation. }, - "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job - started processing. Null while queued. + "output_file_id": "str", # Optional. Output JSONL file. Populated once the + job completes. + "request_counts": { + "completed": 0, # Optional. Aggregate request counts. + "failed": 0, # Optional. Aggregate request counts. + "total": 0 # Optional. Aggregate request counts. + }, + "request_id": "str" # Optional. The idempotency key supplied at creation. + } + # response body for status code(s): 403, 404, 409 + 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_inference_cancel_batch_request( + batch_id=batch_id, + 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, 403, 404, 409]: + 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 == 403: + 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 response.status_code == 409: + 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 create_async_invoke(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + def get_batch_results(self, batch_id: str, **kwargs: Any) -> JSON: # pylint: disable=line-too-long - """Generate Image, Audio, or Text-to-Speech Using fal Models. + """Get Batch Inference Results Download Links. - Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous - job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll - for the result. + Returns short-lived presigned download URLs for the output (and optional error sidecar) of a + completed batch job. If results are not yet ready, the response sets ``result_available: + false`` or returns ``412 Precondition Failed``\\ ; in both cases, keep polling batch status and + retry. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param batch_id: The batch job identifier. Required. + :type batch_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -270955,55 +273828,28 @@ def create_async_invoke(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JS Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "input": { - "enable_safety_checker": bool, # Optional. Whether to enable the - safety checker for generated content. - "guidance_scale": 0.0, # Optional. Controls how closely the image - generation model follows the prompt. Higher values produce output more - closely matching the prompt. - "num_images": 0, # Optional. The number of images to generate. - "num_inference_steps": 0, # Optional. The number of inference steps - to use during image generation. More steps generally produce higher quality - output but take longer. - "output_format": "str", # Optional. The desired output format or - aspect ratio for image generation. - "prompt": "str", # Optional. The text prompt describing the desired - output. Used for image generation and audio generation models. - "seconds_total": 0, # Optional. The total duration in seconds for - generated audio. Used for audio generation models. - "text": "str" # Optional. The text content to convert to speech. - Used for text-to-speech models. - }, - "model_id": "str", # The ID of the model to invoke asynchronously. Required. - "tags": [ - { - "key": "str", # The tag key. Required. - "value": "str" # The tag value. Required. - } - ] + # response body for status code(s): 200 + response == { + "batch_id": "str", # Required. + "result_available": bool, # When ``false``"" , keep polling batch status and + retry later. Required. + "error_file_url": "str", # Optional. Presigned URL for the error sidecar + JSONL, if any. + "expires_at": "2020-02-20 00:00:00", # Optional. When the presigned URLs + expire. + "output_file_url": "str" # Optional. Presigned URL for the main results + JSONL. } - - # response body for status code(s): 200, 202 + # response body for status code(s): 403, 404, 412 response == { - "created_at": "2020-02-20 00:00:00", # The timestamp when the request was - created. Required. - "model_id": "str", # The model ID that was invoked. Required. - "request_id": "str", # A unique identifier for the async invocation request. - Use this ID to check the status and retrieve the result. Required. - "status": "str", # The current status of the async invocation. Required. - Known values are: "QUEUED", "IN_PROGRESS", "COMPLETED", and "FAILED". - "completed_at": "2020-02-20 00:00:00", # Optional. The timestamp when the - job completed. Null until finished. - "error": "str", # Optional. Error message if the job failed. Null on - success. - "output": { - "str": {} # Optional. The output of the invocation. Null while the - job is queued or in progress. Contains the result once completed. - }, - "started_at": "2020-02-20 00:00:00" # Optional. The timestamp when the job - started processing. Null while queued. + "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]] = { @@ -271019,26 +273865,13 @@ def create_async_invoke(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JS } 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: - _json = body - - _request = build_inference_create_async_invoke_request( - content_type=content_type, - json=_json, - content=_content, + _request = build_inference_get_batch_results_request( + batch_id=batch_id, headers=_headers, params=_params, ) @@ -271053,7 +273886,7 @@ def create_async_invoke(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JS response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 403, 404, 412]: 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 @@ -271076,7 +273909,39 @@ def create_async_invoke(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JS else: deserialized = None - if response.status_code == 202: + if response.status_code == 403: + 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 response.status_code == 412: response_headers["ratelimit-limit"] = self._deserialize( "int", response.headers.get("ratelimit-limit") ) diff --git a/src/pydo/resources/agent_inference/chat/completions.py b/src/pydo/resources/agent_inference/chat/completions.py index 9dcb5532..c2385494 100644 --- a/src/pydo/resources/agent_inference/chat/completions.py +++ b/src/pydo/resources/agent_inference/chat/completions.py @@ -8,21 +8,11 @@ from typing import Any from pydo import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,4 +26,8 @@ def create(self, **kwargs: Any) -> Any: """Delegates to ``client.agent_inference.create_chat_completion``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap(self._client.agent_inference.create_chat_completion(body, **sdk)) + body = _prepare_body("create_chat_completion", body) + return _wrap_with_id_alias( + self._client.agent_inference.create_chat_completion(body, **sdk), + primary_id_field="chat_completion_id", + ) diff --git a/src/pydo/resources/aio/agent_inference/chat/completions.py b/src/pydo/resources/aio/agent_inference/chat/completions.py index d7021272..b16c1ca4 100644 --- a/src/pydo/resources/aio/agent_inference/chat/completions.py +++ b/src/pydo/resources/aio/agent_inference/chat/completions.py @@ -8,21 +8,11 @@ from typing import Any from pydo.aio import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,6 +26,8 @@ async def create(self, **kwargs: Any) -> Any: """Delegates to ``client.agent_inference.create_chat_completion``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap( - await self._client.agent_inference.create_chat_completion(body, **sdk) + body = _prepare_body("create_chat_completion", body) + return _wrap_with_id_alias( + await self._client.agent_inference.create_chat_completion(body, **sdk), + primary_id_field="chat_completion_id", ) diff --git a/src/pydo/resources/aio/inference/__init__.py b/src/pydo/resources/aio/inference/__init__.py index 8483181c..ecf64a5f 100644 --- a/src/pydo/resources/aio/inference/__init__.py +++ b/src/pydo/resources/aio/inference/__init__.py @@ -8,8 +8,10 @@ from pydo.aio import Client from .async_invoke import AsyncInvoke +from .batches import Batches from .chat import Chat from .embeddings import Embeddings +from .files import Files from .images import Images from .messages import Messages from .models import Models @@ -21,8 +23,10 @@ class InferenceResources: def __init__(self, client: Client) -> None: self.async_invoke = AsyncInvoke(client) + self.batches = Batches(client) self.chat = Chat(client) self.embeddings = Embeddings(client) + self.files = Files(client) self.images = Images(client) self.messages = Messages(client) self.models = Models(client) diff --git a/src/pydo/resources/aio/inference/batches/__init__.py b/src/pydo/resources/aio/inference/batches/__init__.py new file mode 100644 index 00000000..c3757709 --- /dev/null +++ b/src/pydo/resources/aio/inference/batches/__init__.py @@ -0,0 +1,60 @@ +# ------------------------------------ +# Copyright (c) DigitalOcean. +# Licensed under the Apache-2.0 License. +# ------------------------------------ +# Generated by scripts/generate_inference_resources.py — do not edit. +from __future__ import annotations + + +from typing import Any + +from pydo.aio import Client +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, +) +from .files import Files +from .results import Results + + +class Batches: + """Inference resource helper (generated).""" + + def __init__(self, client: Client) -> None: + self._client = client + self.files = Files(client) + self.results = Results(client) + + async def list(self, **kwargs: Any) -> Any: + """Delegates to ``client.inference.list_batches``.""" + return _wrap(await self._client.inference.list_batches(**kwargs)) + + async def create(self, **kwargs: Any) -> Any: + """Delegates to ``client.inference.create_batch``.""" + body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} + sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} + body = _prepare_body("create_batch", body) + return _wrap_with_id_alias( + await self._client.inference.create_batch(body, **sdk), + primary_id_field="batch_id", + ) + + async def get(self, batch_id: str, **kwargs: Any) -> Any: + """Delegates to ``client.inference.get_batch``.""" + return _wrap_with_id_alias( + await self._client.inference.get_batch(batch_id=batch_id, **kwargs), + primary_id_field="batch_id", + ) + + retrieve = get + + async def cancel(self, batch_id: str, **kwargs: Any) -> Any: + """Delegates to ``client.inference.cancel_batch``.""" + return _wrap( + await self._client.inference.cancel_batch(batch_id=batch_id, **kwargs) + ) + + +__all__ = ["Batches"] diff --git a/src/pydo/resources/aio/inference/batches/files.py b/src/pydo/resources/aio/inference/batches/files.py new file mode 100644 index 00000000..901d4d4d --- /dev/null +++ b/src/pydo/resources/aio/inference/batches/files.py @@ -0,0 +1,33 @@ +# ------------------------------------ +# Copyright (c) DigitalOcean. +# Licensed under the Apache-2.0 License. +# ------------------------------------ +# Generated by scripts/generate_inference_resources.py — do not edit. +from __future__ import annotations + +from typing import Any + +from pydo.aio import Client +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, +) + + +class Files: + """Inference resource helper (generated).""" + + def __init__(self, client: Client) -> None: + self._client = client + + async def create(self, **kwargs: Any) -> Any: + """Delegates to ``client.inference.create_batch_file``.""" + body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} + sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} + body = _prepare_body("create_batch_file", body) + return _wrap_with_id_alias( + await self._client.inference.create_batch_file(body, **sdk), + primary_id_field="batch_file_id", + ) diff --git a/src/pydo/resources/aio/inference/batches/results.py b/src/pydo/resources/aio/inference/batches/results.py new file mode 100644 index 00000000..8ddc44eb --- /dev/null +++ b/src/pydo/resources/aio/inference/batches/results.py @@ -0,0 +1,32 @@ +# ------------------------------------ +# Copyright (c) DigitalOcean. +# Licensed under the Apache-2.0 License. +# ------------------------------------ +# Generated by scripts/generate_inference_resources.py — do not edit. +from __future__ import annotations + +from typing import Any + +from pydo.aio import Client +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, +) + + +class Results: + """Inference resource helper (generated).""" + + def __init__(self, client: Client) -> None: + self._client = client + + async def get(self, batch_id: str, **kwargs: Any) -> Any: + """Delegates to ``client.inference.get_batch_results``.""" + return _wrap_with_id_alias( + await self._client.inference.get_batch_results(batch_id=batch_id, **kwargs), + primary_id_field="batch_id", + ) + + retrieve = get diff --git a/src/pydo/resources/aio/inference/chat/completions.py b/src/pydo/resources/aio/inference/chat/completions.py index 7d4fe544..accdb46c 100644 --- a/src/pydo/resources/aio/inference/chat/completions.py +++ b/src/pydo/resources/aio/inference/chat/completions.py @@ -8,21 +8,11 @@ from typing import Any from pydo.aio import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,4 +26,8 @@ async def create(self, **kwargs: Any) -> Any: """Delegates to ``client.inference.create_chat_completion``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap(await self._client.inference.create_chat_completion(body, **sdk)) + body = _prepare_body("create_chat_completion", body) + return _wrap_with_id_alias( + await self._client.inference.create_chat_completion(body, **sdk), + primary_id_field="chat_completion_id", + ) diff --git a/src/pydo/resources/aio/inference/embeddings.py b/src/pydo/resources/aio/inference/embeddings.py index 958a1181..403cbb18 100644 --- a/src/pydo/resources/aio/inference/embeddings.py +++ b/src/pydo/resources/aio/inference/embeddings.py @@ -8,21 +8,11 @@ from typing import Any from pydo.aio import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,4 +26,8 @@ async def create(self, **kwargs: Any) -> Any: """Delegates to ``client.inference.create_embedding``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap(await self._client.inference.create_embedding(body, **sdk)) + body = _prepare_body("create_embedding", body) + return _wrap_with_id_alias( + await self._client.inference.create_embedding(body, **sdk), + primary_id_field="embedding_id", + ) diff --git a/src/pydo/resources/aio/inference/files.py b/src/pydo/resources/aio/inference/files.py new file mode 100644 index 00000000..7fc83f29 --- /dev/null +++ b/src/pydo/resources/aio/inference/files.py @@ -0,0 +1,77 @@ +# ------------------------------------ +# Copyright (c) DigitalOcean. +# Licensed under the Apache-2.0 License. +# ------------------------------------ +# Generated by scripts/generate_inference_resources.py — do not edit. +from __future__ import annotations + +import asyncio +from typing import Any + +from pydo.aio import Client +from pydo.custom_extensions import ( + _SDK_KWARGS, + _FileContent, + _read_file_arg, + _upload_via_presigned, + _wrap, + _wrap_file_content, +) + + +class Files: + """Convenience facade for JSONL input upload and output download.""" + + def __init__(self, client: Client) -> None: + self._client = client + + async def create( + self, + *, + file: Any = None, + purpose: str = "batch", + **kwargs: Any, + ) -> Any: + """Upload a JSONL input file for use with ``batches.create``. + + Combines two spec operations: creating a file intent + (``POST /v1/batches/files``) and uploading bytes to the returned + presigned URL. Returns an object exposing both the canonical + spec fields (``file_id``, ``upload_url``, ``expires_at``) and an + ``id`` alias. + + :keyword file: File content; accepts a filesystem path, raw bytes, + a readable stream, or a ``(name, data)`` tuple. Required. + :keyword purpose: Free-form label retained on the returned object + (``"batch"`` is the only purpose currently used server-side). + """ + name, data, content_type = _read_file_arg(file) + sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} + intent = await self._client.inference.create_batch_file( + {"file_name": name}, **sdk + ) + await asyncio.to_thread( + _upload_via_presigned, intent["upload_url"], data, content_type + ) + result = dict(intent) + result["id"] = result.get("file_id") + result["purpose"] = purpose + result["filename"] = name + result["bytes"] = len(data) + return _wrap(result) + + async def content(self, file_id: str, **kwargs: Any) -> _FileContent: + """Fetch the output of a completed batch job. + + ``file_id`` may be the value read from ``batch.output_file_id`` on + a completed batch. Delegates to ``get_batch_results`` and returns + a response object whose ``.read()`` / ``.text`` accessors lazily + download the referenced presigned URL. + """ + response = await self._client.inference.get_batch_results( + batch_id=file_id, **kwargs + ) + return _wrap_file_content(response) + + +__all__ = ["Files"] diff --git a/src/pydo/resources/aio/inference/images/generations.py b/src/pydo/resources/aio/inference/images/generations.py index fb4fd1b6..ade5be9a 100644 --- a/src/pydo/resources/aio/inference/images/generations.py +++ b/src/pydo/resources/aio/inference/images/generations.py @@ -8,21 +8,11 @@ from typing import Any from pydo.aio import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,4 +26,8 @@ async def generate(self, **kwargs: Any) -> Any: """Delegates to ``client.inference.create_image``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap(await self._client.inference.create_image(body, **sdk)) + body = _prepare_body("create_image", body) + return _wrap_with_id_alias( + await self._client.inference.create_image(body, **sdk), + primary_id_field="image_id", + ) diff --git a/src/pydo/resources/aio/inference/messages.py b/src/pydo/resources/aio/inference/messages.py index 5a290c08..8cad2efa 100644 --- a/src/pydo/resources/aio/inference/messages.py +++ b/src/pydo/resources/aio/inference/messages.py @@ -8,21 +8,11 @@ from typing import Any from pydo.aio import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,4 +26,8 @@ async def create(self, **kwargs: Any) -> Any: """Delegates to ``client.inference.create_messages``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap(await self._client.inference.create_messages(body, **sdk)) + body = _prepare_body("create_messages", body) + return _wrap_with_id_alias( + await self._client.inference.create_messages(body, **sdk), + primary_id_field="messages_id", + ) diff --git a/src/pydo/resources/aio/inference/models.py b/src/pydo/resources/aio/inference/models.py index 2ec9ed18..e02e34f7 100644 --- a/src/pydo/resources/aio/inference/models.py +++ b/src/pydo/resources/aio/inference/models.py @@ -8,21 +8,11 @@ from typing import Any from pydo.aio import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) diff --git a/src/pydo/resources/aio/inference/responses.py b/src/pydo/resources/aio/inference/responses.py index 5abd0c57..229c9752 100644 --- a/src/pydo/resources/aio/inference/responses.py +++ b/src/pydo/resources/aio/inference/responses.py @@ -8,21 +8,11 @@ from typing import Any from pydo.aio import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,4 +26,8 @@ async def create(self, **kwargs: Any) -> Any: """Delegates to ``client.inference.create_response``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap(await self._client.inference.create_response(body, **sdk)) + body = _prepare_body("create_response", body) + return _wrap_with_id_alias( + await self._client.inference.create_response(body, **sdk), + primary_id_field="response_id", + ) diff --git a/src/pydo/resources/client_surface.py b/src/pydo/resources/client_surface.py index c0fd4c8e..8b80aab2 100644 --- a/src/pydo/resources/client_surface.py +++ b/src/pydo/resources/client_surface.py @@ -18,6 +18,12 @@ def async_invoke(self) -> Any: return self._require_inference_resource_root().async_invoke + @property + def batches(self) -> Any: + """Nested serverless inference API under path segment ``batches``.""" + + return self._require_inference_resource_root().batches + @property def chat(self) -> Any: """Nested serverless inference API under path segment ``chat``.""" @@ -30,6 +36,12 @@ def embeddings(self) -> Any: return self._require_inference_resource_root().embeddings + @property + def files(self) -> Any: + """Nested serverless inference API under path segment ``files``.""" + + return self._require_inference_resource_root().files + @property def messages(self) -> Any: """Nested serverless inference API under path segment ``messages``.""" diff --git a/src/pydo/resources/inference/__init__.py b/src/pydo/resources/inference/__init__.py index 367db46c..5411afdd 100644 --- a/src/pydo/resources/inference/__init__.py +++ b/src/pydo/resources/inference/__init__.py @@ -8,8 +8,10 @@ from pydo import Client from .async_invoke import AsyncInvoke +from .batches import Batches from .chat import Chat from .embeddings import Embeddings +from .files import Files from .images import Images from .messages import Messages from .models import Models @@ -21,8 +23,10 @@ class InferenceResources: def __init__(self, client: Client) -> None: self.async_invoke = AsyncInvoke(client) + self.batches = Batches(client) self.chat = Chat(client) self.embeddings = Embeddings(client) + self.files = Files(client) self.images = Images(client) self.messages = Messages(client) self.models = Models(client) diff --git a/src/pydo/resources/inference/batches/__init__.py b/src/pydo/resources/inference/batches/__init__.py new file mode 100644 index 00000000..fa5369e9 --- /dev/null +++ b/src/pydo/resources/inference/batches/__init__.py @@ -0,0 +1,58 @@ +# ------------------------------------ +# Copyright (c) DigitalOcean. +# Licensed under the Apache-2.0 License. +# ------------------------------------ +# Generated by scripts/generate_inference_resources.py — do not edit. +from __future__ import annotations + + +from typing import Any + +from pydo import Client +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, +) +from .files import Files +from .results import Results + + +class Batches: + """Inference resource helper (generated).""" + + def __init__(self, client: Client) -> None: + self._client = client + self.files = Files(client) + self.results = Results(client) + + def list(self, **kwargs: Any) -> Any: + """Delegates to ``client.inference.list_batches``.""" + return _wrap(self._client.inference.list_batches(**kwargs)) + + def create(self, **kwargs: Any) -> Any: + """Delegates to ``client.inference.create_batch``.""" + body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} + sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} + body = _prepare_body("create_batch", body) + return _wrap_with_id_alias( + self._client.inference.create_batch(body, **sdk), + primary_id_field="batch_id", + ) + + def get(self, batch_id: str, **kwargs: Any) -> Any: + """Delegates to ``client.inference.get_batch``.""" + return _wrap_with_id_alias( + self._client.inference.get_batch(batch_id=batch_id, **kwargs), + primary_id_field="batch_id", + ) + + retrieve = get + + def cancel(self, batch_id: str, **kwargs: Any) -> Any: + """Delegates to ``client.inference.cancel_batch``.""" + return _wrap(self._client.inference.cancel_batch(batch_id=batch_id, **kwargs)) + + +__all__ = ["Batches"] diff --git a/src/pydo/resources/inference/batches/files.py b/src/pydo/resources/inference/batches/files.py new file mode 100644 index 00000000..87e2f5ba --- /dev/null +++ b/src/pydo/resources/inference/batches/files.py @@ -0,0 +1,33 @@ +# ------------------------------------ +# Copyright (c) DigitalOcean. +# Licensed under the Apache-2.0 License. +# ------------------------------------ +# Generated by scripts/generate_inference_resources.py — do not edit. +from __future__ import annotations + +from typing import Any + +from pydo import Client +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, +) + + +class Files: + """Inference resource helper (generated).""" + + def __init__(self, client: Client) -> None: + self._client = client + + def create(self, **kwargs: Any) -> Any: + """Delegates to ``client.inference.create_batch_file``.""" + body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} + sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} + body = _prepare_body("create_batch_file", body) + return _wrap_with_id_alias( + self._client.inference.create_batch_file(body, **sdk), + primary_id_field="batch_file_id", + ) diff --git a/src/pydo/resources/inference/batches/results.py b/src/pydo/resources/inference/batches/results.py new file mode 100644 index 00000000..e03246b1 --- /dev/null +++ b/src/pydo/resources/inference/batches/results.py @@ -0,0 +1,32 @@ +# ------------------------------------ +# Copyright (c) DigitalOcean. +# Licensed under the Apache-2.0 License. +# ------------------------------------ +# Generated by scripts/generate_inference_resources.py — do not edit. +from __future__ import annotations + +from typing import Any + +from pydo import Client +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, +) + + +class Results: + """Inference resource helper (generated).""" + + def __init__(self, client: Client) -> None: + self._client = client + + def get(self, batch_id: str, **kwargs: Any) -> Any: + """Delegates to ``client.inference.get_batch_results``.""" + return _wrap_with_id_alias( + self._client.inference.get_batch_results(batch_id=batch_id, **kwargs), + primary_id_field="batch_id", + ) + + retrieve = get diff --git a/src/pydo/resources/inference/chat/completions.py b/src/pydo/resources/inference/chat/completions.py index fec98f99..ebf11796 100644 --- a/src/pydo/resources/inference/chat/completions.py +++ b/src/pydo/resources/inference/chat/completions.py @@ -8,21 +8,11 @@ from typing import Any from pydo import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,4 +26,8 @@ def create(self, **kwargs: Any) -> Any: """Delegates to ``client.inference.create_chat_completion``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap(self._client.inference.create_chat_completion(body, **sdk)) + body = _prepare_body("create_chat_completion", body) + return _wrap_with_id_alias( + self._client.inference.create_chat_completion(body, **sdk), + primary_id_field="chat_completion_id", + ) diff --git a/src/pydo/resources/inference/embeddings.py b/src/pydo/resources/inference/embeddings.py index d49c71b7..44fceb41 100644 --- a/src/pydo/resources/inference/embeddings.py +++ b/src/pydo/resources/inference/embeddings.py @@ -8,21 +8,11 @@ from typing import Any from pydo import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,4 +26,8 @@ def create(self, **kwargs: Any) -> Any: """Delegates to ``client.inference.create_embedding``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap(self._client.inference.create_embedding(body, **sdk)) + body = _prepare_body("create_embedding", body) + return _wrap_with_id_alias( + self._client.inference.create_embedding(body, **sdk), + primary_id_field="embedding_id", + ) diff --git a/src/pydo/resources/inference/files.py b/src/pydo/resources/inference/files.py new file mode 100644 index 00000000..93f5d955 --- /dev/null +++ b/src/pydo/resources/inference/files.py @@ -0,0 +1,70 @@ +# ------------------------------------ +# Copyright (c) DigitalOcean. +# Licensed under the Apache-2.0 License. +# ------------------------------------ +# Generated by scripts/generate_inference_resources.py — do not edit. +from __future__ import annotations + +from typing import Any + +from pydo import Client +from pydo.custom_extensions import ( + _SDK_KWARGS, + _FileContent, + _read_file_arg, + _upload_via_presigned, + _wrap, + _wrap_file_content, +) + + +class Files: + """Convenience facade for JSONL input upload and output download.""" + + def __init__(self, client: Client) -> None: + self._client = client + + def create( + self, + *, + file: Any = None, + purpose: str = "batch", + **kwargs: Any, + ) -> Any: + """Upload a JSONL input file for use with ``batches.create``. + + Combines two spec operations: creating a file intent + (``POST /v1/batches/files``) and uploading bytes to the returned + presigned URL. Returns an object exposing both the canonical + spec fields (``file_id``, ``upload_url``, ``expires_at``) and an + ``id`` alias. + + :keyword file: File content; accepts a filesystem path, raw bytes, + a readable stream, or a ``(name, data)`` tuple. Required. + :keyword purpose: Free-form label retained on the returned object + (``"batch"`` is the only purpose currently used server-side). + """ + name, data, content_type = _read_file_arg(file) + sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} + intent = self._client.inference.create_batch_file({"file_name": name}, **sdk) + _upload_via_presigned(intent["upload_url"], data, content_type) + result = dict(intent) + result["id"] = result.get("file_id") + result["purpose"] = purpose + result["filename"] = name + result["bytes"] = len(data) + return _wrap(result) + + def content(self, file_id: str, **kwargs: Any) -> _FileContent: + """Fetch the output of a completed batch job. + + ``file_id`` may be the value read from ``batch.output_file_id`` on + a completed batch. Delegates to ``get_batch_results`` and returns + a response object whose ``.read()`` / ``.text`` accessors lazily + download the referenced presigned URL. + """ + response = self._client.inference.get_batch_results(batch_id=file_id, **kwargs) + return _wrap_file_content(response) + + +__all__ = ["Files"] diff --git a/src/pydo/resources/inference/images/generations.py b/src/pydo/resources/inference/images/generations.py index 4dd40be4..2b188586 100644 --- a/src/pydo/resources/inference/images/generations.py +++ b/src/pydo/resources/inference/images/generations.py @@ -8,21 +8,11 @@ from typing import Any from pydo import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,4 +26,8 @@ def generate(self, **kwargs: Any) -> Any: """Delegates to ``client.inference.create_image``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap(self._client.inference.create_image(body, **sdk)) + body = _prepare_body("create_image", body) + return _wrap_with_id_alias( + self._client.inference.create_image(body, **sdk), + primary_id_field="image_id", + ) diff --git a/src/pydo/resources/inference/messages.py b/src/pydo/resources/inference/messages.py index 843106fc..75237187 100644 --- a/src/pydo/resources/inference/messages.py +++ b/src/pydo/resources/inference/messages.py @@ -8,21 +8,11 @@ from typing import Any from pydo import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,4 +26,8 @@ def create(self, **kwargs: Any) -> Any: """Delegates to ``client.inference.create_messages``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap(self._client.inference.create_messages(body, **sdk)) + body = _prepare_body("create_messages", body) + return _wrap_with_id_alias( + self._client.inference.create_messages(body, **sdk), + primary_id_field="messages_id", + ) diff --git a/src/pydo/resources/inference/models.py b/src/pydo/resources/inference/models.py index de56966f..8f896c09 100644 --- a/src/pydo/resources/inference/models.py +++ b/src/pydo/resources/inference/models.py @@ -8,21 +8,11 @@ from typing import Any from pydo import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) diff --git a/src/pydo/resources/inference/responses.py b/src/pydo/resources/inference/responses.py index 2ac22573..1160c30e 100644 --- a/src/pydo/resources/inference/responses.py +++ b/src/pydo/resources/inference/responses.py @@ -8,21 +8,11 @@ from typing import Any from pydo import Client -from pydo.custom_extensions import _wrap - -_SDK_KWARGS = frozenset( - { - "cls", - "content_type", - "continuation_token", - "error_map", - "form_content_type", - "headers", - "params", - "polling", - "raw_request_hook", - "raw_response_hook", - } +from pydo.custom_extensions import ( + _SDK_KWARGS, + _prepare_body, + _wrap, + _wrap_with_id_alias, ) @@ -36,4 +26,8 @@ def create(self, **kwargs: Any) -> Any: """Delegates to ``client.inference.create_response``.""" body = {k: v for k, v in kwargs.items() if k not in _SDK_KWARGS} sdk = {k: v for k, v in kwargs.items() if k in _SDK_KWARGS} - return _wrap(self._client.inference.create_response(body, **sdk)) + body = _prepare_body("create_response", body) + return _wrap_with_id_alias( + self._client.inference.create_response(body, **sdk), + primary_id_field="response_id", + ) diff --git a/src/pydo/resources/inference_surface.json b/src/pydo/resources/inference_surface.json index 73772f08..3c765863 100644 --- a/src/pydo/resources/inference_surface.json +++ b/src/pydo/resources/inference_surface.json @@ -7,21 +7,30 @@ "chat", "completions" ], - "facade_method": "create" + "path_params": [], + "facade_methods": [ + "create" + ] }, { "op_method": "create_messages", "path_segments": [ "messages" ], - "facade_method": "create" + "path_params": [], + "facade_methods": [ + "create" + ] }, { "op_method": "create_embedding", "path_segments": [ "embeddings" ], - "facade_method": "create" + "path_params": [], + "facade_methods": [ + "create" + ] }, { "op_method": "create_image", @@ -29,28 +38,110 @@ "images", "generations" ], - "facade_method": "generate" + "path_params": [], + "facade_methods": [ + "generate" + ] }, { "op_method": "list_models", "path_segments": [ "models" ], - "facade_method": "list" + "path_params": [], + "facade_methods": [ + "list" + ] }, { "op_method": "create_response", "path_segments": [ "responses" ], - "facade_method": "create" + "path_params": [], + "facade_methods": [ + "create" + ] }, { "op_method": "create_async_invoke", "path_segments": [ "async_invoke" ], - "facade_method": "create" + "path_params": [], + "facade_methods": [ + "create" + ] + }, + { + "op_method": "create_batch_file", + "path_segments": [ + "batches", + "files" + ], + "path_params": [], + "facade_methods": [ + "create" + ] + }, + { + "op_method": "list_batches", + "path_segments": [ + "batches" + ], + "path_params": [], + "facade_methods": [ + "list" + ] + }, + { + "op_method": "create_batch", + "path_segments": [ + "batches" + ], + "path_params": [], + "facade_methods": [ + "create" + ] + }, + { + "op_method": "get_batch", + "path_segments": [ + "batches" + ], + "path_params": [ + "batch_id" + ], + "facade_methods": [ + "get", + "retrieve" + ] + }, + { + "op_method": "cancel_batch", + "path_segments": [ + "batches" + ], + "path_params": [ + "batch_id" + ], + "facade_methods": [ + "cancel" + ] + }, + { + "op_method": "get_batch_results", + "path_segments": [ + "batches", + "results" + ], + "path_params": [ + "batch_id" + ], + "facade_methods": [ + "get", + "retrieve" + ] } ], "agent_inference": [ @@ -60,7 +151,10 @@ "chat", "completions" ], - "facade_method": "create" + "path_params": [], + "facade_methods": [ + "create" + ] } ] } diff --git a/src/pydo/types/__init__.py b/src/pydo/types/__init__.py index 7f0ab16e..6d7ccfb3 100644 --- a/src/pydo/types/__init__.py +++ b/src/pydo/types/__init__.py @@ -15,11 +15,16 @@ """ from pydo.types.async_invoke import AsyncInvokeResponse +from pydo.types.batches import BatchFileCreateResponse +from pydo.types.batches import BatchListResponse +from pydo.types.batches import BatchResultsResponse +from pydo.types.batches import Error from pydo.types.chat import ChatCompletionChunk from pydo.types.chat import ChatCompletion from pydo.types.chat import ChatCompletionStreamResponseDelta from pydo.types.chat import ChatCompletionTokenLogprob from pydo.types.chat import CompletionUsage +from pydo.types.create import Batch from pydo.types.embeddings import EmbeddingDataItem from pydo.types.embeddings import EmbeddingsResponse from pydo.types.embeddings import EmbeddingsUsage @@ -40,11 +45,16 @@ __all__ = [ "AsyncInvokeResponse", + "BatchFileCreateResponse", + "BatchListResponse", + "BatchResultsResponse", + "Error", "ChatCompletionChunk", "ChatCompletion", "ChatCompletionStreamResponseDelta", "ChatCompletionTokenLogprob", "CompletionUsage", + "Batch", "EmbeddingDataItem", "EmbeddingsResponse", "EmbeddingsUsage", diff --git a/src/pydo/types/batches/__init__.py b/src/pydo/types/batches/__init__.py new file mode 100644 index 00000000..a9297b48 --- /dev/null +++ b/src/pydo/types/batches/__init__.py @@ -0,0 +1,56 @@ +# ------------------------------------ +# Copyright (c) DigitalOcean. +# Licensed under the Apache-2.0 License. +# ------------------------------------ +# Generated by scripts/generate_inference_types.py — do not edit. +from __future__ import annotations + +from typing import Any, List, Optional + +from pydo.custom_extensions import DotDict + + +class BatchFileCreateResponse(DotDict): + """Typed response for ``batch_file_create_response`` schema.""" + + file_id: str # Pass this value as `file_id` when creating a batch job + upload_url: str + expires_at: Optional[str] # When `upload_url` expires + + +class BatchListResponse(DotDict): + """Typed response for ``batch_list_response`` schema.""" + + object: str # The object type, always `list` + data: List[Any] # Batch jobs on this page, ordered newest first + first_id: Optional[ + str + ] # ID of the first batch on this page. Null when the page is empty + last_id: Optional[str] + has_more: bool # Whether additional batches exist beyond this page + + +class BatchResultsResponse(DotDict): + """Typed response for ``batch_results_response`` schema.""" + + batch_id: str + result_available: bool + output_file_url: Optional[str] # Presigned URL for the main results JSONL + error_file_url: Optional[str] # Presigned URL for the error sidecar JSONL, if any + expires_at: Optional[str] # When the presigned URLs expire + + +class Error(DotDict): + """Typed response for ``error`` schema.""" + + id: str + message: str + request_id: str + + +__all__ = [ + "BatchFileCreateResponse", + "BatchListResponse", + "BatchResultsResponse", + "Error", +] diff --git a/src/pydo/types/create/__init__.py b/src/pydo/types/create/__init__.py new file mode 100644 index 00000000..3ce7fe16 --- /dev/null +++ b/src/pydo/types/create/__init__.py @@ -0,0 +1,41 @@ +# ------------------------------------ +# Copyright (c) DigitalOcean. +# Licensed under the Apache-2.0 License. +# ------------------------------------ +# Generated by scripts/generate_inference_types.py — do not edit. +from __future__ import annotations + +from typing import Any, List, Optional + +from pydo.custom_extensions import DotDict + + +class Batch(DotDict): + """Typed response for ``batch`` schema.""" + + batch_id: str # Unique identifier for the batch job + status: str + provider: str + endpoint: str # Inference endpoint each request is dispatched to + completion_window: str + input_file_id: str # The uploaded JSONL input file + output_file_id: Optional[str] # Output JSONL file. Populated once the job completes + error_file_id: Optional[ + str + ] # Error sidecar file. Null when no errors were produced + request_counts: Any # Aggregate request counts + request_id: str # The idempotency key supplied at creation + metadata: Optional[Any] # Metadata attached at creation + errors: Optional[ + List[Any] + ] # Top-level errors that prevented the batch from completing + created_at: str + in_progress_at: Optional[str] + finalizing_at: Optional[str] + completed_at: Optional[str] + expires_at: Optional[str] # Derived from `created_at` plus `completion_window` + cancelled_at: Optional[str] + failed_at: Optional[str] + + +__all__ = ["Batch"]