@mastra/server 1.0.0-beta.10 → 1.0.0-beta.13
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 +58 -0
- package/README.md +2 -2
- package/dist/{chunk-PUSD37LD.cjs → chunk-3XI22UQR.cjs} +4 -3
- package/dist/chunk-3XI22UQR.cjs.map +1 -0
- package/dist/{chunk-7HX4V5Y6.cjs → chunk-4MNOLEZO.cjs} +22767 -18491
- package/dist/chunk-4MNOLEZO.cjs.map +1 -0
- package/dist/{chunk-WVAQXM6W.cjs → chunk-4TDHAYN7.cjs} +26 -18
- package/dist/chunk-4TDHAYN7.cjs.map +1 -0
- package/dist/{chunk-7N3PD4SV.js → chunk-6V57U52D.js} +3 -3
- package/dist/{chunk-7N3PD4SV.js.map → chunk-6V57U52D.js.map} +1 -1
- package/dist/{chunk-R56K77E2.cjs → chunk-7KOS32XA.cjs} +175 -57
- package/dist/chunk-7KOS32XA.cjs.map +1 -0
- package/dist/{chunk-C3D3X2L5.cjs → chunk-7O3KPUJ4.cjs} +5 -5
- package/dist/{chunk-C3D3X2L5.cjs.map → chunk-7O3KPUJ4.cjs.map} +1 -1
- package/dist/chunk-AZIH2QEC.js +83 -0
- package/dist/chunk-AZIH2QEC.js.map +1 -0
- package/dist/{chunk-LPM6BBAX.cjs → chunk-BMLUV4BH.cjs} +2 -53
- package/dist/chunk-BMLUV4BH.cjs.map +1 -0
- package/dist/{chunk-X4QMPCTP.cjs → chunk-BMYZ4DO6.cjs} +12 -2
- package/dist/chunk-BMYZ4DO6.cjs.map +1 -0
- package/dist/{chunk-DHWPHLGF.cjs → chunk-BNGT3NIC.cjs} +14 -14
- package/dist/{chunk-DHWPHLGF.cjs.map → chunk-BNGT3NIC.cjs.map} +1 -1
- package/dist/{chunk-ESZ6V5WB.cjs → chunk-C3UIIRAT.cjs} +8 -4
- package/dist/chunk-C3UIIRAT.cjs.map +1 -0
- package/dist/{chunk-YP34EWWK.js → chunk-DVSCJECS.js} +11 -14
- package/dist/chunk-DVSCJECS.js.map +1 -0
- package/dist/{chunk-4W2SM6CG.js → chunk-DW3WE4M4.js} +14 -58
- package/dist/chunk-DW3WE4M4.js.map +1 -0
- package/dist/{chunk-RQK4FQUD.js → chunk-E646Y4FQ.js} +3 -45
- package/dist/chunk-E646Y4FQ.js.map +1 -0
- package/dist/{chunk-AWBBXA36.js → chunk-EEORY4VR.js} +22072 -17796
- package/dist/chunk-EEORY4VR.js.map +1 -0
- package/dist/chunk-EUBTCHQC.js +83 -0
- package/dist/chunk-EUBTCHQC.js.map +1 -0
- package/dist/chunk-FWSKVWS7.cjs +88 -0
- package/dist/chunk-FWSKVWS7.cjs.map +1 -0
- package/dist/{chunk-2PLXW4ZX.cjs → chunk-K73YS7YB.cjs} +74 -74
- package/dist/{chunk-2PLXW4ZX.cjs.map → chunk-K73YS7YB.cjs.map} +1 -1
- package/dist/{chunk-CT5VG7NT.js → chunk-KEXR53KI.js} +3 -3
- package/dist/{chunk-CT5VG7NT.js.map → chunk-KEXR53KI.js.map} +1 -1
- package/dist/{chunk-WE4USCF3.js → chunk-KPSSRYGH.js} +11 -3
- package/dist/{chunk-X4QMPCTP.cjs.map → chunk-KPSSRYGH.js.map} +1 -1
- package/dist/{chunk-V272B7RM.cjs → chunk-LKTCAPBD.cjs} +15 -18
- package/dist/chunk-LKTCAPBD.cjs.map +1 -0
- package/dist/{chunk-US6Y5RLR.cjs → chunk-LQSZ4FJJ.cjs} +21 -21
- package/dist/{chunk-US6Y5RLR.cjs.map → chunk-LQSZ4FJJ.cjs.map} +1 -1
- package/dist/{chunk-UTIOKR5C.js → chunk-MQLS6Z7A.js} +8 -4
- package/dist/chunk-MQLS6Z7A.js.map +1 -0
- package/dist/{chunk-FPCGLPLJ.cjs → chunk-P3H4AZKI.cjs} +17 -62
- package/dist/chunk-P3H4AZKI.cjs.map +1 -0
- package/dist/chunk-Q7NPRJRV.cjs +88 -0
- package/dist/chunk-Q7NPRJRV.cjs.map +1 -0
- package/dist/{chunk-QNVYGEJ4.js → chunk-SRQY5IWD.js} +3 -3
- package/dist/{chunk-QNVYGEJ4.js.map → chunk-SRQY5IWD.js.map} +1 -1
- package/dist/{chunk-ZULZ2752.js → chunk-SV4AUWGY.js} +3 -3
- package/dist/{chunk-ZULZ2752.js.map → chunk-SV4AUWGY.js.map} +1 -1
- package/dist/{chunk-Q6SVIZLX.js → chunk-UWRAKVAJ.js} +124 -7
- package/dist/chunk-UWRAKVAJ.js.map +1 -0
- package/dist/{chunk-6YWE7UPT.js → chunk-WBLT2HL3.js} +4 -3
- package/dist/chunk-WBLT2HL3.js.map +1 -0
- package/dist/{chunk-DG3INBBQ.js → chunk-YD5BSLPJ.js} +18 -10
- package/dist/chunk-YD5BSLPJ.js.map +1 -0
- package/dist/dist-2J26LQO2.cjs +16 -0
- package/dist/{dist-P4MXBQ3U.cjs.map → dist-2J26LQO2.cjs.map} +1 -1
- package/dist/{dist-X7XR3M3Z.js → dist-4CMHRWC4.js} +3 -3
- package/dist/{dist-X7XR3M3Z.js.map → dist-4CMHRWC4.js.map} +1 -1
- package/dist/{dist-PQZUVLPC.js → dist-AEJONJSS.js} +3 -3
- package/dist/{dist-PQZUVLPC.js.map → dist-AEJONJSS.js.map} +1 -1
- package/dist/{dist-G2BYZJOC.cjs → dist-AF7EUPXA.cjs} +28 -28
- package/dist/{dist-G2BYZJOC.cjs.map → dist-AF7EUPXA.cjs.map} +1 -1
- package/dist/dist-MEN73GGI.js +3 -0
- package/dist/{dist-YREX2TJT.js.map → dist-MEN73GGI.js.map} +1 -1
- package/dist/{dist-FZYCV3VB.cjs → dist-NVXXJWBO.cjs} +26 -26
- package/dist/{dist-FZYCV3VB.cjs.map → dist-NVXXJWBO.cjs.map} +1 -1
- package/dist/{dist-RFMYFILX.cjs → dist-Q2ST4SUQ.cjs} +30 -30
- package/dist/{dist-RFMYFILX.cjs.map → dist-Q2ST4SUQ.cjs.map} +1 -1
- package/dist/{dist-XVBSOGFK.js → dist-TE7XRSWH.js} +3 -3
- package/dist/{dist-XVBSOGFK.js.map → dist-TE7XRSWH.js.map} +1 -1
- package/dist/{dist-R7WYX6LC.js → dist-VPYZNWNG.js} +3 -3
- package/dist/{dist-R7WYX6LC.js.map → dist-VPYZNWNG.js.map} +1 -1
- package/dist/{dist-4MVGNSRL.cjs → dist-Y5SYUVLY.cjs} +20 -20
- package/dist/{dist-4MVGNSRL.cjs.map → dist-Y5SYUVLY.cjs.map} +1 -1
- package/dist/server/handlers/a2a.cjs +9 -9
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-builder.cjs +19 -19
- package/dist/server/handlers/agent-builder.d.ts +23 -6
- package/dist/server/handlers/agent-builder.d.ts.map +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agents.cjs +27 -23
- package/dist/server/handlers/agents.d.ts +23 -3
- package/dist/server/handlers/agents.d.ts.map +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/memory.cjs +24 -24
- package/dist/server/handlers/memory.d.ts +20 -20
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/tools.cjs +6 -6
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/voice.cjs +8 -8
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +27 -27
- package/dist/server/handlers/workflows.d.ts +35 -9
- package/dist/server/handlers/workflows.d.ts.map +1 -1
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +14 -14
- package/dist/server/handlers.js +7 -7
- package/dist/server/schemas/agent-builder.d.ts +9 -0
- package/dist/server/schemas/agent-builder.d.ts.map +1 -1
- package/dist/server/schemas/agents.d.ts +26 -0
- package/dist/server/schemas/agents.d.ts.map +1 -1
- package/dist/server/schemas/memory.d.ts +20 -20
- package/dist/server/schemas/memory.d.ts.map +1 -1
- package/dist/server/schemas/workflows.d.ts +36 -7
- package/dist/server/schemas/workflows.d.ts.map +1 -1
- package/dist/server/server-adapter/index.cjs +109 -105
- package/dist/server/server-adapter/index.cjs.map +1 -1
- package/dist/server/server-adapter/index.d.ts +3 -3
- package/dist/server/server-adapter/index.d.ts.map +1 -1
- package/dist/server/server-adapter/index.js +12 -8
- package/dist/server/server-adapter/index.js.map +1 -1
- package/dist/server/server-adapter/routes/agents.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/index.d.ts +2 -2
- package/dist/server/server-adapter/routes/index.d.ts.map +1 -1
- package/dist/server/utils.d.ts.map +1 -1
- package/dist/{token-VFONFWVS.cjs → token-6GSAFR2W-KVDFAJ2M-EPLMGMHT.cjs} +11 -12
- package/dist/token-6GSAFR2W-KVDFAJ2M-EPLMGMHT.cjs.map +1 -0
- package/dist/{token-JGA3ZWAN.js → token-6GSAFR2W-KVDFAJ2M-LNX5VF3I.js} +8 -8
- package/dist/token-6GSAFR2W-KVDFAJ2M-LNX5VF3I.js.map +1 -0
- package/dist/{token-ZOD6YIQ3.cjs → token-6GSAFR2W-KVDFAJ2M-SDYXODLX.cjs} +11 -11
- package/dist/token-6GSAFR2W-KVDFAJ2M-SDYXODLX.cjs.map +1 -0
- package/dist/{token-GVZ7HRD7.js → token-6GSAFR2W-KVDFAJ2M-VW443KIA.js} +8 -9
- package/dist/token-6GSAFR2W-KVDFAJ2M-VW443KIA.js.map +1 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-6TH3ODCN.cjs +10 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-6TH3ODCN.cjs.map +1 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-BSQMRUEW.js +8 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-BSQMRUEW.js.map +1 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-EACKYD4V.js +8 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-EACKYD4V.js.map +1 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-MFJRDVVF.cjs +10 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-MFJRDVVF.cjs.map +1 -0
- package/package.json +4 -5
- package/dist/chunk-4W2SM6CG.js.map +0 -1
- package/dist/chunk-6YWE7UPT.js.map +0 -1
- package/dist/chunk-7HX4V5Y6.cjs.map +0 -1
- package/dist/chunk-AWBBXA36.js.map +0 -1
- package/dist/chunk-DG3INBBQ.js.map +0 -1
- package/dist/chunk-ER3QM7DD.js +0 -46
- package/dist/chunk-ER3QM7DD.js.map +0 -1
- package/dist/chunk-ESZ6V5WB.cjs.map +0 -1
- package/dist/chunk-FPCGLPLJ.cjs.map +0 -1
- package/dist/chunk-LPM6BBAX.cjs.map +0 -1
- package/dist/chunk-PUSD37LD.cjs.map +0 -1
- package/dist/chunk-Q6SVIZLX.js.map +0 -1
- package/dist/chunk-R56K77E2.cjs.map +0 -1
- package/dist/chunk-RQK4FQUD.js.map +0 -1
- package/dist/chunk-UTIOKR5C.js.map +0 -1
- package/dist/chunk-V272B7RM.cjs.map +0 -1
- package/dist/chunk-WE4USCF3.js.map +0 -1
- package/dist/chunk-WVAQXM6W.cjs.map +0 -1
- package/dist/chunk-XQPJ63ZD.cjs +0 -48
- package/dist/chunk-XQPJ63ZD.cjs.map +0 -1
- package/dist/chunk-YP34EWWK.js.map +0 -1
- package/dist/dist-P4MXBQ3U.cjs +0 -16
- package/dist/dist-YREX2TJT.js +0 -3
- package/dist/token-GVZ7HRD7.js.map +0 -1
- package/dist/token-JGA3ZWAN.js.map +0 -1
- package/dist/token-VFONFWVS.cjs.map +0 -1
- package/dist/token-ZOD6YIQ3.cjs.map +0 -1
- package/dist/token-util-7R2ZFIXO.js +0 -7
- package/dist/token-util-7R2ZFIXO.js.map +0 -1
- package/dist/token-util-BLJZJDBZ.cjs +0 -9
- package/dist/token-util-BLJZJDBZ.cjs.map +0 -1
- package/dist/token-util-VGZUWSNR.cjs +0 -9
- package/dist/token-util-VGZUWSNR.cjs.map +0 -1
- package/dist/token-util-VKTPZLSE.js +0 -7
- package/dist/token-util-VKTPZLSE.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkBMLUV4BH_cjs = require('./chunk-BMLUV4BH.cjs');
|
|
4
4
|
var zod = require('zod');
|
|
5
5
|
|
|
6
6
|
function convertToOpenAIChatMessages({
|
|
@@ -55,7 +55,7 @@ function convertToOpenAIChatMessages({
|
|
|
55
55
|
return {
|
|
56
56
|
type: "image_url",
|
|
57
57
|
image_url: {
|
|
58
|
-
url: part.image instanceof URL ? part.image.toString() : `data:${(_a = part.mimeType) != null ? _a : "image/jpeg"};base64,${
|
|
58
|
+
url: part.image instanceof URL ? part.image.toString() : `data:${(_a = part.mimeType) != null ? _a : "image/jpeg"};base64,${chunkBMLUV4BH_cjs.convertUint8ArrayToBase64(part.image)}`,
|
|
59
59
|
// OpenAI specific extension: image detail
|
|
60
60
|
detail: (_c = (_b = part.providerMetadata) == null ? void 0 : _b.openai) == null ? void 0 : _c.imageDetail
|
|
61
61
|
}
|
|
@@ -63,7 +63,7 @@ function convertToOpenAIChatMessages({
|
|
|
63
63
|
}
|
|
64
64
|
case "file": {
|
|
65
65
|
if (part.data instanceof URL) {
|
|
66
|
-
throw new
|
|
66
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
67
67
|
functionality: "'File content parts with URL data' functionality not supported."
|
|
68
68
|
});
|
|
69
69
|
}
|
|
@@ -91,7 +91,7 @@ function convertToOpenAIChatMessages({
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
default: {
|
|
94
|
-
throw new
|
|
94
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
95
95
|
functionality: `File content part type ${part.mimeType} in user messages`
|
|
96
96
|
});
|
|
97
97
|
}
|
|
@@ -126,7 +126,7 @@ function convertToOpenAIChatMessages({
|
|
|
126
126
|
}
|
|
127
127
|
if (useLegacyFunctionCalling) {
|
|
128
128
|
if (toolCalls.length > 1) {
|
|
129
|
-
throw new
|
|
129
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
130
130
|
functionality: "useLegacyFunctionCalling with multiple tool calls in one message"
|
|
131
131
|
});
|
|
132
132
|
}
|
|
@@ -207,7 +207,7 @@ var openaiErrorDataSchema = zod.z.object({
|
|
|
207
207
|
code: zod.z.union([zod.z.string(), zod.z.number()]).nullish()
|
|
208
208
|
})
|
|
209
209
|
});
|
|
210
|
-
var openaiFailedResponseHandler =
|
|
210
|
+
var openaiFailedResponseHandler = chunkBMLUV4BH_cjs.createJsonErrorResponseHandler({
|
|
211
211
|
errorSchema: openaiErrorDataSchema,
|
|
212
212
|
errorToMessage: (data) => data.error.message
|
|
213
213
|
});
|
|
@@ -265,7 +265,7 @@ function prepareTools({
|
|
|
265
265
|
toolWarnings
|
|
266
266
|
};
|
|
267
267
|
case "required":
|
|
268
|
-
throw new
|
|
268
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
269
269
|
functionality: "useLegacyFunctionCalling and toolChoice: required"
|
|
270
270
|
});
|
|
271
271
|
default:
|
|
@@ -314,7 +314,7 @@ function prepareTools({
|
|
|
314
314
|
};
|
|
315
315
|
default: {
|
|
316
316
|
const _exhaustiveCheck = type;
|
|
317
|
-
throw new
|
|
317
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
318
318
|
functionality: `Unsupported tool choice type: ${_exhaustiveCheck}`
|
|
319
319
|
});
|
|
320
320
|
}
|
|
@@ -375,12 +375,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
375
375
|
}
|
|
376
376
|
const useLegacyFunctionCalling = this.settings.useLegacyFunctionCalling;
|
|
377
377
|
if (useLegacyFunctionCalling && this.settings.parallelToolCalls === true) {
|
|
378
|
-
throw new
|
|
378
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
379
379
|
functionality: "useLegacyFunctionCalling with parallelToolCalls"
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
382
|
if (useLegacyFunctionCalling && this.supportsStructuredOutputs) {
|
|
383
|
-
throw new
|
|
383
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
384
384
|
functionality: "structuredOutputs with useLegacyFunctionCalling"
|
|
385
385
|
});
|
|
386
386
|
}
|
|
@@ -581,15 +581,15 @@ var OpenAIChatLanguageModel = class {
|
|
|
581
581
|
responseHeaders,
|
|
582
582
|
value: response,
|
|
583
583
|
rawValue: rawResponse
|
|
584
|
-
} = await
|
|
584
|
+
} = await chunkBMLUV4BH_cjs.postJsonToApi({
|
|
585
585
|
url: this.config.url({
|
|
586
586
|
path: "/chat/completions",
|
|
587
587
|
modelId: this.modelId
|
|
588
588
|
}),
|
|
589
|
-
headers:
|
|
589
|
+
headers: chunkBMLUV4BH_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
590
590
|
body,
|
|
591
591
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
592
|
-
successfulResponseHandler:
|
|
592
|
+
successfulResponseHandler: chunkBMLUV4BH_cjs.createJsonResponseHandler(
|
|
593
593
|
openaiChatResponseSchema
|
|
594
594
|
),
|
|
595
595
|
abortSignal: options.abortSignal,
|
|
@@ -617,7 +617,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
617
617
|
toolCalls: this.settings.useLegacyFunctionCalling && choice.message.function_call ? [
|
|
618
618
|
{
|
|
619
619
|
toolCallType: "function",
|
|
620
|
-
toolCallId:
|
|
620
|
+
toolCallId: chunkBMLUV4BH_cjs.generateId(),
|
|
621
621
|
toolName: choice.message.function_call.name,
|
|
622
622
|
args: choice.message.function_call.arguments
|
|
623
623
|
}
|
|
@@ -625,7 +625,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
625
625
|
var _a2;
|
|
626
626
|
return {
|
|
627
627
|
toolCallType: "function",
|
|
628
|
-
toolCallId: (_a2 = toolCall.id) != null ? _a2 :
|
|
628
|
+
toolCallId: (_a2 = toolCall.id) != null ? _a2 : chunkBMLUV4BH_cjs.generateId(),
|
|
629
629
|
toolName: toolCall.function.name,
|
|
630
630
|
args: toolCall.function.arguments
|
|
631
631
|
};
|
|
@@ -695,15 +695,15 @@ var OpenAIChatLanguageModel = class {
|
|
|
695
695
|
// only include stream_options when in strict compatibility mode:
|
|
696
696
|
stream_options: this.config.compatibility === "strict" ? { include_usage: true } : void 0
|
|
697
697
|
};
|
|
698
|
-
const { responseHeaders, value: response } = await
|
|
698
|
+
const { responseHeaders, value: response } = await chunkBMLUV4BH_cjs.postJsonToApi({
|
|
699
699
|
url: this.config.url({
|
|
700
700
|
path: "/chat/completions",
|
|
701
701
|
modelId: this.modelId
|
|
702
702
|
}),
|
|
703
|
-
headers:
|
|
703
|
+
headers: chunkBMLUV4BH_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
704
704
|
body,
|
|
705
705
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
706
|
-
successfulResponseHandler:
|
|
706
|
+
successfulResponseHandler: chunkBMLUV4BH_cjs.createEventSourceResponseHandler(
|
|
707
707
|
openaiChatChunkSchema
|
|
708
708
|
),
|
|
709
709
|
abortSignal: options.abortSignal,
|
|
@@ -791,7 +791,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
791
791
|
const mappedToolCalls = useLegacyFunctionCalling && delta.function_call != null ? [
|
|
792
792
|
{
|
|
793
793
|
type: "function",
|
|
794
|
-
id:
|
|
794
|
+
id: chunkBMLUV4BH_cjs.generateId(),
|
|
795
795
|
function: delta.function_call,
|
|
796
796
|
index: 0
|
|
797
797
|
}
|
|
@@ -801,19 +801,19 @@ var OpenAIChatLanguageModel = class {
|
|
|
801
801
|
const index = toolCallDelta.index;
|
|
802
802
|
if (toolCalls[index] == null) {
|
|
803
803
|
if (toolCallDelta.type !== "function") {
|
|
804
|
-
throw new
|
|
804
|
+
throw new chunkBMLUV4BH_cjs.InvalidResponseDataError({
|
|
805
805
|
data: toolCallDelta,
|
|
806
806
|
message: `Expected 'function' type.`
|
|
807
807
|
});
|
|
808
808
|
}
|
|
809
809
|
if (toolCallDelta.id == null) {
|
|
810
|
-
throw new
|
|
810
|
+
throw new chunkBMLUV4BH_cjs.InvalidResponseDataError({
|
|
811
811
|
data: toolCallDelta,
|
|
812
812
|
message: `Expected 'id' to be a string.`
|
|
813
813
|
});
|
|
814
814
|
}
|
|
815
815
|
if (((_a = toolCallDelta.function) == null ? void 0 : _a.name) == null) {
|
|
816
|
-
throw new
|
|
816
|
+
throw new chunkBMLUV4BH_cjs.InvalidResponseDataError({
|
|
817
817
|
data: toolCallDelta,
|
|
818
818
|
message: `Expected 'function.name' to be a string.`
|
|
819
819
|
});
|
|
@@ -838,11 +838,11 @@ var OpenAIChatLanguageModel = class {
|
|
|
838
838
|
argsTextDelta: toolCall2.function.arguments
|
|
839
839
|
});
|
|
840
840
|
}
|
|
841
|
-
if (
|
|
841
|
+
if (chunkBMLUV4BH_cjs.isParsableJson(toolCall2.function.arguments)) {
|
|
842
842
|
controller.enqueue({
|
|
843
843
|
type: "tool-call",
|
|
844
844
|
toolCallType: "function",
|
|
845
|
-
toolCallId: (_e = toolCall2.id) != null ? _e :
|
|
845
|
+
toolCallId: (_e = toolCall2.id) != null ? _e : chunkBMLUV4BH_cjs.generateId(),
|
|
846
846
|
toolName: toolCall2.function.name,
|
|
847
847
|
args: toolCall2.function.arguments
|
|
848
848
|
});
|
|
@@ -865,11 +865,11 @@ var OpenAIChatLanguageModel = class {
|
|
|
865
865
|
toolName: toolCall.function.name,
|
|
866
866
|
argsTextDelta: (_i = toolCallDelta.function.arguments) != null ? _i : ""
|
|
867
867
|
});
|
|
868
|
-
if (((_j = toolCall.function) == null ? void 0 : _j.name) != null && ((_k = toolCall.function) == null ? void 0 : _k.arguments) != null &&
|
|
868
|
+
if (((_j = toolCall.function) == null ? void 0 : _j.name) != null && ((_k = toolCall.function) == null ? void 0 : _k.arguments) != null && chunkBMLUV4BH_cjs.isParsableJson(toolCall.function.arguments)) {
|
|
869
869
|
controller.enqueue({
|
|
870
870
|
type: "tool-call",
|
|
871
871
|
toolCallType: "function",
|
|
872
|
-
toolCallId: (_l = toolCall.id) != null ? _l :
|
|
872
|
+
toolCallId: (_l = toolCall.id) != null ? _l : chunkBMLUV4BH_cjs.generateId(),
|
|
873
873
|
toolName: toolCall.function.name,
|
|
874
874
|
args: toolCall.function.arguments
|
|
875
875
|
});
|
|
@@ -1068,7 +1068,7 @@ function convertToOpenAICompletionPrompt({
|
|
|
1068
1068
|
for (const { role, content } of prompt) {
|
|
1069
1069
|
switch (role) {
|
|
1070
1070
|
case "system": {
|
|
1071
|
-
throw new
|
|
1071
|
+
throw new chunkBMLUV4BH_cjs.InvalidPromptError({
|
|
1072
1072
|
message: "Unexpected system message in prompt: ${content}",
|
|
1073
1073
|
prompt
|
|
1074
1074
|
});
|
|
@@ -1080,7 +1080,7 @@ function convertToOpenAICompletionPrompt({
|
|
|
1080
1080
|
return part.text;
|
|
1081
1081
|
}
|
|
1082
1082
|
case "image": {
|
|
1083
|
-
throw new
|
|
1083
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
1084
1084
|
functionality: "images"
|
|
1085
1085
|
});
|
|
1086
1086
|
}
|
|
@@ -1099,7 +1099,7 @@ ${userMessage}
|
|
|
1099
1099
|
return part.text;
|
|
1100
1100
|
}
|
|
1101
1101
|
case "tool-call": {
|
|
1102
|
-
throw new
|
|
1102
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
1103
1103
|
functionality: "tool-call messages"
|
|
1104
1104
|
});
|
|
1105
1105
|
}
|
|
@@ -1112,7 +1112,7 @@ ${assistantMessage}
|
|
|
1112
1112
|
break;
|
|
1113
1113
|
}
|
|
1114
1114
|
case "tool": {
|
|
1115
|
-
throw new
|
|
1115
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
1116
1116
|
functionality: "tool messages"
|
|
1117
1117
|
});
|
|
1118
1118
|
}
|
|
@@ -1209,24 +1209,24 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1209
1209
|
switch (type) {
|
|
1210
1210
|
case "regular": {
|
|
1211
1211
|
if ((_a = mode.tools) == null ? void 0 : _a.length) {
|
|
1212
|
-
throw new
|
|
1212
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
1213
1213
|
functionality: "tools"
|
|
1214
1214
|
});
|
|
1215
1215
|
}
|
|
1216
1216
|
if (mode.toolChoice) {
|
|
1217
|
-
throw new
|
|
1217
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
1218
1218
|
functionality: "toolChoice"
|
|
1219
1219
|
});
|
|
1220
1220
|
}
|
|
1221
1221
|
return { args: baseArgs, warnings };
|
|
1222
1222
|
}
|
|
1223
1223
|
case "object-json": {
|
|
1224
|
-
throw new
|
|
1224
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
1225
1225
|
functionality: "object-json mode"
|
|
1226
1226
|
});
|
|
1227
1227
|
}
|
|
1228
1228
|
case "object-tool": {
|
|
1229
|
-
throw new
|
|
1229
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
1230
1230
|
functionality: "object-tool mode"
|
|
1231
1231
|
});
|
|
1232
1232
|
}
|
|
@@ -1242,15 +1242,15 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1242
1242
|
responseHeaders,
|
|
1243
1243
|
value: response,
|
|
1244
1244
|
rawValue: rawResponse
|
|
1245
|
-
} = await
|
|
1245
|
+
} = await chunkBMLUV4BH_cjs.postJsonToApi({
|
|
1246
1246
|
url: this.config.url({
|
|
1247
1247
|
path: "/completions",
|
|
1248
1248
|
modelId: this.modelId
|
|
1249
1249
|
}),
|
|
1250
|
-
headers:
|
|
1250
|
+
headers: chunkBMLUV4BH_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
1251
1251
|
body: args,
|
|
1252
1252
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1253
|
-
successfulResponseHandler:
|
|
1253
|
+
successfulResponseHandler: chunkBMLUV4BH_cjs.createJsonResponseHandler(
|
|
1254
1254
|
openaiCompletionResponseSchema
|
|
1255
1255
|
),
|
|
1256
1256
|
abortSignal: options.abortSignal,
|
|
@@ -1281,15 +1281,15 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1281
1281
|
// only include stream_options when in strict compatibility mode:
|
|
1282
1282
|
stream_options: this.config.compatibility === "strict" ? { include_usage: true } : void 0
|
|
1283
1283
|
};
|
|
1284
|
-
const { responseHeaders, value: response } = await
|
|
1284
|
+
const { responseHeaders, value: response } = await chunkBMLUV4BH_cjs.postJsonToApi({
|
|
1285
1285
|
url: this.config.url({
|
|
1286
1286
|
path: "/completions",
|
|
1287
1287
|
modelId: this.modelId
|
|
1288
1288
|
}),
|
|
1289
|
-
headers:
|
|
1289
|
+
headers: chunkBMLUV4BH_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
1290
1290
|
body,
|
|
1291
1291
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1292
|
-
successfulResponseHandler:
|
|
1292
|
+
successfulResponseHandler: chunkBMLUV4BH_cjs.createEventSourceResponseHandler(
|
|
1293
1293
|
openaiCompletionChunkSchema
|
|
1294
1294
|
),
|
|
1295
1295
|
abortSignal: options.abortSignal,
|
|
@@ -1434,19 +1434,19 @@ var OpenAIEmbeddingModel = class {
|
|
|
1434
1434
|
abortSignal
|
|
1435
1435
|
}) {
|
|
1436
1436
|
if (values.length > this.maxEmbeddingsPerCall) {
|
|
1437
|
-
throw new
|
|
1437
|
+
throw new chunkBMLUV4BH_cjs.TooManyEmbeddingValuesForCallError({
|
|
1438
1438
|
provider: this.provider,
|
|
1439
1439
|
modelId: this.modelId,
|
|
1440
1440
|
maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,
|
|
1441
1441
|
values
|
|
1442
1442
|
});
|
|
1443
1443
|
}
|
|
1444
|
-
const { responseHeaders, value: response } = await
|
|
1444
|
+
const { responseHeaders, value: response } = await chunkBMLUV4BH_cjs.postJsonToApi({
|
|
1445
1445
|
url: this.config.url({
|
|
1446
1446
|
path: "/embeddings",
|
|
1447
1447
|
modelId: this.modelId
|
|
1448
1448
|
}),
|
|
1449
|
-
headers:
|
|
1449
|
+
headers: chunkBMLUV4BH_cjs.combineHeaders(this.config.headers(), headers),
|
|
1450
1450
|
body: {
|
|
1451
1451
|
model: this.modelId,
|
|
1452
1452
|
input: values,
|
|
@@ -1455,7 +1455,7 @@ var OpenAIEmbeddingModel = class {
|
|
|
1455
1455
|
user: this.settings.user
|
|
1456
1456
|
},
|
|
1457
1457
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1458
|
-
successfulResponseHandler:
|
|
1458
|
+
successfulResponseHandler: chunkBMLUV4BH_cjs.createJsonResponseHandler(
|
|
1459
1459
|
openaiTextEmbeddingResponseSchema
|
|
1460
1460
|
),
|
|
1461
1461
|
abortSignal,
|
|
@@ -1515,12 +1515,12 @@ var OpenAIImageModel = class {
|
|
|
1515
1515
|
warnings.push({ type: "unsupported-setting", setting: "seed" });
|
|
1516
1516
|
}
|
|
1517
1517
|
const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
|
|
1518
|
-
const { value: response, responseHeaders } = await
|
|
1518
|
+
const { value: response, responseHeaders } = await chunkBMLUV4BH_cjs.postJsonToApi({
|
|
1519
1519
|
url: this.config.url({
|
|
1520
1520
|
path: "/images/generations",
|
|
1521
1521
|
modelId: this.modelId
|
|
1522
1522
|
}),
|
|
1523
|
-
headers:
|
|
1523
|
+
headers: chunkBMLUV4BH_cjs.combineHeaders(this.config.headers(), headers),
|
|
1524
1524
|
body: {
|
|
1525
1525
|
model: this.modelId,
|
|
1526
1526
|
prompt,
|
|
@@ -1530,7 +1530,7 @@ var OpenAIImageModel = class {
|
|
|
1530
1530
|
...!hasDefaultResponseFormat.has(this.modelId) ? { response_format: "b64_json" } : {}
|
|
1531
1531
|
},
|
|
1532
1532
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1533
|
-
successfulResponseHandler:
|
|
1533
|
+
successfulResponseHandler: chunkBMLUV4BH_cjs.createJsonResponseHandler(
|
|
1534
1534
|
openaiImageResponseSchema
|
|
1535
1535
|
),
|
|
1536
1536
|
abortSignal,
|
|
@@ -1632,13 +1632,13 @@ var OpenAITranscriptionModel = class {
|
|
|
1632
1632
|
}) {
|
|
1633
1633
|
var _a, _b, _c, _d, _e;
|
|
1634
1634
|
const warnings = [];
|
|
1635
|
-
const openAIOptions =
|
|
1635
|
+
const openAIOptions = chunkBMLUV4BH_cjs.parseProviderOptions({
|
|
1636
1636
|
provider: "openai",
|
|
1637
1637
|
providerOptions,
|
|
1638
1638
|
schema: openAIProviderOptionsSchema
|
|
1639
1639
|
});
|
|
1640
1640
|
const formData = new FormData();
|
|
1641
|
-
const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([
|
|
1641
|
+
const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([chunkBMLUV4BH_cjs.convertBase64ToUint8Array(audio)]);
|
|
1642
1642
|
formData.append("model", this.modelId);
|
|
1643
1643
|
formData.append("file", new File([blob], "audio", { type: mediaType }));
|
|
1644
1644
|
if (openAIOptions) {
|
|
@@ -1669,15 +1669,15 @@ var OpenAITranscriptionModel = class {
|
|
|
1669
1669
|
value: response,
|
|
1670
1670
|
responseHeaders,
|
|
1671
1671
|
rawValue: rawResponse
|
|
1672
|
-
} = await
|
|
1672
|
+
} = await chunkBMLUV4BH_cjs.postFormDataToApi({
|
|
1673
1673
|
url: this.config.url({
|
|
1674
1674
|
path: "/audio/transcriptions",
|
|
1675
1675
|
modelId: this.modelId
|
|
1676
1676
|
}),
|
|
1677
|
-
headers:
|
|
1677
|
+
headers: chunkBMLUV4BH_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
1678
1678
|
formData,
|
|
1679
1679
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1680
|
-
successfulResponseHandler:
|
|
1680
|
+
successfulResponseHandler: chunkBMLUV4BH_cjs.createJsonResponseHandler(
|
|
1681
1681
|
openaiTranscriptionResponseSchema
|
|
1682
1682
|
),
|
|
1683
1683
|
abortSignal: options.abortSignal,
|
|
@@ -1761,14 +1761,14 @@ function convertToOpenAIResponsesMessages({
|
|
|
1761
1761
|
case "image": {
|
|
1762
1762
|
return {
|
|
1763
1763
|
type: "input_image",
|
|
1764
|
-
image_url: part.image instanceof URL ? part.image.toString() : `data:${(_a = part.mimeType) != null ? _a : "image/jpeg"};base64,${
|
|
1764
|
+
image_url: part.image instanceof URL ? part.image.toString() : `data:${(_a = part.mimeType) != null ? _a : "image/jpeg"};base64,${chunkBMLUV4BH_cjs.convertUint8ArrayToBase64(part.image)}`,
|
|
1765
1765
|
// OpenAI specific extension: image detail
|
|
1766
1766
|
detail: (_c = (_b = part.providerMetadata) == null ? void 0 : _b.openai) == null ? void 0 : _c.imageDetail
|
|
1767
1767
|
};
|
|
1768
1768
|
}
|
|
1769
1769
|
case "file": {
|
|
1770
1770
|
if (part.data instanceof URL) {
|
|
1771
|
-
throw new
|
|
1771
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
1772
1772
|
functionality: "File URLs in user messages"
|
|
1773
1773
|
});
|
|
1774
1774
|
}
|
|
@@ -1781,7 +1781,7 @@ function convertToOpenAIResponsesMessages({
|
|
|
1781
1781
|
};
|
|
1782
1782
|
}
|
|
1783
1783
|
default: {
|
|
1784
|
-
throw new
|
|
1784
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
1785
1785
|
functionality: "Only PDF files are supported in user messages"
|
|
1786
1786
|
});
|
|
1787
1787
|
}
|
|
@@ -1921,7 +1921,7 @@ function prepareResponsesTools({
|
|
|
1921
1921
|
}
|
|
1922
1922
|
default: {
|
|
1923
1923
|
const _exhaustiveCheck = type;
|
|
1924
|
-
throw new
|
|
1924
|
+
throw new chunkBMLUV4BH_cjs.UnsupportedFunctionalityError({
|
|
1925
1925
|
functionality: `Unsupported tool choice type: ${_exhaustiveCheck}`
|
|
1926
1926
|
});
|
|
1927
1927
|
}
|
|
@@ -1991,7 +1991,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
1991
1991
|
systemMessageMode: modelConfig.systemMessageMode
|
|
1992
1992
|
});
|
|
1993
1993
|
warnings.push(...messageWarnings);
|
|
1994
|
-
const openaiOptions =
|
|
1994
|
+
const openaiOptions = chunkBMLUV4BH_cjs.parseProviderOptions({
|
|
1995
1995
|
provider: "openai",
|
|
1996
1996
|
providerOptions: providerMetadata,
|
|
1997
1997
|
schema: openaiResponsesProviderOptionsSchema
|
|
@@ -2122,12 +2122,12 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2122
2122
|
responseHeaders,
|
|
2123
2123
|
value: response,
|
|
2124
2124
|
rawValue: rawResponse
|
|
2125
|
-
} = await
|
|
2125
|
+
} = await chunkBMLUV4BH_cjs.postJsonToApi({
|
|
2126
2126
|
url,
|
|
2127
|
-
headers:
|
|
2127
|
+
headers: chunkBMLUV4BH_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
2128
2128
|
body,
|
|
2129
2129
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
2130
|
-
successfulResponseHandler:
|
|
2130
|
+
successfulResponseHandler: chunkBMLUV4BH_cjs.createJsonResponseHandler(
|
|
2131
2131
|
zod.z.object({
|
|
2132
2132
|
id: zod.z.string(),
|
|
2133
2133
|
created_at: zod.z.number(),
|
|
@@ -2188,7 +2188,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2188
2188
|
fetch: this.config.fetch
|
|
2189
2189
|
});
|
|
2190
2190
|
if (response.error) {
|
|
2191
|
-
throw new
|
|
2191
|
+
throw new chunkBMLUV4BH_cjs.APICallError({
|
|
2192
2192
|
message: response.error.message,
|
|
2193
2193
|
url,
|
|
2194
2194
|
requestBodyValues: body,
|
|
@@ -2213,7 +2213,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2213
2213
|
var _a2, _b2, _c2;
|
|
2214
2214
|
return {
|
|
2215
2215
|
sourceType: "url",
|
|
2216
|
-
id: (_c2 = (_b2 = (_a2 = this.config).generateId) == null ? void 0 : _b2.call(_a2)) != null ? _c2 :
|
|
2216
|
+
id: (_c2 = (_b2 = (_a2 = this.config).generateId) == null ? void 0 : _b2.call(_a2)) != null ? _c2 : chunkBMLUV4BH_cjs.generateId(),
|
|
2217
2217
|
url: annotation.url,
|
|
2218
2218
|
title: annotation.title
|
|
2219
2219
|
};
|
|
@@ -2260,18 +2260,18 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2260
2260
|
}
|
|
2261
2261
|
async doStream(options) {
|
|
2262
2262
|
const { args: body, warnings } = this.getArgs(options);
|
|
2263
|
-
const { responseHeaders, value: response } = await
|
|
2263
|
+
const { responseHeaders, value: response } = await chunkBMLUV4BH_cjs.postJsonToApi({
|
|
2264
2264
|
url: this.config.url({
|
|
2265
2265
|
path: "/responses",
|
|
2266
2266
|
modelId: this.modelId
|
|
2267
2267
|
}),
|
|
2268
|
-
headers:
|
|
2268
|
+
headers: chunkBMLUV4BH_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
2269
2269
|
body: {
|
|
2270
2270
|
...body,
|
|
2271
2271
|
stream: true
|
|
2272
2272
|
},
|
|
2273
2273
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
2274
|
-
successfulResponseHandler:
|
|
2274
|
+
successfulResponseHandler: chunkBMLUV4BH_cjs.createEventSourceResponseHandler(
|
|
2275
2275
|
openaiResponsesChunkSchema
|
|
2276
2276
|
),
|
|
2277
2277
|
abortSignal: options.abortSignal,
|
|
@@ -2364,7 +2364,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2364
2364
|
type: "source",
|
|
2365
2365
|
source: {
|
|
2366
2366
|
sourceType: "url",
|
|
2367
|
-
id: (_h = (_g = (_f = self.config).generateId) == null ? void 0 : _g.call(_f)) != null ? _h :
|
|
2367
|
+
id: (_h = (_g = (_f = self.config).generateId) == null ? void 0 : _g.call(_f)) != null ? _h : chunkBMLUV4BH_cjs.generateId(),
|
|
2368
2368
|
url: value.annotation.url,
|
|
2369
2369
|
title: value.annotation.title
|
|
2370
2370
|
}
|
|
@@ -2599,7 +2599,7 @@ var OpenAISpeechModel = class {
|
|
|
2599
2599
|
providerOptions
|
|
2600
2600
|
}) {
|
|
2601
2601
|
const warnings = [];
|
|
2602
|
-
const openAIOptions =
|
|
2602
|
+
const openAIOptions = chunkBMLUV4BH_cjs.parseProviderOptions({
|
|
2603
2603
|
provider: "openai",
|
|
2604
2604
|
providerOptions,
|
|
2605
2605
|
schema: OpenAIProviderOptionsSchema
|
|
@@ -2645,15 +2645,15 @@ var OpenAISpeechModel = class {
|
|
|
2645
2645
|
value: audio,
|
|
2646
2646
|
responseHeaders,
|
|
2647
2647
|
rawValue: rawResponse
|
|
2648
|
-
} = await
|
|
2648
|
+
} = await chunkBMLUV4BH_cjs.postJsonToApi({
|
|
2649
2649
|
url: this.config.url({
|
|
2650
2650
|
path: "/audio/speech",
|
|
2651
2651
|
modelId: this.modelId
|
|
2652
2652
|
}),
|
|
2653
|
-
headers:
|
|
2653
|
+
headers: chunkBMLUV4BH_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
2654
2654
|
body: requestBody,
|
|
2655
2655
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
2656
|
-
successfulResponseHandler:
|
|
2656
|
+
successfulResponseHandler: chunkBMLUV4BH_cjs.createBinaryResponseHandler(),
|
|
2657
2657
|
abortSignal: options.abortSignal,
|
|
2658
2658
|
fetch: this.config.fetch
|
|
2659
2659
|
});
|
|
@@ -2674,11 +2674,11 @@ var OpenAISpeechModel = class {
|
|
|
2674
2674
|
};
|
|
2675
2675
|
function createOpenAI(options = {}) {
|
|
2676
2676
|
var _a, _b, _c;
|
|
2677
|
-
const baseURL = (_a =
|
|
2677
|
+
const baseURL = (_a = chunkBMLUV4BH_cjs.withoutTrailingSlash(options.baseURL)) != null ? _a : "https://api.openai.com/v1";
|
|
2678
2678
|
const compatibility = (_b = options.compatibility) != null ? _b : "compatible";
|
|
2679
2679
|
const providerName = (_c = options.name) != null ? _c : "openai";
|
|
2680
2680
|
const getHeaders = () => ({
|
|
2681
|
-
Authorization: `Bearer ${
|
|
2681
|
+
Authorization: `Bearer ${chunkBMLUV4BH_cjs.loadApiKey({
|
|
2682
2682
|
apiKey: options.apiKey,
|
|
2683
2683
|
environmentVariableName: "OPENAI_API_KEY",
|
|
2684
2684
|
description: "OpenAI"
|
|
@@ -2773,5 +2773,5 @@ var openai = createOpenAI({
|
|
|
2773
2773
|
|
|
2774
2774
|
exports.createOpenAI = createOpenAI;
|
|
2775
2775
|
exports.openai = openai;
|
|
2776
|
-
//# sourceMappingURL=chunk-
|
|
2777
|
-
//# sourceMappingURL=chunk-
|
|
2776
|
+
//# sourceMappingURL=chunk-K73YS7YB.cjs.map
|
|
2777
|
+
//# sourceMappingURL=chunk-K73YS7YB.cjs.map
|