forked from Azure/azure-sdk-for-js
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 29967 in Azure/azure-rest-api-specs
Merge 295994a299352ed0eb14713688057648cd675ec1 into 35f4b35e7a4cb4fed48d0edd03266c8407e3246d
- Loading branch information
SDKAuto
committed
Jul 25, 2024
1 parent
fe18ae3
commit 4d589c9
Showing
26 changed files
with
8,324 additions
and
957 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ pr: | |
- feature/* | ||
- release/* | ||
- hotfix/* | ||
exclude: | ||
- feature/v4 | ||
paths: | ||
include: | ||
- sdk/openai/ | ||
|
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 |
---|---|---|
@@ -1,18 +1,31 @@ | ||
{ | ||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
"mainEntryPointFilePath": "dist/esm/index.d.ts", | ||
"docModel": { "enabled": true }, | ||
"apiReport": { "enabled": true, "reportFolder": "./review" }, | ||
"docModel": { | ||
"enabled": true | ||
}, | ||
"apiReport": { | ||
"enabled": true, | ||
"reportFolder": "./review" | ||
}, | ||
"dtsRollup": { | ||
"enabled": true, | ||
"untrimmedFilePath": "", | ||
"publicTrimmedFilePath": "./dist/openai.d.ts" | ||
}, | ||
"messages": { | ||
"tsdocMessageReporting": { "default": { "logLevel": "none" } }, | ||
"tsdocMessageReporting": { | ||
"default": { | ||
"logLevel": "none" | ||
} | ||
}, | ||
"extractorMessageReporting": { | ||
"ae-missing-release-tag": { "logLevel": "none" }, | ||
"ae-unresolved-link": { "logLevel": "none" } | ||
"ae-missing-release-tag": { | ||
"logLevel": "none" | ||
}, | ||
"ae-unresolved-link": { | ||
"logLevel": "none" | ||
} | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -141,4 +141,4 @@ | |
}, | ||
"type": "module", | ||
"module": "./dist/esm/index.js" | ||
} | ||
} |
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,19 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
export { | ||
createOpenAI, | ||
OpenAIClientOptionalParams, | ||
OpenAIContext, | ||
} from "./openAIContext.js"; | ||
export { | ||
getAudioTranscriptionAsPlainText, | ||
getAudioTranscriptionAsResponseObject, | ||
getAudioTranslationAsPlainText, | ||
getAudioTranslationAsResponseObject, | ||
getCompletions, | ||
getChatCompletions, | ||
getImageGenerations, | ||
generateSpeechFromText, | ||
getEmbeddings, | ||
} from "./operations.js"; |
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,29 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
import { TokenCredential, KeyCredential } from "@azure/core-auth"; | ||
import { ClientOptions } from "@azure-rest/core-client"; | ||
import { OpenAIContext } from "../rest/index.js"; | ||
import getClient from "../rest/index.js"; | ||
|
||
/** Optional parameters for the client. */ | ||
export interface OpenAIClientOptionalParams extends ClientOptions {} | ||
|
||
export { OpenAIContext } from "../rest/index.js"; | ||
|
||
export function createOpenAI( | ||
endpointParam: string, | ||
credential: KeyCredential | TokenCredential, | ||
options: OpenAIClientOptionalParams = {}, | ||
): OpenAIContext { | ||
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; | ||
const userAgentPrefix = prefixFromOptions | ||
? `${prefixFromOptions} azsdk-js-api` | ||
: "azsdk-js-api"; | ||
|
||
const clientContext = getClient(endpointParam, credential, { | ||
...options, | ||
userAgentOptions: { userAgentPrefix }, | ||
}); | ||
return clientContext; | ||
} |
Oops, something went wrong.