@ai-sdk/openai-compatible 3.0.0-beta.32 → 3.0.0-beta.34
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/CHANGELOG.md +21 -0
- package/dist/index.js +74 -56
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +73 -55
- package/dist/internal/index.js.map +1 -1
- package/package.json +6 -5
- package/src/chat/convert-openai-compatible-chat-usage.ts +1 -1
- package/src/chat/convert-to-openai-compatible-chat-messages.ts +92 -78
- package/src/chat/map-openai-compatible-finish-reason.ts +1 -1
- package/src/chat/openai-compatible-api-types.ts +1 -1
- package/src/chat/openai-compatible-chat-language-model.ts +8 -8
- package/src/chat/openai-compatible-metadata-extractor.ts +1 -1
- package/src/chat/openai-compatible-prepare-tools.ts +2 -3
- package/src/completion/convert-openai-compatible-completion-usage.ts +1 -1
- package/src/completion/convert-to-openai-compatible-completion-prompt.ts +1 -2
- package/src/completion/map-openai-compatible-finish-reason.ts +1 -1
- package/src/completion/openai-compatible-completion-language-model.ts +6 -7
- package/src/embedding/openai-compatible-embedding-model.ts +5 -5
- package/src/image/openai-compatible-image-model.ts +4 -4
- package/src/openai-compatible-error.ts +1 -2
- package/src/openai-compatible-provider.ts +4 -4
- package/src/utils/to-camel-case.ts +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
|
-
EmbeddingModelV4,
|
|
3
|
-
SharedV4Warning,
|
|
4
2
|
TooManyEmbeddingValuesForCallError,
|
|
3
|
+
type EmbeddingModelV4,
|
|
4
|
+
type SharedV4Warning,
|
|
5
5
|
} from '@ai-sdk/provider';
|
|
6
6
|
import {
|
|
7
7
|
combineHeaders,
|
|
8
8
|
createJsonErrorResponseHandler,
|
|
9
9
|
createJsonResponseHandler,
|
|
10
|
-
FetchFunction,
|
|
11
10
|
parseProviderOptions,
|
|
12
11
|
postJsonToApi,
|
|
13
12
|
serializeModelOptions,
|
|
14
13
|
WORKFLOW_SERIALIZE,
|
|
15
14
|
WORKFLOW_DESERIALIZE,
|
|
15
|
+
type FetchFunction,
|
|
16
16
|
} from '@ai-sdk/provider-utils';
|
|
17
17
|
import { z } from 'zod/v4';
|
|
18
18
|
import {
|
|
19
|
-
OpenAICompatibleEmbeddingModelId,
|
|
20
19
|
openaiCompatibleEmbeddingModelOptions,
|
|
20
|
+
type OpenAICompatibleEmbeddingModelId,
|
|
21
21
|
} from './openai-compatible-embedding-options';
|
|
22
22
|
import {
|
|
23
23
|
defaultOpenAICompatibleErrorStructure,
|
|
24
|
-
ProviderErrorStructure,
|
|
24
|
+
type ProviderErrorStructure,
|
|
25
25
|
} from '../openai-compatible-error';
|
|
26
26
|
import { warnIfDeprecatedProviderOptionsKey } from '../utils/to-camel-case';
|
|
27
27
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
ImageModelV4,
|
|
3
3
|
ImageModelV4File,
|
|
4
4
|
SharedV4ProviderOptions,
|
|
@@ -15,19 +15,19 @@ import {
|
|
|
15
15
|
createJsonErrorResponseHandler,
|
|
16
16
|
createJsonResponseHandler,
|
|
17
17
|
downloadBlob,
|
|
18
|
-
FetchFunction,
|
|
19
18
|
postFormDataToApi,
|
|
20
19
|
postJsonToApi,
|
|
21
20
|
serializeModelOptions,
|
|
22
21
|
WORKFLOW_SERIALIZE,
|
|
23
22
|
WORKFLOW_DESERIALIZE,
|
|
23
|
+
type FetchFunction,
|
|
24
24
|
} from '@ai-sdk/provider-utils';
|
|
25
25
|
import { z } from 'zod/v4';
|
|
26
26
|
import {
|
|
27
27
|
defaultOpenAICompatibleErrorStructure,
|
|
28
|
-
ProviderErrorStructure,
|
|
28
|
+
type ProviderErrorStructure,
|
|
29
29
|
} from '../openai-compatible-error';
|
|
30
|
-
import { OpenAICompatibleImageModelId } from './openai-compatible-image-settings';
|
|
30
|
+
import type { OpenAICompatibleImageModelId } from './openai-compatible-image-settings';
|
|
31
31
|
|
|
32
32
|
export type OpenAICompatibleImageModelConfig = {
|
|
33
33
|
provider: string;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
EmbeddingModelV4,
|
|
3
3
|
ImageModelV4,
|
|
4
4
|
LanguageModelV4,
|
|
5
5
|
ProviderV4,
|
|
6
6
|
} from '@ai-sdk/provider';
|
|
7
7
|
import {
|
|
8
|
-
FetchFunction,
|
|
9
8
|
withoutTrailingSlash,
|
|
10
9
|
withUserAgentSuffix,
|
|
10
|
+
type FetchFunction,
|
|
11
11
|
} from '@ai-sdk/provider-utils';
|
|
12
12
|
import {
|
|
13
|
-
OpenAICompatibleChatConfig,
|
|
14
13
|
OpenAICompatibleChatLanguageModel,
|
|
14
|
+
type OpenAICompatibleChatConfig,
|
|
15
15
|
} from './chat/openai-compatible-chat-language-model';
|
|
16
|
-
import { MetadataExtractor } from './chat/openai-compatible-metadata-extractor';
|
|
16
|
+
import type { MetadataExtractor } from './chat/openai-compatible-metadata-extractor';
|
|
17
17
|
import { OpenAICompatibleCompletionLanguageModel } from './completion/openai-compatible-completion-language-model';
|
|
18
18
|
import { OpenAICompatibleEmbeddingModel } from './embedding/openai-compatible-embedding-model';
|
|
19
19
|
import { OpenAICompatibleImageModel } from './image/openai-compatible-image-model';
|