diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AuditLogsClient.ListAuditLogs.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AuditLogsClient.ListAuditLogs.g.cs index 3c5420b31..0c113686c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AuditLogsClient.ListAuditLogs.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AuditLogsClient.ListAuditLogs.g.cs @@ -237,6 +237,8 @@ partial void ProcessListAuditLogsResponseContent( after: after, before: before); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ActivateCertificatesForOrganization.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ActivateCertificatesForOrganization.g.cs index 435abc66b..96cf43a78 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ActivateCertificatesForOrganization.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ActivateCertificatesForOrganization.g.cs @@ -160,6 +160,8 @@ partial void ProcessActivateCertificatesForOrganizationResponseContent( httpRequestMessage: __httpRequest, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ActivateCertificatesForProject.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ActivateCertificatesForProject.g.cs index a495cf538..9acbd8a0a 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ActivateCertificatesForProject.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ActivateCertificatesForProject.g.cs @@ -169,6 +169,8 @@ partial void ProcessActivateCertificatesForProjectResponseContent( projectId: projectId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeactivateCertificatesForOrganization.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeactivateCertificatesForOrganization.g.cs index 2bd63e939..084bfc1cc 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeactivateCertificatesForOrganization.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeactivateCertificatesForOrganization.g.cs @@ -160,6 +160,8 @@ partial void ProcessDeactivateCertificatesForOrganizationResponseContent( httpRequestMessage: __httpRequest, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeactivateCertificatesForProject.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeactivateCertificatesForProject.g.cs index 444579cd1..435f0c02f 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeactivateCertificatesForProject.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeactivateCertificatesForProject.g.cs @@ -169,6 +169,8 @@ partial void ProcessDeactivateCertificatesForProjectResponseContent( projectId: projectId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeleteCertificate.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeleteCertificate.g.cs index c88983d79..5d9ff1eb7 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeleteCertificate.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.DeleteCertificate.g.cs @@ -149,6 +149,8 @@ partial void ProcessDeleteCertificateResponseContent( httpRequestMessage: __httpRequest, certificateId: certificateId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.GetCertificate.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.GetCertificate.g.cs index 2b21bd0eb..498f78255 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.GetCertificate.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.GetCertificate.g.cs @@ -161,6 +161,8 @@ partial void ProcessGetCertificateResponseContent( certificateId: certificateId!, include: include); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ListOrganizationCertificates.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ListOrganizationCertificates.g.cs index 7740c63dd..e5a4f08f2 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ListOrganizationCertificates.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ListOrganizationCertificates.g.cs @@ -178,6 +178,8 @@ partial void ProcessListOrganizationCertificatesResponseContent( after: after, order: order); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ListProjectCertificates.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ListProjectCertificates.g.cs index f1104aac7..19c744c63 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ListProjectCertificates.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ListProjectCertificates.g.cs @@ -187,6 +187,8 @@ partial void ProcessListProjectCertificatesResponseContent( after: after, order: order); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ModifyCertificate.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ModifyCertificate.g.cs index 91b013837..9625a9d5d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ModifyCertificate.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.ModifyCertificate.g.cs @@ -167,6 +167,8 @@ partial void ProcessModifyCertificateResponseContent( certificateId: certificateId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.UploadCertificate.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.UploadCertificate.g.cs index 799a98ae3..499ead2ae 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.UploadCertificate.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.CertificatesClient.UploadCertificate.g.cs @@ -160,6 +160,8 @@ partial void ProcessUploadCertificateResponseContent( httpRequestMessage: __httpRequest, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.AssignOrganizationRoleToGroup.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.AssignOrganizationRoleToGroup.g.cs index 5f8caae89..8b47c936d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.AssignOrganizationRoleToGroup.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.AssignOrganizationRoleToGroup.g.cs @@ -167,6 +167,8 @@ partial void ProcessAssignOrganizationRoleToGroupResponseContent( groupId: groupId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.ListGroupOrganizationRoleAssignments.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.ListGroupOrganizationRoleAssignments.g.cs index 1c2223048..0dcf173eb 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.ListGroupOrganizationRoleAssignments.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.ListGroupOrganizationRoleAssignments.g.cs @@ -179,6 +179,8 @@ partial void ProcessListGroupOrganizationRoleAssignmentsResponseContent( after: after, order: order); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.UnassignOrganizationRoleFromGroup.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.UnassignOrganizationRoleFromGroup.g.cs index 49f0a930f..7432e16fb 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.UnassignOrganizationRoleFromGroup.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupOrganizationRoleAssignmentsClient.UnassignOrganizationRoleFromGroup.g.cs @@ -156,6 +156,8 @@ partial void ProcessUnassignOrganizationRoleFromGroupResponseContent( groupId: groupId!, roleId: roleId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.AddGroupUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.AddGroupUser.g.cs index c1cfac746..775d655c4 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.AddGroupUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.AddGroupUser.g.cs @@ -167,6 +167,8 @@ partial void ProcessAddGroupUserResponseContent( groupId: groupId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.ListGroupUsers.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.ListGroupUsers.g.cs index 6e24571a9..00bae4572 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.ListGroupUsers.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.ListGroupUsers.g.cs @@ -187,6 +187,8 @@ partial void ProcessListGroupUsersResponseContent( after: after, order: order); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.RemoveGroupUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.RemoveGroupUser.g.cs index 5104d5ca1..fe6dee633 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.RemoveGroupUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupUsersClient.RemoveGroupUser.g.cs @@ -156,6 +156,8 @@ partial void ProcessRemoveGroupUserResponseContent( groupId: groupId!, userId: userId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.CreateGroup.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.CreateGroup.g.cs index 3c474b881..7a87637b4 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.CreateGroup.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.CreateGroup.g.cs @@ -158,6 +158,8 @@ partial void ProcessCreateGroupResponseContent( httpRequestMessage: __httpRequest, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.DeleteGroup.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.DeleteGroup.g.cs index 569d37d5b..6147be81d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.DeleteGroup.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.DeleteGroup.g.cs @@ -147,6 +147,8 @@ partial void ProcessDeleteGroupResponseContent( httpRequestMessage: __httpRequest, groupId: groupId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.ListGroups.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.ListGroups.g.cs index 9c84fdc3e..0f8b7f48b 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.ListGroups.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.ListGroups.g.cs @@ -178,6 +178,8 @@ partial void ProcessListGroupsResponseContent( after: after, order: order); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.UpdateGroup.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.UpdateGroup.g.cs index 5839e01fc..ab46b2922 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.UpdateGroup.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.GroupsClient.UpdateGroup.g.cs @@ -167,6 +167,8 @@ partial void ProcessUpdateGroupResponseContent( groupId: groupId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEdit.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEdit.g.cs index 662b7e08f..f81a8262c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEdit.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEdit.g.cs @@ -136,206 +136,5 @@ public partial interface IImagesClient global::tryAGI.OpenAI.CreateImageEditRequestQuality? quality = default, global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`.
- /// You can call this endpoint with either:
- /// - `multipart/form-data`: use binary uploads via `image` (and optional `mask`).
- /// - `application/json`: use `images` (and optional `mask`) as references with either `image_url` or `file_id`.
- /// Note that JSON requests use `images` (array) instead of the multipart `image` field. - ///
- /// - /// The image(s) to edit. Must be a supported image file or an array of images.
- /// For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`
- /// file less than 50MB. You can provide up to 16 images.
- /// `chatgpt-image-latest` follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square
- /// `png` file less than 4MB. - /// - /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
- /// Example: A cute baby sea otter wearing a beret - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// Allows to set transparency for the background of the generated image(s).
- /// This parameter is only supported for the GPT image models. Must be one of
- /// `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
- /// model will automatically determine the best background for the image.
- /// If `transparent`, the output format needs to support transparency, so it
- /// should be set to either `png` (default value) or `webp`.
- /// Default Value: auto
- /// Example: transparent - /// - /// - /// The model to use for image generation. Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
- /// Example: gpt-image-1.5 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url - /// - /// - /// The format in which the generated images are returned. This parameter is
- /// only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
- /// The default value is `png`.
- /// Default Value: png
- /// Example: png - /// - /// - /// The compression level (0-100%) for the generated images. This parameter
- /// is only supported for the GPT image models with the `webp` or `jpeg` output
- /// formats, and defaults to 100.
- /// Default Value: 100
- /// Example: 100 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
- /// Example: user-1234 - /// - /// - /// - /// - /// The quality of the image that will be generated for GPT image models. Defaults to `auto`.
- /// Default Value: auto
- /// Example: high - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateImageEditAsync( - global::tryAGI.OpenAI.AnyOf> image, - string prompt, - global::System.IO.Stream? mask = default, - string? maskname = default, - global::tryAGI.OpenAI.CreateImageEditRequestBackground? background = default, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.AnyOf? size = default, - global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat? outputFormat = default, - int? outputCompression = default, - string? user = default, - global::tryAGI.OpenAI.InputFidelity? inputFidelity = default, - int? partialImages = default, - global::tryAGI.OpenAI.CreateImageEditRequestQuality? quality = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`.
- /// You can call this endpoint with either:
- /// - `multipart/form-data`: use binary uploads via `image` (and optional `mask`).
- /// - `application/json`: use `images` (and optional `mask`) as references with either `image_url` or `file_id`.
- /// Note that JSON requests use `images` (array) instead of the multipart `image` field. - ///
- /// - /// The image(s) to edit. Must be a supported image file or an array of images.
- /// For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`
- /// file less than 50MB. You can provide up to 16 images.
- /// `chatgpt-image-latest` follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square
- /// `png` file less than 4MB. - /// - /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
- /// Example: A cute baby sea otter wearing a beret - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// Allows to set transparency for the background of the generated image(s).
- /// This parameter is only supported for the GPT image models. Must be one of
- /// `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
- /// model will automatically determine the best background for the image.
- /// If `transparent`, the output format needs to support transparency, so it
- /// should be set to either `png` (default value) or `webp`.
- /// Default Value: auto
- /// Example: transparent - /// - /// - /// The model to use for image generation. Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
- /// Example: gpt-image-1.5 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url - /// - /// - /// The format in which the generated images are returned. This parameter is
- /// only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
- /// The default value is `png`.
- /// Default Value: png
- /// Example: png - /// - /// - /// The compression level (0-100%) for the generated images. This parameter
- /// is only supported for the GPT image models with the `webp` or `jpeg` output
- /// formats, and defaults to 100.
- /// Default Value: 100
- /// Example: 100 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
- /// Example: user-1234 - /// - /// - /// - /// - /// The quality of the image that will be generated for GPT image models. Defaults to `auto`.
- /// Default Value: auto
- /// Example: high - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> CreateImageEditAsResponseAsync( - global::tryAGI.OpenAI.AnyOf> image, - string prompt, - global::System.IO.Stream? mask = default, - string? maskname = default, - global::tryAGI.OpenAI.CreateImageEditRequestBackground? background = default, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.AnyOf? size = default, - global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat? outputFormat = default, - int? outputCompression = default, - string? user = default, - global::tryAGI.OpenAI.InputFidelity? inputFidelity = default, - int? partialImages = default, - global::tryAGI.OpenAI.CreateImageEditRequestQuality? quality = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEditAsStream.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEditAsStream.g.cs index 2c994acc3..5cc4b2607 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEditAsStream.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IImagesClient.CreateImageEditAsStream.g.cs @@ -120,106 +120,5 @@ public partial interface IImagesClient global::tryAGI.OpenAI.CreateImageEditRequestQuality? quality = default, global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`.
- /// You can call this endpoint with either:
- /// - `multipart/form-data`: use binary uploads via `image` (and optional `mask`).
- /// - `application/json`: use `images` (and optional `mask`) as references with either `image_url` or `file_id`.
- /// Note that JSON requests use `images` (array) instead of the multipart `image` field. - ///
- /// - /// The image(s) to edit. Must be a supported image file or an array of images.
- /// For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`
- /// file less than 50MB. You can provide up to 16 images.
- /// `chatgpt-image-latest` follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square
- /// `png` file less than 4MB. - /// - /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
- /// Example: A cute baby sea otter wearing a beret - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// Allows to set transparency for the background of the generated image(s).
- /// This parameter is only supported for the GPT image models. Must be one of
- /// `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
- /// model will automatically determine the best background for the image.
- /// If `transparent`, the output format needs to support transparency, so it
- /// should be set to either `png` (default value) or `webp`.
- /// Default Value: auto
- /// Example: transparent - /// - /// - /// The model to use for image generation. Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
- /// Example: gpt-image-1.5 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url - /// - /// - /// The format in which the generated images are returned. This parameter is
- /// only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
- /// The default value is `png`.
- /// Default Value: png
- /// Example: png - /// - /// - /// The compression level (0-100%) for the generated images. This parameter
- /// is only supported for the GPT image models with the `webp` or `jpeg` output
- /// formats, and defaults to 100.
- /// Default Value: 100
- /// Example: 100 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
- /// Example: user-1234 - /// - /// - /// - /// - /// The quality of the image that will be generated for GPT image models. Defaults to `auto`.
- /// Default Value: auto
- /// Example: high - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Collections.Generic.IAsyncEnumerable CreateImageEditAsStreamAsync( - global::tryAGI.OpenAI.AnyOf> image, - string prompt, - global::System.IO.Stream? mask = default, - string? maskname = default, - global::tryAGI.OpenAI.CreateImageEditRequestBackground? background = default, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.AnyOf? size = default, - global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat? outputFormat = default, - int? outputCompression = default, - string? user = default, - global::tryAGI.OpenAI.InputFidelity? inputFidelity = default, - int? partialImages = default, - global::tryAGI.OpenAI.CreateImageEditRequestQuality? quality = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEdit.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEdit.g.cs index 28e0575f3..6732fbf94 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEdit.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEdit.g.cs @@ -733,1244 +733,5 @@ request.Maskname is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } - - /// - /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`.
- /// You can call this endpoint with either:
- /// - `multipart/form-data`: use binary uploads via `image` (and optional `mask`).
- /// - `application/json`: use `images` (and optional `mask`) as references with either `image_url` or `file_id`.
- /// Note that JSON requests use `images` (array) instead of the multipart `image` field. - ///
- /// - /// The image(s) to edit. Must be a supported image file or an array of images.
- /// For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`
- /// file less than 50MB. You can provide up to 16 images.
- /// `chatgpt-image-latest` follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square
- /// `png` file less than 4MB. - /// - /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
- /// Example: A cute baby sea otter wearing a beret - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// Allows to set transparency for the background of the generated image(s).
- /// This parameter is only supported for the GPT image models. Must be one of
- /// `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
- /// model will automatically determine the best background for the image.
- /// If `transparent`, the output format needs to support transparency, so it
- /// should be set to either `png` (default value) or `webp`.
- /// Default Value: auto
- /// Example: transparent - /// - /// - /// The model to use for image generation. Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
- /// Example: gpt-image-1.5 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url - /// - /// - /// The format in which the generated images are returned. This parameter is
- /// only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
- /// The default value is `png`.
- /// Default Value: png
- /// Example: png - /// - /// - /// The compression level (0-100%) for the generated images. This parameter
- /// is only supported for the GPT image models with the `webp` or `jpeg` output
- /// formats, and defaults to 100.
- /// Default Value: 100
- /// Example: 100 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
- /// Example: user-1234 - /// - /// - /// - /// - /// The quality of the image that will be generated for GPT image models. Defaults to `auto`.
- /// Default Value: auto
- /// Example: high - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateImageEditAsync( - global::tryAGI.OpenAI.AnyOf> image, - string prompt, - global::System.IO.Stream? mask = default, - string? maskname = default, - global::tryAGI.OpenAI.CreateImageEditRequestBackground? background = default, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.AnyOf? size = default, - global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat? outputFormat = default, - int? outputCompression = default, - string? user = default, - global::tryAGI.OpenAI.InputFidelity? inputFidelity = default, - int? partialImages = default, - global::tryAGI.OpenAI.CreateImageEditRequestQuality? quality = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - var request = new global::tryAGI.OpenAI.CreateImageEditRequest - { - Image = image, - Prompt = prompt, - Mask = global::System.Array.Empty(), - Maskname = maskname, - Background = background, - Model = model, - N = n, - Size = size, - ResponseFormat = responseFormat, - OutputFormat = outputFormat, - OutputCompression = outputCompression, - User = user, - InputFidelity = inputFidelity, - Stream = false, - PartialImages = partialImages, - Quality = quality, - }; - PrepareArguments( - client: HttpClient); - PrepareCreateImageEditArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::tryAGI.OpenAI.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_CreateImageEditSecurityRequirements, - operationName: "CreateImageEditAsync"); - - using var __timeoutCancellationTokenSource = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::tryAGI.OpenAI.PathBuilder( - path: "/images/edits", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Image.ToString() ?? string.Empty), - name: "\"image\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (mask != default) - { - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.Background != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Background).HasValue ? (request.Background).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"background\""); - - } - if (request.Model != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToString() ?? string.Empty), - name: "\"model\""); - - } - if (request.N != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.N, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"n\""); - - } - if (request.Size != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Size.ToString() ?? string.Empty), - name: "\"size\""); - - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResponseFormat).HasValue ? (request.ResponseFormat).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"response_format\""); - - } - if (request.OutputFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.OutputFormat).HasValue ? (request.OutputFormat).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"output_format\""); - - } - if (request.OutputCompression != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.OutputCompression, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"output_compression\""); - - } - if (request.User != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.User ?? string.Empty), - name: "\"user\""); - - } - if (request.InputFidelity != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.InputFidelity.ToString() ?? string.Empty), - name: "\"input_fidelity\""); - - } - if (request.Stream != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Stream, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"stream\""); - - } - if (request.PartialImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.PartialImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"partial_images\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateImageEditRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEdit", - methodName: "CreateImageEditAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEdit", - methodName: "CreateImageEditAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEdit", - methodName: "CreateImageEditAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateImageEditResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEdit", - methodName: "CreateImageEditAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEdit", - methodName: "CreateImageEditAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateImageEditResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::tryAGI.OpenAI.ImagesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::tryAGI.OpenAI.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::tryAGI.OpenAI.ImagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::tryAGI.OpenAI.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`.
- /// You can call this endpoint with either:
- /// - `multipart/form-data`: use binary uploads via `image` (and optional `mask`).
- /// - `application/json`: use `images` (and optional `mask`) as references with either `image_url` or `file_id`.
- /// Note that JSON requests use `images` (array) instead of the multipart `image` field. - ///
- /// - /// The image(s) to edit. Must be a supported image file or an array of images.
- /// For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`
- /// file less than 50MB. You can provide up to 16 images.
- /// `chatgpt-image-latest` follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square
- /// `png` file less than 4MB. - /// - /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
- /// Example: A cute baby sea otter wearing a beret - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// Allows to set transparency for the background of the generated image(s).
- /// This parameter is only supported for the GPT image models. Must be one of
- /// `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
- /// model will automatically determine the best background for the image.
- /// If `transparent`, the output format needs to support transparency, so it
- /// should be set to either `png` (default value) or `webp`.
- /// Default Value: auto
- /// Example: transparent - /// - /// - /// The model to use for image generation. Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
- /// Example: gpt-image-1.5 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url - /// - /// - /// The format in which the generated images are returned. This parameter is
- /// only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
- /// The default value is `png`.
- /// Default Value: png
- /// Example: png - /// - /// - /// The compression level (0-100%) for the generated images. This parameter
- /// is only supported for the GPT image models with the `webp` or `jpeg` output
- /// formats, and defaults to 100.
- /// Default Value: 100
- /// Example: 100 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
- /// Example: user-1234 - /// - /// - /// - /// - /// The quality of the image that will be generated for GPT image models. Defaults to `auto`.
- /// Default Value: auto
- /// Example: high - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> CreateImageEditAsResponseAsync( - global::tryAGI.OpenAI.AnyOf> image, - string prompt, - global::System.IO.Stream? mask = default, - string? maskname = default, - global::tryAGI.OpenAI.CreateImageEditRequestBackground? background = default, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.AnyOf? size = default, - global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat? outputFormat = default, - int? outputCompression = default, - string? user = default, - global::tryAGI.OpenAI.InputFidelity? inputFidelity = default, - int? partialImages = default, - global::tryAGI.OpenAI.CreateImageEditRequestQuality? quality = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - var request = new global::tryAGI.OpenAI.CreateImageEditRequest - { - Image = image, - Prompt = prompt, - Mask = global::System.Array.Empty(), - Maskname = maskname, - Background = background, - Model = model, - N = n, - Size = size, - ResponseFormat = responseFormat, - OutputFormat = outputFormat, - OutputCompression = outputCompression, - User = user, - InputFidelity = inputFidelity, - Stream = false, - PartialImages = partialImages, - Quality = quality, - }; - PrepareArguments( - client: HttpClient); - PrepareCreateImageEditArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::tryAGI.OpenAI.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_CreateImageEditSecurityRequirements, - operationName: "CreateImageEditAsync"); - - using var __timeoutCancellationTokenSource = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::tryAGI.OpenAI.PathBuilder( - path: "/images/edits", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Image.ToString() ?? string.Empty), - name: "\"image\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (mask != default) - { - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.Background != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Background).HasValue ? (request.Background).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"background\""); - - } - if (request.Model != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToString() ?? string.Empty), - name: "\"model\""); - - } - if (request.N != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.N, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"n\""); - - } - if (request.Size != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Size.ToString() ?? string.Empty), - name: "\"size\""); - - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResponseFormat).HasValue ? (request.ResponseFormat).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"response_format\""); - - } - if (request.OutputFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.OutputFormat).HasValue ? (request.OutputFormat).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"output_format\""); - - } - if (request.OutputCompression != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.OutputCompression, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"output_compression\""); - - } - if (request.User != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.User ?? string.Empty), - name: "\"user\""); - - } - if (request.InputFidelity != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.InputFidelity.ToString() ?? string.Empty), - name: "\"input_fidelity\""); - - } - if (request.Stream != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Stream, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"stream\""); - - } - if (request.PartialImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.PartialImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"partial_images\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateImageEditRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEdit", - methodName: "CreateImageEditAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEdit", - methodName: "CreateImageEditAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEdit", - methodName: "CreateImageEditAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateImageEditResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEdit", - methodName: "CreateImageEditAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEdit", - methodName: "CreateImageEditAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateImageEditResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::tryAGI.OpenAI.ImagesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::tryAGI.OpenAI.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::tryAGI.OpenAI.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw new global::tryAGI.OpenAI.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::tryAGI.OpenAI.ImagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::tryAGI.OpenAI.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::tryAGI.OpenAI.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::tryAGI.OpenAI.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } } } \ No newline at end of file diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEditAsStream.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEditAsStream.g.cs index fa7d96cba..1e71c7b8d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEditAsStream.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ImagesClient.CreateImageEditAsStream.g.cs @@ -677,599 +677,5 @@ request.Maskname is null yield return __response; } } - - /// - /// Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`.
- /// You can call this endpoint with either:
- /// - `multipart/form-data`: use binary uploads via `image` (and optional `mask`).
- /// - `application/json`: use `images` (and optional `mask`) as references with either `image_url` or `file_id`.
- /// Note that JSON requests use `images` (array) instead of the multipart `image` field. - ///
- /// - /// The image(s) to edit. Must be a supported image file or an array of images.
- /// For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`
- /// file less than 50MB. You can provide up to 16 images.
- /// `chatgpt-image-latest` follows the same input constraints as GPT image models.
- /// For `dall-e-2`, you can only provide one image, and it should be a square
- /// `png` file less than 4MB. - /// - /// - /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
- /// Example: A cute baby sea otter wearing a beret - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - /// - /// - /// Allows to set transparency for the background of the generated image(s).
- /// This parameter is only supported for the GPT image models. Must be one of
- /// `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
- /// model will automatically determine the best background for the image.
- /// If `transparent`, the output format needs to support transparency, so it
- /// should be set to either `png` (default value) or `webp`.
- /// Default Value: auto
- /// Example: transparent - /// - /// - /// The model to use for image generation. Defaults to `gpt-image-1.5`.
- /// Default Value: gpt-image-1.5
- /// Example: gpt-image-1.5 - /// - /// - /// The number of images to generate. Must be between 1 and 10.
- /// Default Value: 1
- /// Example: 1 - /// - /// - /// The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- /// Default Value: 1024x1024
- /// Example: 1024x1024 - /// - /// - /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
- /// Example: url - /// - /// - /// The format in which the generated images are returned. This parameter is
- /// only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
- /// The default value is `png`.
- /// Default Value: png
- /// Example: png - /// - /// - /// The compression level (0-100%) for the generated images. This parameter
- /// is only supported for the GPT image models with the `webp` or `jpeg` output
- /// formats, and defaults to 100.
- /// Default Value: 100
- /// Example: 100 - /// - /// - /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
- /// Example: user-1234 - /// - /// - /// - /// - /// The quality of the image that will be generated for GPT image models. Defaults to `auto`.
- /// Default Value: auto
- /// Example: high - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Collections.Generic.IAsyncEnumerable CreateImageEditAsStreamAsync( - global::tryAGI.OpenAI.AnyOf> image, - string prompt, - global::System.IO.Stream? mask = default, - string? maskname = default, - global::tryAGI.OpenAI.CreateImageEditRequestBackground? background = default, - global::tryAGI.OpenAI.AnyOf? model = default, - int? n = default, - global::tryAGI.OpenAI.AnyOf? size = default, - global::tryAGI.OpenAI.CreateImageEditRequestResponseFormat? responseFormat = default, - global::tryAGI.OpenAI.CreateImageEditRequestOutputFormat? outputFormat = default, - int? outputCompression = default, - string? user = default, - global::tryAGI.OpenAI.InputFidelity? inputFidelity = default, - int? partialImages = default, - global::tryAGI.OpenAI.CreateImageEditRequestQuality? quality = default, - global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default, - [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) - { - - var request = new global::tryAGI.OpenAI.CreateImageEditRequest - { - Image = image, - Prompt = prompt, - Mask = global::System.Array.Empty(), - Maskname = maskname, - Background = background, - Model = model, - N = n, - Size = size, - ResponseFormat = responseFormat, - OutputFormat = outputFormat, - OutputCompression = outputCompression, - User = user, - InputFidelity = inputFidelity, - Stream = true, - PartialImages = partialImages, - Quality = quality, - }; - PrepareArguments( - client: HttpClient); - PrepareCreateImageEditAsStreamArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::tryAGI.OpenAI.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_CreateImageEditAsStreamSecurityRequirements, - operationName: "CreateImageEditAsStreamAsync"); - - using var __timeoutCancellationTokenSource = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::tryAGI.OpenAI.PathBuilder( - path: "/images/edits", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Image.ToString() ?? string.Empty), - name: "\"image\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (mask != default) - { - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.Background != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Background).HasValue ? (request.Background).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"background\""); - - } - if (request.Model != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToString() ?? string.Empty), - name: "\"model\""); - - } - if (request.N != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.N, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"n\""); - - } - if (request.Size != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Size.ToString() ?? string.Empty), - name: "\"size\""); - - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResponseFormat).HasValue ? (request.ResponseFormat).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"response_format\""); - - } - if (request.OutputFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.OutputFormat).HasValue ? (request.OutputFormat).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"output_format\""); - - } - if (request.OutputCompression != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.OutputCompression, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"output_compression\""); - - } - if (request.User != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.User ?? string.Empty), - name: "\"user\""); - - } - if (request.InputFidelity != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.InputFidelity.ToString() ?? string.Empty), - name: "\"input_fidelity\""); - - } - if (request.Stream != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Stream, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"stream\""); - - } - if (request.PartialImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.PartialImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"partial_images\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateImageEditAsStreamRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEditAsStream", - methodName: "CreateImageEditAsStreamAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEditAsStream", - methodName: "CreateImageEditAsStreamAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEditAsStream", - methodName: "CreateImageEditAsStreamAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateImageEditAsStreamResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEditAsStream", - methodName: "CreateImageEditAsStreamAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::tryAGI.OpenAI.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateImageEditAsStream", - methodName: "CreateImageEditAsStreamAsync", - pathTemplate: "\"/images/edits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest!, - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - - try - { - __response.EnsureSuccessStatusCode(); - } - catch (global::System.Net.Http.HttpRequestException __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::tryAGI.OpenAI.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - using var __stream = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - await foreach (var __sseEvent in global::System.Net.ServerSentEvents.SseParser - .Create(__stream).EnumerateAsync(__effectiveCancellationToken)) - { - var __content = __sseEvent.Data; - if (__content == "[DONE]") - { - yield break; - } - - var __streamedResponse = global::tryAGI.OpenAI.ImageEditStreamEvent.FromJson(__content, JsonSerializerContext) ?? - throw new global::tryAGI.OpenAI.ApiException( - message: $"Response deserialization failed for \"{__content}\" ", - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - - yield return __streamedResponse; - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } } } \ No newline at end of file diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.CreateInvite.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.CreateInvite.g.cs index a3a4a0122..84eeb76c4 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.CreateInvite.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.CreateInvite.g.cs @@ -158,6 +158,8 @@ partial void ProcessCreateInviteResponseContent( httpRequestMessage: __httpRequest, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.DeleteInvite.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.DeleteInvite.g.cs index 5d486e38a..de7877c34 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.DeleteInvite.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.DeleteInvite.g.cs @@ -147,6 +147,8 @@ partial void ProcessDeleteInviteResponseContent( httpRequestMessage: __httpRequest, inviteId: inviteId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.ListInvites.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.ListInvites.g.cs index d1727d466..7f69c2d4c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.ListInvites.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.ListInvites.g.cs @@ -164,6 +164,8 @@ partial void ProcessListInvitesResponseContent( limit: limit, after: after); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.RetrieveInvite.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.RetrieveInvite.g.cs index 65fe988c0..6406ee97c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.RetrieveInvite.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.InvitesClient.RetrieveInvite.g.cs @@ -147,6 +147,8 @@ partial void ProcessRetrieveInviteResponseContent( httpRequestMessage: __httpRequest, inviteId: inviteId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.CreateAdminApiKey.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.CreateAdminApiKey.g.cs index 44f485546..f20f9489f 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.CreateAdminApiKey.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.CreateAdminApiKey.g.cs @@ -160,6 +160,8 @@ partial void ProcessCreateAdminApiKeyResponseContent( httpRequestMessage: __httpRequest, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.DeleteAdminApiKey.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.DeleteAdminApiKey.g.cs index fd35f59b0..25e2898b8 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.DeleteAdminApiKey.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.DeleteAdminApiKey.g.cs @@ -153,6 +153,8 @@ partial void ProcessDeleteAdminApiKeyResponseContent( httpRequestMessage: __httpRequest, keyId: keyId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.ListAllOrganizationAndProjectApiKeys.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.ListAllOrganizationAndProjectApiKeys.g.cs index baefaea2a..4a7163579 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.ListAllOrganizationAndProjectApiKeys.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.ListAllOrganizationAndProjectApiKeys.g.cs @@ -188,6 +188,8 @@ partial void ProcessListAllOrganizationAndProjectApiKeysResponseContent( order: order, limit: limit); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.RetrieveAdminApiKey.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.RetrieveAdminApiKey.g.cs index ce3aaba46..559fcdc7c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.RetrieveAdminApiKey.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.RetrieveAdminApiKey.g.cs @@ -153,6 +153,8 @@ partial void ProcessRetrieveAdminApiKeyResponseContent( httpRequestMessage: __httpRequest, keyId: keyId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OptionsSupport.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OptionsSupport.g.cs index cca75c142..f5971b2b2 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OptionsSupport.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OptionsSupport.g.cs @@ -150,6 +150,84 @@ public interface IAutoSDKAuthorizationProvider global::tryAGI.OpenAI.AutoSDKHookContext context); } + /// + /// Marker keys stamped onto outgoing + /// instances so consumer s — and any + /// other transport-layer code that runs after AutoSDK's send pipeline — can observe whether + /// the resolved Authorization is call-scoped and opt out of overwriting it with a + /// rotation-aware account-level credential. + /// + public static class AutoSDKHttpRequestOptions + { + /// + /// Key under which records the marker. Exposed + /// for handlers that target frameworks older than .NET 5 and need to read the value + /// through the legacy HttpRequestMessage.Properties bag. + /// + public const string AuthorizationOverrideKey = "AutoSDK.AuthorizationOverride"; + +#if NET5_0_OR_GREATER + /// + /// Strongly-typed for + /// the call-scoped Authorization marker on .NET 5+ targets. Consumers should prefer this + /// over the legacy HttpRequestMessage.Properties bag where available. + /// + public static readonly global::System.Net.Http.HttpRequestOptionsKey AuthorizationOverride = + new global::System.Net.Http.HttpRequestOptionsKey(AuthorizationOverrideKey); +#endif + + /// + /// Stamps the call-scoped Authorization marker on . AutoSDK's + /// built-in calls this whenever the + /// resolved auth came from a per-request override or a client-level + /// . Hand-written SDK extensions that set a + /// non-default Authorization header (e.g. a session-scoped bearer returned by an + /// upstream poll) should call this too so downstream rotation handlers know to skip the + /// overwrite. + /// + /// + public static void StampAuthorizationOverride( + global::System.Net.Http.HttpRequestMessage? request) + { + if (request is null) + { + return; + } + +#if NET5_0_OR_GREATER + request.Options.Set(AuthorizationOverride, true); +#else +#pragma warning disable CS0618 // HttpRequestMessage.Properties is obsolete in NET5+, but the only option below it. + request.Properties[AuthorizationOverrideKey] = true; +#pragma warning restore CS0618 +#endif + } + + /// + /// Returns true when previously marked the + /// request as carrying a call-scoped Authorization. + /// + /// + public static bool HasAuthorizationOverride( + global::System.Net.Http.HttpRequestMessage? request) + { + if (request is null) + { + return false; + } + +#if NET5_0_OR_GREATER + return request.Options.TryGetValue(AuthorizationOverride, out var value) && value; +#else +#pragma warning disable CS0618 + return request.Properties.TryGetValue(AuthorizationOverrideKey, out var raw) && + raw is bool flag && + flag; +#pragma warning restore CS0618 +#endif + } + } + /// /// Built-in that consults /// before every outgoing @@ -176,6 +254,7 @@ public sealed class AutoSDKAuthorizationProviderHook : global::tryAGI.OpenAI.Aut ApplyAuthorization(context.Request, perRequest[index]); } + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); return; } @@ -195,6 +274,8 @@ public sealed class AutoSDKAuthorizationProviderHook : global::tryAGI.OpenAI.Aut { ApplyAuthorization(context.Request, resolved[index]); } + + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); } private static void ApplyAuthorization( diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.AssignProjectRoleToGroup.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.AssignProjectRoleToGroup.g.cs index 96bc71925..041037ff0 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.AssignProjectRoleToGroup.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.AssignProjectRoleToGroup.g.cs @@ -176,6 +176,8 @@ partial void ProcessAssignProjectRoleToGroupResponseContent( groupId: groupId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.ListProjectGroupRoleAssignments.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.ListProjectGroupRoleAssignments.g.cs index 247ece0bf..70e2cd6f7 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.ListProjectGroupRoleAssignments.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.ListProjectGroupRoleAssignments.g.cs @@ -188,6 +188,8 @@ partial void ProcessListProjectGroupRoleAssignmentsResponseContent( after: after, order: order); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.UnassignProjectRoleFromGroup.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.UnassignProjectRoleFromGroup.g.cs index 33fd0e9e4..e04b57ddc 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.UnassignProjectRoleFromGroup.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupRoleAssignmentsClient.UnassignProjectRoleFromGroup.g.cs @@ -165,6 +165,8 @@ partial void ProcessUnassignProjectRoleFromGroupResponseContent( groupId: groupId!, roleId: roleId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.AddProjectGroup.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.AddProjectGroup.g.cs index 718b13813..73c6fc901 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.AddProjectGroup.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.AddProjectGroup.g.cs @@ -167,6 +167,8 @@ partial void ProcessAddProjectGroupResponseContent( projectId: projectId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.ListProjectGroups.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.ListProjectGroups.g.cs index 39f24672b..271a232c7 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.ListProjectGroups.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.ListProjectGroups.g.cs @@ -187,6 +187,8 @@ partial void ProcessListProjectGroupsResponseContent( after: after, order: order); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.RemoveProjectGroup.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.RemoveProjectGroup.g.cs index 241c2de12..517d88008 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.RemoveProjectGroup.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectGroupsClient.RemoveProjectGroup.g.cs @@ -156,6 +156,8 @@ partial void ProcessRemoveProjectGroupResponseContent( projectId: projectId!, groupId: groupId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.AssignProjectRoleToUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.AssignProjectRoleToUser.g.cs index e4b872648..37afca6ea 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.AssignProjectRoleToUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.AssignProjectRoleToUser.g.cs @@ -176,6 +176,8 @@ partial void ProcessAssignProjectRoleToUserResponseContent( userId: userId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.ListProjectUserRoleAssignments.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.ListProjectUserRoleAssignments.g.cs index 8a5876cf4..cfbea058c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.ListProjectUserRoleAssignments.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.ListProjectUserRoleAssignments.g.cs @@ -188,6 +188,8 @@ partial void ProcessListProjectUserRoleAssignmentsResponseContent( after: after, order: order); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.UnassignProjectRoleFromUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.UnassignProjectRoleFromUser.g.cs index 2972bade7..112f710c2 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.UnassignProjectRoleFromUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectUserRoleAssignmentsClient.UnassignProjectRoleFromUser.g.cs @@ -165,6 +165,8 @@ partial void ProcessUnassignProjectRoleFromUserResponseContent( userId: userId!, roleId: roleId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ArchiveProject.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ArchiveProject.g.cs index 77882ee99..68fbe2f4e 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ArchiveProject.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ArchiveProject.g.cs @@ -147,6 +147,8 @@ partial void ProcessArchiveProjectResponseContent( httpRequestMessage: __httpRequest, projectId: projectId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProject.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProject.g.cs index eaf7b07de..ade395f73 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProject.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProject.g.cs @@ -158,6 +158,8 @@ partial void ProcessCreateProjectResponseContent( httpRequestMessage: __httpRequest, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProjectServiceAccount.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProjectServiceAccount.g.cs index f8cbcda46..759162a63 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProjectServiceAccount.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProjectServiceAccount.g.cs @@ -167,6 +167,8 @@ partial void ProcessCreateProjectServiceAccountResponseContent( projectId: projectId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProjectUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProjectUser.g.cs index 0237d59eb..36e60d86f 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProjectUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.CreateProjectUser.g.cs @@ -167,6 +167,8 @@ partial void ProcessCreateProjectUserResponseContent( projectId: projectId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectApiKey.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectApiKey.g.cs index 98df70980..4bf83ed0f 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectApiKey.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectApiKey.g.cs @@ -160,6 +160,8 @@ partial void ProcessDeleteProjectApiKeyResponseContent( projectId: projectId!, apiKeyId: apiKeyId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectServiceAccount.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectServiceAccount.g.cs index e86b59c14..57cc75ee3 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectServiceAccount.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectServiceAccount.g.cs @@ -160,6 +160,8 @@ partial void ProcessDeleteProjectServiceAccountResponseContent( projectId: projectId!, serviceAccountId: serviceAccountId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectUser.g.cs index 334314a48..28c0a0963 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.DeleteProjectUser.g.cs @@ -160,6 +160,8 @@ partial void ProcessDeleteProjectUserResponseContent( projectId: projectId!, userId: userId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectApiKeys.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectApiKeys.g.cs index a9e7e5d1d..a77b9f08d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectApiKeys.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectApiKeys.g.cs @@ -173,6 +173,8 @@ partial void ProcessListProjectApiKeysResponseContent( limit: limit, after: after); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectRateLimits.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectRateLimits.g.cs index 38b957e89..70b41a0ce 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectRateLimits.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectRateLimits.g.cs @@ -183,6 +183,8 @@ partial void ProcessListProjectRateLimitsResponseContent( after: after, before: before); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectServiceAccounts.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectServiceAccounts.g.cs index 8fc00e81d..038115996 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectServiceAccounts.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectServiceAccounts.g.cs @@ -173,6 +173,8 @@ partial void ProcessListProjectServiceAccountsResponseContent( limit: limit, after: after); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectUsers.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectUsers.g.cs index e7719e76e..4c125dc06 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectUsers.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjectUsers.g.cs @@ -173,6 +173,8 @@ partial void ProcessListProjectUsersResponseContent( limit: limit, after: after); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjects.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjects.g.cs index ec686f562..50bde0bdc 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjects.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ListProjects.g.cs @@ -178,6 +178,8 @@ partial void ProcessListProjectsResponseContent( after: after, includeArchived: includeArchived); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProject.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProject.g.cs index b36b2f7fd..fcbfec789 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProject.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProject.g.cs @@ -167,6 +167,8 @@ partial void ProcessModifyProjectResponseContent( projectId: projectId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProjectRateLimit.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProjectRateLimit.g.cs index 5c6d58723..f97cd2fdf 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProjectRateLimit.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProjectRateLimit.g.cs @@ -176,6 +176,8 @@ partial void ProcessModifyProjectRateLimitResponseContent( rateLimitId: rateLimitId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProjectUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProjectUser.g.cs index d1623b207..40968daaa 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProjectUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.ModifyProjectUser.g.cs @@ -176,6 +176,8 @@ partial void ProcessModifyProjectUserResponseContent( userId: userId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProject.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProject.g.cs index 86bc4fafe..49ebe38be 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProject.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProject.g.cs @@ -147,6 +147,8 @@ partial void ProcessRetrieveProjectResponseContent( httpRequestMessage: __httpRequest, projectId: projectId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectApiKey.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectApiKey.g.cs index 31c0de3dc..540bb9a49 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectApiKey.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectApiKey.g.cs @@ -156,6 +156,8 @@ partial void ProcessRetrieveProjectApiKeyResponseContent( projectId: projectId!, apiKeyId: apiKeyId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectServiceAccount.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectServiceAccount.g.cs index 4cf995648..173382418 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectServiceAccount.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectServiceAccount.g.cs @@ -156,6 +156,8 @@ partial void ProcessRetrieveProjectServiceAccountResponseContent( projectId: projectId!, serviceAccountId: serviceAccountId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectUser.g.cs index 9ad097168..9934e88c0 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ProjectsClient.RetrieveProjectUser.g.cs @@ -156,6 +156,8 @@ partial void ProcessRetrieveProjectUserResponseContent( projectId: projectId!, userId: userId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OptionsSupport.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OptionsSupport.g.cs index 3a60892e3..5343229f9 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OptionsSupport.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OptionsSupport.g.cs @@ -150,6 +150,84 @@ public interface IAutoSDKAuthorizationProvider global::tryAGI.OpenAI.Realtime.AutoSDKHookContext context); } + /// + /// Marker keys stamped onto outgoing + /// instances so consumer s — and any + /// other transport-layer code that runs after AutoSDK's send pipeline — can observe whether + /// the resolved Authorization is call-scoped and opt out of overwriting it with a + /// rotation-aware account-level credential. + /// + public static class AutoSDKHttpRequestOptions + { + /// + /// Key under which records the marker. Exposed + /// for handlers that target frameworks older than .NET 5 and need to read the value + /// through the legacy HttpRequestMessage.Properties bag. + /// + public const string AuthorizationOverrideKey = "AutoSDK.AuthorizationOverride"; + +#if NET5_0_OR_GREATER + /// + /// Strongly-typed for + /// the call-scoped Authorization marker on .NET 5+ targets. Consumers should prefer this + /// over the legacy HttpRequestMessage.Properties bag where available. + /// + public static readonly global::System.Net.Http.HttpRequestOptionsKey AuthorizationOverride = + new global::System.Net.Http.HttpRequestOptionsKey(AuthorizationOverrideKey); +#endif + + /// + /// Stamps the call-scoped Authorization marker on . AutoSDK's + /// built-in calls this whenever the + /// resolved auth came from a per-request override or a client-level + /// . Hand-written SDK extensions that set a + /// non-default Authorization header (e.g. a session-scoped bearer returned by an + /// upstream poll) should call this too so downstream rotation handlers know to skip the + /// overwrite. + /// + /// + public static void StampAuthorizationOverride( + global::System.Net.Http.HttpRequestMessage? request) + { + if (request is null) + { + return; + } + +#if NET5_0_OR_GREATER + request.Options.Set(AuthorizationOverride, true); +#else +#pragma warning disable CS0618 // HttpRequestMessage.Properties is obsolete in NET5+, but the only option below it. + request.Properties[AuthorizationOverrideKey] = true; +#pragma warning restore CS0618 +#endif + } + + /// + /// Returns true when previously marked the + /// request as carrying a call-scoped Authorization. + /// + /// + public static bool HasAuthorizationOverride( + global::System.Net.Http.HttpRequestMessage? request) + { + if (request is null) + { + return false; + } + +#if NET5_0_OR_GREATER + return request.Options.TryGetValue(AuthorizationOverride, out var value) && value; +#else +#pragma warning disable CS0618 + return request.Properties.TryGetValue(AuthorizationOverrideKey, out var raw) && + raw is bool flag && + flag; +#pragma warning restore CS0618 +#endif + } + } + /// /// Built-in that consults /// before every outgoing @@ -176,6 +254,7 @@ public sealed class AutoSDKAuthorizationProviderHook : global::tryAGI.OpenAI.Rea ApplyAuthorization(context.Request, perRequest[index]); } + global::tryAGI.OpenAI.Realtime.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); return; } @@ -195,6 +274,8 @@ public sealed class AutoSDKAuthorizationProviderHook : global::tryAGI.OpenAI.Rea { ApplyAuthorization(context.Request, resolved[index]); } + + global::tryAGI.OpenAI.Realtime.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); } private static void ApplyAuthorization( diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.CreateOrganizationRole.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.CreateOrganizationRole.g.cs index 08173be7d..96b278bb0 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.CreateOrganizationRole.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.CreateOrganizationRole.g.cs @@ -158,6 +158,8 @@ partial void ProcessCreateOrganizationRoleResponseContent( httpRequestMessage: __httpRequest, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.CreateProjectRole.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.CreateProjectRole.g.cs index 2d8dd526c..750faf3e8 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.CreateProjectRole.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.CreateProjectRole.g.cs @@ -167,6 +167,8 @@ partial void ProcessCreateProjectRoleResponseContent( projectId: projectId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.DeleteOrganizationRole.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.DeleteOrganizationRole.g.cs index b18ed3363..2980fec56 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.DeleteOrganizationRole.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.DeleteOrganizationRole.g.cs @@ -147,6 +147,8 @@ partial void ProcessDeleteOrganizationRoleResponseContent( httpRequestMessage: __httpRequest, roleId: roleId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.DeleteProjectRole.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.DeleteProjectRole.g.cs index d34767cc3..91d34ec9e 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.DeleteProjectRole.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.DeleteProjectRole.g.cs @@ -156,6 +156,8 @@ partial void ProcessDeleteProjectRoleResponseContent( projectId: projectId!, roleId: roleId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.ListOrganizationRoles.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.ListOrganizationRoles.g.cs index 3c10ce26a..097132042 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.ListOrganizationRoles.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.ListOrganizationRoles.g.cs @@ -178,6 +178,8 @@ partial void ProcessListOrganizationRolesResponseContent( after: after, order: order); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.ListProjectRoles.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.ListProjectRoles.g.cs index 26d40fdc5..52f48a7c1 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.ListProjectRoles.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.ListProjectRoles.g.cs @@ -187,6 +187,8 @@ partial void ProcessListProjectRolesResponseContent( after: after, order: order); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.UpdateOrganizationRole.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.UpdateOrganizationRole.g.cs index e587d5088..a06b76cd9 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.UpdateOrganizationRole.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.UpdateOrganizationRole.g.cs @@ -167,6 +167,8 @@ partial void ProcessUpdateOrganizationRoleResponseContent( roleId: roleId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.UpdateProjectRole.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.UpdateProjectRole.g.cs index 9e453225b..0dd4a0abd 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.UpdateProjectRole.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.RolesClient.UpdateProjectRole.g.cs @@ -176,6 +176,8 @@ partial void ProcessUpdateProjectRoleResponseContent( roleId: roleId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.AudioSpeeches.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.AudioSpeeches.g.cs index 3b46196c7..f19e87ce7 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.AudioSpeeches.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.AudioSpeeches.g.cs @@ -244,6 +244,8 @@ partial void ProcessAudioSpeechesResponseContent( limit: limit, page: page); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.AudioTranscriptions.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.AudioTranscriptions.g.cs index b1299f5f5..8af846258 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.AudioTranscriptions.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.AudioTranscriptions.g.cs @@ -244,6 +244,8 @@ partial void ProcessAudioTranscriptionsResponseContent( limit: limit, page: page); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.CodeInterpreterSessions.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.CodeInterpreterSessions.g.cs index 35113180a..d6c6c4293 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.CodeInterpreterSessions.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.CodeInterpreterSessions.g.cs @@ -214,6 +214,8 @@ partial void ProcessCodeInterpreterSessionsResponseContent( limit: limit, page: page); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Completions.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Completions.g.cs index 46cba6e89..06f32ae47 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Completions.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Completions.g.cs @@ -254,6 +254,8 @@ partial void ProcessCompletionsResponseContent( limit: limit, page: page); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Costs.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Costs.g.cs index 8b249b3be..aeef3125e 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Costs.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Costs.g.cs @@ -228,6 +228,8 @@ partial void ProcessCostsResponseContent( limit: limit, page: page); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Embeddings.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Embeddings.g.cs index 5afe204f5..009ef0e98 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Embeddings.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Embeddings.g.cs @@ -244,6 +244,8 @@ partial void ProcessEmbeddingsResponseContent( limit: limit, page: page); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Images.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Images.g.cs index 4fb7576c6..6c661e199 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Images.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Images.g.cs @@ -264,6 +264,8 @@ partial void ProcessImagesResponseContent( limit: limit, page: page); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Moderations.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Moderations.g.cs index 18cf48473..6ce27ec04 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Moderations.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.Moderations.g.cs @@ -244,6 +244,8 @@ partial void ProcessModerationsResponseContent( limit: limit, page: page); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.VectorStores.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.VectorStores.g.cs index 50c7dc334..7487e75d5 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.VectorStores.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsageClient.VectorStores.g.cs @@ -214,6 +214,8 @@ partial void ProcessVectorStoresResponseContent( limit: limit, page: page); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.AssignOrganizationRoleToUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.AssignOrganizationRoleToUser.g.cs index 992700972..abfa80a4e 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.AssignOrganizationRoleToUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.AssignOrganizationRoleToUser.g.cs @@ -167,6 +167,8 @@ partial void ProcessAssignOrganizationRoleToUserResponseContent( userId: userId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.ListUserOrganizationRoleAssignments.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.ListUserOrganizationRoleAssignments.g.cs index 7c8ed07b7..11d05fe03 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.ListUserOrganizationRoleAssignments.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.ListUserOrganizationRoleAssignments.g.cs @@ -179,6 +179,8 @@ partial void ProcessListUserOrganizationRoleAssignmentsResponseContent( after: after, order: order); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.UnassignOrganizationRoleFromUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.UnassignOrganizationRoleFromUser.g.cs index 9b20671ad..7d599cc3e 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.UnassignOrganizationRoleFromUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UserOrganizationRoleAssignmentsClient.UnassignOrganizationRoleFromUser.g.cs @@ -156,6 +156,8 @@ partial void ProcessUnassignOrganizationRoleFromUserResponseContent( userId: userId!, roleId: roleId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.DeleteUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.DeleteUser.g.cs index b00b29f06..54be10431 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.DeleteUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.DeleteUser.g.cs @@ -147,6 +147,8 @@ partial void ProcessDeleteUserResponseContent( httpRequestMessage: __httpRequest, userId: userId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.ListUsers.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.ListUsers.g.cs index d9671c72d..35ab05daf 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.ListUsers.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.ListUsers.g.cs @@ -174,6 +174,8 @@ partial void ProcessListUsersResponseContent( after: after, emails: emails); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.ModifyUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.ModifyUser.g.cs index 4246fd43b..9584a7f0c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.ModifyUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.ModifyUser.g.cs @@ -167,6 +167,8 @@ partial void ProcessModifyUserResponseContent( userId: userId!, request: request); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; } diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.RetrieveUser.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.RetrieveUser.g.cs index 5aa4238a6..2778327e6 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.RetrieveUser.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.UsersClient.RetrieveUser.g.cs @@ -147,6 +147,8 @@ partial void ProcessRetrieveUserResponseContent( httpRequestMessage: __httpRequest, userId: userId!); + global::tryAGI.OpenAI.AutoSDKHttpRequestOptions.StampAuthorizationOverride(__httpRequest); + return __httpRequest; }