From 23b2dcf4f592ee80a80a702b63b0b7521a30f0cc Mon Sep 17 00:00:00 2001 From: Tolga Kayhan Date: Tue, 24 Sep 2024 16:26:29 +0100 Subject: [PATCH] Azure DataPlane Endpoints are updated --- .../AzureOpenAiEndpointProvider.cs | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/OpenAI.SDK/EndpointProviders/AzureOpenAiEndpointProvider.cs b/OpenAI.SDK/EndpointProviders/AzureOpenAiEndpointProvider.cs index c7bbaccd..ef3b0100 100644 --- a/OpenAI.SDK/EndpointProviders/AzureOpenAiEndpointProvider.cs +++ b/OpenAI.SDK/EndpointProviders/AzureOpenAiEndpointProvider.cs @@ -20,15 +20,16 @@ public AzureOpenAiEndpointProvider(string apiVersion, string deploymentId) private string Prefix => $"{ApiPrefix}/{DeploymentsPrefix}/{WebUtility.UrlEncode(_deploymentId)}"; private string AzureVersionQueryString => $"?api-version={_apiVersion}"; private string AssistantPrefix => $"{ApiPrefix}/"; + private string DataPlanePrefix => $"{ApiPrefix}/"; public string ModelRetrieve(string model) { - return $"{Prefix}/models/{model}{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/models/{model}{AzureVersionQueryString}"; } public string FileDelete(string fileId) { - return $"{Prefix}/files/{fileId}{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/files/{fileId}{AzureVersionQueryString}"; } public string CompletionCreate() @@ -43,7 +44,7 @@ public string EditCreate() public string ModelsList() { - return $"{Prefix}/models{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/models{AzureVersionQueryString}"; } public string FilesList() @@ -58,12 +59,12 @@ public string FilesUpload() public string FileRetrieve(string fileId) { - return $"{Prefix}/files/{fileId}{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/files/{fileId}{AzureVersionQueryString}"; } public string FileRetrieveContent(string fileId) { - return $"{Prefix}/files/{fileId}/content{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/files/{fileId}/content{AzureVersionQueryString}"; } public string FineTuneCreate() @@ -93,17 +94,17 @@ public string FineTuneListEvents(string fineTuneId) public string FineTuneDelete(string fineTuneId) { - return $"{Prefix}/models/{fineTuneId}{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/fine_tuning/jobs/{fineTuneId}{AzureVersionQueryString}"; } public string FineTuningJobCreate() { - return $"{Prefix}/fine_tuning/jobs{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/fine_tuning/jobs{AzureVersionQueryString}"; } public string FineTuningJobList(FineTuningJobListRequest? fineTuningJobListRequest) { - var url = $"{Prefix}/fine_tuning/jobs"; + var url = $"{DataPlanePrefix}/fine_tuning/jobs"; if (fineTuningJobListRequest != null) { var queryParams = new List(); @@ -121,22 +122,22 @@ public string FineTuningJobList(FineTuningJobListRequest? fineTuningJobListReque public string FineTuningJobRetrieve(string fineTuningJobId) { - return $"{Prefix}/fine_tuning/jobs/{fineTuningJobId}{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/fine_tuning/jobs/{fineTuningJobId}{AzureVersionQueryString}"; } public string FineTuningJobCancel(string fineTuningJobId) { - return $"{Prefix}/fine_tuning/jobs/{fineTuningJobId}/cancel{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/fine_tuning/jobs/{fineTuningJobId}/cancel{AzureVersionQueryString}"; } public string FineTuningJobListEvents(string fineTuningJobId) { - return $"{Prefix}/fine_tuning/jobs/{fineTuningJobId}/events{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/fine_tuning/jobs/{fineTuningJobId}/events{AzureVersionQueryString}"; } public string ModelsDelete(string modelId) { - return $"{Prefix}/models/{modelId}{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/models/{modelId}{AzureVersionQueryString}"; } public string EmbeddingCreate() @@ -451,26 +452,26 @@ public string VectorStoreFileBatchList(string vectorStoreId, string batchId, Pag public string BatchCreate() { - return $"{Prefix}/batches{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/batches{AzureVersionQueryString}"; } public string BatchRetrieve(string batchId) { - return $"{Prefix}/batches/{batchId}{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/batches/{batchId}{AzureVersionQueryString}"; } public string BatchCancel(string batchId) { - return $"{Prefix}/batches/{batchId}/cancel{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/batches/{batchId}/cancel{AzureVersionQueryString}"; } public string FineTuningJobList() { - return $"{Prefix}/fine_tuning/jobs{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/fine_tuning/jobs{AzureVersionQueryString}"; } private string Files() { - return $"{Prefix}/files{AzureVersionQueryString}"; + return $"{DataPlanePrefix}/files{AzureVersionQueryString}"; } } \ No newline at end of file