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
/// 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"
/// Version of the Rest Api. Needed for e.g. for the Azure OpenAI service.
22
+
/// Version of the Rest Api
20
23
/// </summary>
21
-
publicstringApiVersion{get;set;}
24
+
publicstringApiVersion{get;set;}="v1";
22
25
23
26
/// <summary>
24
27
/// The API authentication information to use for API calls
@@ -38,6 +41,21 @@ public OpenAIAPI(APIAuthentication apiKeys = null)
38
41
Embeddings=newEmbeddingEndpoint(this);
39
42
}
40
43
44
+
/// <summary>
45
+
/// Instantiates a version of the API for connecting to the Azure OpenAI endpoint instead of the main OpenAI endpoint.
46
+
/// </summary>
47
+
/// <param name="YourResourceName">The name of your Azure OpenAI Resource</param>
48
+
/// <param name="deploymentId">The name of your model deployment. You're required to first deploy a model before you can make calls.</param>
49
+
/// <param name="apiKey">The API authentication information to use for API calls, or <see langword="null"/> to attempt to use the <see cref="APIAuthentication.Default"/>, potentially loading from environment vars or from a config file. Currently this library only supports the api-key flow, not the AD-Flow.</param>
/// Text generation is the core function of the API. You give the API a prompt, and it generates a completion. The way you “program” the API to do a task is by simply describing the task in plain english or providing a few written examples. This simple approach works for a wide range of use cases, including summarization, translation, grammar correction, question answering, chatbots, composing emails, and much more (see the prompt library for inspiration).
Copy file name to clipboardexpand all lines: README.md
+7-15
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,9 @@ Console.WriteLine(result);
27
27
## Status
28
28
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.
29
29
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 existing code.
30
+
Now also should work with the Azure OpenAI Service, although this is untested. See [Azure](#azure) section for further details.
30
31
31
-
Now also works with the Azure OpenAI Service. See [Azure](#azure) section for further details.
32
-
33
-
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!
32
+
Thank you [@GotMike](https://github.com/gotmike), [@ncface](https://github.com/ncface), [@KeithHenry](https://github.com/KeithHenry), [@gmilano](https://github.com/gmilano), [@metjuperry](https://github.com/metjuperry), and [@Alexei000](https://github.com/Alexei000) for your contributions!
34
33
35
34
## Requirements
36
35
@@ -158,26 +157,19 @@ The fine-tuning endpoint itself has not yet been implemented, but will be added
158
157
159
158
### Azure
160
159
161
-
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`.
160
+
For using the Azure OpenAI Service, you need to specify the name of your Azure OpenAI resource as well as your model deployment id. Additionally you may specify the Api version which defaults to`2022-12-01`.
162
161
163
-
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)
162
+
_I do not have access to the Microsoft Azure OpenAI service, so I am unable to test this functionality. If you have access and can test, please submit an issue describing your results. A PR with integration tests would also be greatly appreciated. Specifically, it is unclear to me that specifying models works the same way with Azure._
164
163
165
-
Additionally you need to specify the BaseUrl to your API. The Url should look something like:
You may then use the `api` object like normal. You may also specify the `APIAuthentication` is any of the other ways listed in the [Authentication](#authentication) section above. Currently this library only supports the api-key flow, not the AD-Flow.
0 commit comments