azure-openai
Advanced tools
Comparing version
@@ -124,4 +124,4 @@ /* tslint:disable */ | ||
if (this.azure) { | ||
if (!this.azure.apiKey || !this.azure.endpoint || !this.azure.deploymentName) { | ||
throw new Error("Azure Configuration requires apiKey, endpoint and deploymentName"); | ||
if (!this.azure.apiKey || !this.azure.endpoint) { | ||
throw new Error("Azure Configuration requires apiKey, endpoint"); | ||
} | ||
@@ -128,0 +128,0 @@ this.apiKey = this.azure.apiKey; |
@@ -40,4 +40,4 @@ "use strict"; | ||
if (this.azure) { | ||
if (!this.azure.apiKey || !this.azure.endpoint || !this.azure.deploymentName) { | ||
throw new Error("Azure Configuration requires apiKey, endpoint and deploymentName"); | ||
if (!this.azure.apiKey || !this.azure.endpoint) { | ||
throw new Error("Azure Configuration requires apiKey, endpoint"); | ||
} | ||
@@ -44,0 +44,0 @@ this.apiKey = this.azure.apiKey; |
{ | ||
"name": "azure-openai", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"description": "Node.js library for the Azure OpenAI API", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -41,2 +41,3 @@ # Azure OpenAI Node.js Library | ||
endpoint: {your-azure-openai-resource-endpoint}, | ||
// deploymentName is optional, if you donot set it, you need to set it in the request parameter | ||
deploymentName: {your-azure-openai-resource-deployment-name}, | ||
@@ -57,2 +58,16 @@ } | ||
6. optional, you can also set your Azure deploymentName by replacing your model with deployment name, like this: | ||
``` | ||
const response = await this.openAiApi.createCompletion({ | ||
model: {your-azure-openai-resource-deployment-name}, | ||
prompt: prompt, | ||
maxTokens: 100, | ||
temperature: 0.9, | ||
topP: 1, | ||
presencePenalty: 0, | ||
frequencyPenalty: 0, | ||
bestOf: 1, | ||
}); | ||
``` | ||
## Support | ||
@@ -59,0 +74,0 @@ support latest version of OpenAI API, v3.2.0. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
493865
0.26%9830
0.08%84
21.74%