-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add generated full client for OpenAI and Azure API
- Loading branch information
Showing
340 changed files
with
22,665 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/internal/OpenAI.GeneratedKiotaClient/GeneratedClientsFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Microsoft.Kiota.Abstractions.Authentication; | ||
using Microsoft.Kiota.Http.HttpClientLibrary; | ||
using OpenAI.Azure.GeneratedKiotaClient; | ||
|
||
namespace OpenAI.GeneratedKiotaClient; | ||
|
||
internal static class GeneratedClientsFactory | ||
{ | ||
public static GeneratedOpenAiClient CreateGeneratedOpenAiClient(HttpClient httpClient) | ||
{ | ||
ArgumentNullException.ThrowIfNull(httpClient); | ||
var authProvider = new AnonymousAuthenticationProvider(); | ||
var adapter = new HttpClientRequestAdapter(authProvider, httpClient: httpClient); | ||
return new GeneratedOpenAiClient(adapter); | ||
} | ||
|
||
public static GeneratedAzureOpenAiClient CreateGeneratedAzureOpenAiClient(HttpClient httpClient) | ||
{ | ||
ArgumentNullException.ThrowIfNull(httpClient); | ||
var authProvider = new AnonymousAuthenticationProvider(); | ||
var adapter = new HttpClientRequestAdapter(authProvider, httpClient: httpClient); | ||
return new GeneratedAzureOpenAiClient(adapter); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/internal/OpenAI.GeneratedKiotaClient/OpenAI.GeneratedKiotaClient.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> | ||
<NoWarn>$(NoWarn);CS0618</NoWarn> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.7.2" /> | ||
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.3.2" /> | ||
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.1.2" /> | ||
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.1.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<InternalsVisibleTo Include="OpenAI.ChatGpt" /> | ||
</ItemGroup> | ||
|
||
</Project> |
37 changes: 37 additions & 0 deletions
37
...enAI.GeneratedKiotaClient/generated/azure_openai/Deployments/DeploymentsRequestBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// <auto-generated/> | ||
using Microsoft.Kiota.Abstractions; | ||
using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System; | ||
namespace OpenAI.Azure.GeneratedKiotaClient.Deployments { | ||
/// <summary> | ||
/// Builds and executes requests for operations under \deployments | ||
/// </summary> | ||
internal class DeploymentsRequestBuilder : BaseRequestBuilder { | ||
/// <summary>Gets an item from the OpenAI.Azure.GeneratedKiotaClient.deployments.item collection</summary> | ||
/// <param name="position">Unique identifier of the item</param> | ||
public DeploymentItemRequestBuilder this[string position] { get { | ||
var urlTplParams = new Dictionary<string, object>(PathParameters); | ||
urlTplParams.Add("deployment%2Did", position); | ||
return new DeploymentItemRequestBuilder(urlTplParams, RequestAdapter); | ||
} } | ||
/// <summary> | ||
/// Instantiates a new DeploymentsRequestBuilder and sets the default values. | ||
/// </summary> | ||
/// <param name="pathParameters">Path parameters for the request</param> | ||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param> | ||
public DeploymentsRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments", pathParameters) { | ||
} | ||
/// <summary> | ||
/// Instantiates a new DeploymentsRequestBuilder and sets the default values. | ||
/// </summary> | ||
/// <param name="rawUrl">The raw URL to use for the request builder.</param> | ||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param> | ||
public DeploymentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments", rawUrl) { | ||
} | ||
} | ||
} | ||
|
39 changes: 39 additions & 0 deletions
39
...GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/AudioRequestBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// <auto-generated/> | ||
using Microsoft.Kiota.Abstractions; | ||
using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Audio.Transcriptions; | ||
using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Audio.Translations; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System; | ||
namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Audio { | ||
/// <summary> | ||
/// Builds and executes requests for operations under \deployments\{deployment-id}\audio | ||
/// </summary> | ||
internal class AudioRequestBuilder : BaseRequestBuilder { | ||
/// <summary>The transcriptions property</summary> | ||
public TranscriptionsRequestBuilder Transcriptions { get => | ||
new TranscriptionsRequestBuilder(PathParameters, RequestAdapter); | ||
} | ||
/// <summary>The translations property</summary> | ||
public TranslationsRequestBuilder Translations { get => | ||
new TranslationsRequestBuilder(PathParameters, RequestAdapter); | ||
} | ||
/// <summary> | ||
/// Instantiates a new AudioRequestBuilder and sets the default values. | ||
/// </summary> | ||
/// <param name="pathParameters">Path parameters for the request</param> | ||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param> | ||
public AudioRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/audio", pathParameters) { | ||
} | ||
/// <summary> | ||
/// Instantiates a new AudioRequestBuilder and sets the default values. | ||
/// </summary> | ||
/// <param name="rawUrl">The raw URL to use for the request builder.</param> | ||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param> | ||
public AudioRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/audio", rawUrl) { | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.