@core-ai/azure-openai 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -2
- package/dist/index.js +10 -8
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import OpenAI from 'openai';
|
|
2
2
|
import { ChatModel } from '@core-ai/core-ai';
|
|
3
|
-
import { OpenAIChatClient } from '@core-ai/openai';
|
|
3
|
+
import { OpenAIChatClient, OpenAIResponsesGenerateProviderOptions, OpenAIChatGenerateProviderOptions } from '@core-ai/openai';
|
|
4
4
|
|
|
5
5
|
type AzureOpenAIV1Options = {
|
|
6
6
|
api?: 'v1';
|
|
@@ -26,4 +26,14 @@ type AzureOpenAIProvider = {
|
|
|
26
26
|
};
|
|
27
27
|
declare function createAzureOpenAI(options?: AzureOpenAIProviderOptions): AzureOpenAIProvider;
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
/** Options for `chatModel()` on the v1 API (Responses). */
|
|
30
|
+
type AzureOpenAIResponsesGenerateProviderOptions = OpenAIResponsesGenerateProviderOptions;
|
|
31
|
+
/** Options for `chat.chatModel()` and the classic API (Chat Completions). */
|
|
32
|
+
type AzureOpenAIChatGenerateProviderOptions = OpenAIChatGenerateProviderOptions;
|
|
33
|
+
declare module '@core-ai/core-ai' {
|
|
34
|
+
interface GenerateProviderOptions {
|
|
35
|
+
'azure-openai'?: AzureOpenAIResponsesGenerateProviderOptions | AzureOpenAIChatGenerateProviderOptions;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { type AzureOpenAIChatGenerateProviderOptions, type AzureOpenAIProvider, type AzureOpenAIProviderOptions, type AzureOpenAIResponsesGenerateProviderOptions, createAzureOpenAI };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,8 @@ import OpenAI, { AzureOpenAI } from "openai";
|
|
|
3
3
|
import {
|
|
4
4
|
createOpenAIChatCompletionsModel,
|
|
5
5
|
createOpenAIProvider,
|
|
6
|
-
getOpenAIModelCapabilities
|
|
6
|
+
getOpenAIModelCapabilities,
|
|
7
|
+
openaiChatGenerateProviderOptionsSchema
|
|
7
8
|
} from "@core-ai/openai";
|
|
8
9
|
var PROVIDER_ID = "azure-openai";
|
|
9
10
|
function createAzureOpenAI(options = {}) {
|
|
@@ -18,7 +19,11 @@ function createAzureOpenAI(options = {}) {
|
|
|
18
19
|
const chat = {
|
|
19
20
|
chatModel: (modelId) => createOpenAIChatCompletionsModel(client2, modelId, {
|
|
20
21
|
capabilities: getOpenAIModelCapabilities(modelId),
|
|
21
|
-
providerId: PROVIDER_ID
|
|
22
|
+
providerId: PROVIDER_ID,
|
|
23
|
+
providerOptions: {
|
|
24
|
+
key: PROVIDER_ID,
|
|
25
|
+
schema: openaiChatGenerateProviderOptionsSchema
|
|
26
|
+
}
|
|
22
27
|
})
|
|
23
28
|
};
|
|
24
29
|
return {
|
|
@@ -33,12 +38,9 @@ function createAzureOpenAI(options = {}) {
|
|
|
33
38
|
const provider = createOpenAIProvider(
|
|
34
39
|
{ client },
|
|
35
40
|
{
|
|
36
|
-
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
// by `providerId` (`azure-openai`) so encrypted content is not replayed
|
|
40
|
-
// to first-party OpenAI.
|
|
41
|
-
providerOptionsKey: "openai"
|
|
41
|
+
// Namespaces `providerOptions` and reasoning `providerMetadata`, so
|
|
42
|
+
// encrypted content is not replayed to first-party OpenAI.
|
|
43
|
+
providerId: PROVIDER_ID
|
|
42
44
|
}
|
|
43
45
|
);
|
|
44
46
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@core-ai/azure-openai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Azure OpenAI provider package for @core-ai/core-ai",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Omnifact (https://omnifact.ai)",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"test:watch": "vitest"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@core-ai/core-ai": "^0.
|
|
50
|
-
"@core-ai/openai": "^0.
|
|
49
|
+
"@core-ai/core-ai": "^0.27.0",
|
|
50
|
+
"@core-ai/openai": "^0.27.0",
|
|
51
51
|
"openai": "^6.46.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|