You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// <exception cref="AuthenticationException">Thrown if there is no valid authentication. Please refer to <see href="https://github.com/OkGoDoIt/OpenAI-API-dotnet#authentication"/> for details.</exception>
56
-
protectedHttpClientGetClient()
51
+
/// <summary>
52
+
/// Gets the version of the endpoint as url parameter, based on the configuration in the api definition. For example "https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#rest-api-versioning"
53
+
/// </summary>
54
+
protectedstringApiVersionParameter
55
+
{
56
+
get
57
+
{
58
+
if(string.IsNullOrEmpty(_Api.ApiVersion))
59
+
{
60
+
return"";
61
+
}
62
+
return$"api-version={_Api.ApiVersion}";
63
+
}
64
+
}
65
+
66
+
/// <summary>
67
+
/// Gets an HTTPClient with the appropriate authorization and other headers set
/// <exception cref="AuthenticationException">Thrown if there is no valid authentication. Please refer to <see href="https://github.com/OkGoDoIt/OpenAI-API-dotnet#authentication"/> for details.</exception>
Copy file name to clipboardExpand all lines: README.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ A simple C# .NET wrapper library to use with OpenAI's GPT-3 API. More context [
5
5
## Status
6
6
Updated to work with the current API as of February 2, 2023. Added Files and Embedding endpoints. Removed the Search endpoint as OpenAI has removed that API.
7
7
Potentially breaking change with v1.4: The various endpoints (Completions, Models, etc) and related classes have each moved into their own namespaces, for example `OpenAI_API.Completions.CompletionRequest` and `OpenAI_API.Models.Model.DavinciText`. You may need to add `using`s or fully qualify names in exisitng code.
8
+
Now also works with the Azure OpenAI Service. See Azure section for further details.
8
9
9
10
Thank you [@GotMike](https://github.com/gotmike), [@gmilano](https://github.com/gmilano), [@metjuperry](https://github.com/metjuperry), and [@Alexei000](https://github.com/Alexei000) for your contributions!
10
11
@@ -143,6 +144,30 @@ There are also methods to get file contents, delete a file, etc.
143
144
144
145
The fine-tuning endpoint itself has not yet been implemented, but will be added soon.
145
146
147
+
### Azure
148
+
149
+
For using the Azure OpenAI Service, you need to define the Api-Version of the OpenAIAPI class. Currently only the following version is suported by azure: `2022-12-01`.
150
+
151
+
Refer the Azure OpenAI documentation for further informations: [REST API versioning](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#rest-api-versioning)
152
+
153
+
Additionally you need to specify the BaseUrl to your API. The Url should look something like:
Everysingle class, method, and property has extensive XML documentation, so it should show up automatically in IntelliSense. That combined with the official OpenAI documentation should be enough to get started. Feel free to open an issue here if you have any questions. Better documentation may come later.
0 commit comments