@agentica/core 0.10.4 → 0.11.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/lib/Agentica.d.ts +14 -14
- package/lib/Agentica.js +54 -31
- package/lib/Agentica.js.map +1 -1
- package/lib/chatgpt/ChatGptAgent.d.ts +3 -3
- package/lib/chatgpt/ChatGptAgent.js +1 -1
- package/lib/chatgpt/ChatGptAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptCallFunctionAgent.d.ts +3 -3
- package/lib/chatgpt/ChatGptCallFunctionAgent.js +61 -63
- package/lib/chatgpt/ChatGptCallFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptCancelFunctionAgent.d.ts +6 -6
- package/lib/chatgpt/ChatGptCancelFunctionAgent.js +28 -30
- package/lib/chatgpt/ChatGptCancelFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptCompletionMessageUtil.d.ts +8 -0
- package/lib/chatgpt/ChatGptCompletionMessageUtil.js +536 -0
- package/lib/chatgpt/ChatGptCompletionMessageUtil.js.map +1 -0
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.d.ts +4 -3
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.js +56 -6
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptHistoryDecoder.d.ts +2 -2
- package/lib/chatgpt/ChatGptHistoryDecoder.js +8 -8
- package/lib/chatgpt/ChatGptHistoryDecoder.js.map +1 -1
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.d.ts +3 -3
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.js +11 -5
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptSelectFunctionAgent.d.ts +3 -3
- package/lib/chatgpt/ChatGptSelectFunctionAgent.js +39 -42
- package/lib/chatgpt/ChatGptSelectFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptUsageAggregator.d.ts +6 -0
- package/lib/chatgpt/ChatGptUsageAggregator.js +48 -0
- package/lib/chatgpt/ChatGptUsageAggregator.js.map +1 -0
- package/lib/context/AgenticaCancelPrompt.d.ts +16 -0
- package/lib/context/AgenticaCancelPrompt.js +20 -0
- package/lib/context/AgenticaCancelPrompt.js.map +1 -0
- package/lib/context/AgenticaClassOperation.d.ts +8 -0
- package/lib/context/AgenticaClassOperation.js +11 -0
- package/lib/context/AgenticaClassOperation.js.map +1 -0
- package/lib/{structures/IAgenticaContext.d.ts → context/AgenticaContext.d.ts} +15 -14
- package/lib/{structures/IAgenticaPrompt.js → context/AgenticaContext.js} +1 -1
- package/lib/context/AgenticaContext.js.map +1 -0
- package/lib/context/AgenticaHttpOperation.d.ts +8 -0
- package/lib/context/AgenticaHttpOperation.js +11 -0
- package/lib/context/AgenticaHttpOperation.js.map +1 -0
- package/lib/context/AgenticaOperation.d.ts +46 -0
- package/lib/{structures/IAgenticaContext.js → context/AgenticaOperation.js} +1 -1
- package/lib/context/AgenticaOperation.js.map +1 -0
- package/lib/context/AgenticaOperationBase.d.ts +29 -0
- package/lib/context/AgenticaOperationBase.js +21 -0
- package/lib/context/AgenticaOperationBase.js.map +1 -0
- package/lib/{structures/IAgenticaOperationCollection.d.ts → context/AgenticaOperationCollection.d.ts} +6 -6
- package/lib/{structures/IAgenticaOperationSelection.js → context/AgenticaOperationCollection.js} +1 -1
- package/lib/context/AgenticaOperationCollection.js.map +1 -0
- package/lib/context/AgenticaOperationSelection.d.ts +15 -0
- package/lib/context/AgenticaOperationSelection.js +17 -0
- package/lib/context/AgenticaOperationSelection.js.map +1 -0
- package/lib/context/AgenticaTokenUsage.d.ts +82 -0
- package/lib/context/AgenticaTokenUsage.js +97 -0
- package/lib/context/AgenticaTokenUsage.js.map +1 -0
- package/lib/context/internal/AgenticaTokenUsageAggregator.d.ts +10 -0
- package/lib/{internal → context/internal}/AgenticaTokenUsageAggregator.js +0 -46
- package/lib/context/internal/AgenticaTokenUsageAggregator.js.map +1 -0
- package/lib/context/internal/__IChatCancelFunctionsApplication.js.map +1 -0
- package/lib/context/internal/__IChatFunctionReference.js.map +1 -0
- package/lib/context/internal/__IChatInitialApplication.js.map +1 -0
- package/lib/context/internal/__IChatSelectFunctionsApplication.js.map +1 -0
- package/lib/events/AgenticaCallEvent.d.ts +18 -0
- package/lib/events/AgenticaCallEvent.js +22 -0
- package/lib/events/AgenticaCallEvent.js.map +1 -0
- package/lib/events/AgenticaCancelEvent.d.ts +14 -0
- package/lib/events/AgenticaCancelEvent.js +18 -0
- package/lib/events/AgenticaCancelEvent.js.map +1 -0
- package/lib/events/AgenticaDescribeEvent.d.ts +27 -0
- package/lib/events/AgenticaDescribeEvent.js +40 -0
- package/lib/events/AgenticaDescribeEvent.js.map +1 -0
- package/lib/events/AgenticaEvent.d.ts +25 -0
- package/lib/{structures/IAgenticaEvent.js → events/AgenticaEvent.js} +1 -1
- package/lib/events/AgenticaEvent.js.map +1 -0
- package/lib/events/AgenticaEventBase.d.ts +4 -0
- package/lib/events/AgenticaEventBase.js +10 -0
- package/lib/events/AgenticaEventBase.js.map +1 -0
- package/lib/events/AgenticaEventSource.d.ts +1 -0
- package/lib/events/AgenticaEventSource.js +3 -0
- package/lib/events/AgenticaEventSource.js.map +1 -0
- package/lib/events/AgenticaExecuteEvent.d.ts +22 -0
- package/lib/events/AgenticaExecuteEvent.js +33 -0
- package/lib/events/AgenticaExecuteEvent.js.map +1 -0
- package/lib/events/AgenticaInitializeEvent.d.ts +6 -0
- package/lib/events/AgenticaInitializeEvent.js +16 -0
- package/lib/events/AgenticaInitializeEvent.js.map +1 -0
- package/lib/events/AgenticaRequestEvent.d.ts +27 -0
- package/lib/events/AgenticaRequestEvent.js +22 -0
- package/lib/events/AgenticaRequestEvent.js.map +1 -0
- package/lib/events/AgenticaResponseEvent.d.ts +35 -0
- package/lib/events/AgenticaResponseEvent.js +16 -0
- package/lib/events/AgenticaResponseEvent.js.map +1 -0
- package/lib/events/AgenticaSelectEvent.d.ts +16 -0
- package/lib/events/AgenticaSelectEvent.js +26 -0
- package/lib/events/AgenticaSelectEvent.js.map +1 -0
- package/lib/events/AgenticaTextEvent.d.ts +25 -0
- package/lib/events/AgenticaTextEvent.js +40 -0
- package/lib/events/AgenticaTextEvent.js.map +1 -0
- package/lib/index.d.ts +26 -8
- package/lib/index.js +29 -9
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1391 -306
- package/lib/index.mjs.map +1 -1
- package/lib/internal/AgenticaOperationComposer.d.ts +2 -2
- package/lib/internal/AgenticaOperationComposer.js +12 -0
- package/lib/internal/AgenticaOperationComposer.js.map +1 -1
- package/lib/internal/ByteArrayUtil.d.ts +3 -0
- package/lib/internal/ByteArrayUtil.js +10 -0
- package/lib/internal/ByteArrayUtil.js.map +1 -0
- package/lib/internal/MPSCUtil.d.ts +21 -0
- package/lib/internal/MPSCUtil.js +84 -0
- package/lib/internal/MPSCUtil.js.map +1 -0
- package/lib/internal/StreamUtil.d.ts +6 -0
- package/lib/internal/StreamUtil.js +65 -0
- package/lib/internal/StreamUtil.js.map +1 -0
- package/lib/json/IAgenticaEventJson.d.ts +149 -0
- package/lib/{structures/IAgenticaOperation.js → json/IAgenticaEventJson.js} +1 -1
- package/lib/json/IAgenticaEventJson.js.map +1 -0
- package/lib/json/IAgenticaOperationJson.d.ts +33 -0
- package/lib/json/IAgenticaOperationJson.js +3 -0
- package/lib/json/IAgenticaOperationJson.js.map +1 -0
- package/lib/json/IAgenticaOperationSelectionJson.d.ts +18 -0
- package/lib/{structures/IAgenticaOperationCollection.js → json/IAgenticaOperationSelectionJson.js} +1 -1
- package/lib/json/IAgenticaOperationSelectionJson.js.map +1 -0
- package/lib/json/IAgenticaPromptJson.d.ts +111 -0
- package/lib/json/IAgenticaPromptJson.js +3 -0
- package/lib/json/IAgenticaPromptJson.js.map +1 -0
- package/lib/{structures/IAgenticaTokenUsage.d.ts → json/IAgenticaTokenUsageJson.d.ts} +10 -10
- package/lib/json/IAgenticaTokenUsageJson.js +3 -0
- package/lib/json/IAgenticaTokenUsageJson.js.map +1 -0
- package/lib/prompts/AgenticaCancelPrompt.d.ts +16 -0
- package/lib/prompts/AgenticaCancelPrompt.js +20 -0
- package/lib/prompts/AgenticaCancelPrompt.js.map +1 -0
- package/lib/prompts/AgenticaDescribePrompt.d.ts +24 -0
- package/lib/prompts/AgenticaDescribePrompt.js +20 -0
- package/lib/prompts/AgenticaDescribePrompt.js.map +1 -0
- package/lib/prompts/AgenticaExecutePrompt.d.ts +20 -0
- package/lib/prompts/AgenticaExecutePrompt.js +24 -0
- package/lib/prompts/AgenticaExecutePrompt.js.map +1 -0
- package/lib/prompts/AgenticaPrompt.d.ts +7 -0
- package/lib/{typings/AgenticaSource.js → prompts/AgenticaPrompt.js} +1 -1
- package/lib/prompts/AgenticaPrompt.js.map +1 -0
- package/lib/prompts/AgenticaPromptBase.d.ts +22 -0
- package/lib/prompts/AgenticaPromptBase.js +22 -0
- package/lib/prompts/AgenticaPromptBase.js.map +1 -0
- package/lib/prompts/AgenticaSelectPrompt.d.ts +16 -0
- package/lib/prompts/AgenticaSelectPrompt.js +20 -0
- package/lib/prompts/AgenticaSelectPrompt.js.map +1 -0
- package/lib/prompts/AgenticaTextPrompt.d.ts +14 -0
- package/lib/prompts/AgenticaTextPrompt.js +20 -0
- package/lib/prompts/AgenticaTextPrompt.js.map +1 -0
- package/lib/structures/IAgenticaConfig.d.ts +3 -3
- package/lib/structures/IAgenticaExecutor.d.ts +12 -11
- package/lib/structures/IAgenticaProps.d.ts +2 -3
- package/lib/structures/IAgenticaSystemPrompt.d.ts +12 -11
- package/lib/transformers/AgenticaEventTransformer.d.ts +45 -0
- package/lib/transformers/AgenticaEventTransformer.js +127 -0
- package/lib/transformers/AgenticaEventTransformer.js.map +1 -0
- package/lib/transformers/AgenticaPromptTransformer.d.ts +34 -0
- package/lib/transformers/AgenticaPromptTransformer.js +90 -0
- package/lib/transformers/AgenticaPromptTransformer.js.map +1 -0
- package/package.json +1 -1
- package/src/Agentica.ts +93 -63
- package/src/chatgpt/ChatGptAgent.ts +8 -7
- package/src/chatgpt/ChatGptCallFunctionAgent.ts +90 -88
- package/src/chatgpt/ChatGptCancelFunctionAgent.ts +51 -58
- package/src/chatgpt/ChatGptCompletionMessageUtil.ts +166 -0
- package/src/chatgpt/ChatGptDescribeFunctionAgent.ts +81 -12
- package/src/chatgpt/ChatGptHistoryDecoder.ts +14 -14
- package/src/chatgpt/ChatGptInitializeFunctionAgent.ts +21 -13
- package/src/chatgpt/ChatGptSelectFunctionAgent.ts +66 -74
- package/src/chatgpt/ChatGptUsageAggregator.ts +62 -0
- package/src/context/AgenticaCancelPrompt.ts +32 -0
- package/src/context/AgenticaClassOperation.ts +23 -0
- package/src/{structures/IAgenticaContext.ts → context/AgenticaContext.ts} +17 -16
- package/src/context/AgenticaHttpOperation.ts +27 -0
- package/src/{structures/IAgenticaOperation.ts → context/AgenticaOperation.ts} +25 -22
- package/src/context/AgenticaOperationBase.ts +57 -0
- package/src/{structures/IAgenticaOperationCollection.ts → context/AgenticaOperationCollection.ts} +6 -6
- package/src/context/AgenticaOperationSelection.ts +27 -0
- package/src/context/AgenticaTokenUsage.ts +170 -0
- package/src/context/internal/AgenticaTokenUsageAggregator.ts +66 -0
- package/src/events/AgenticaCallEvent.ts +36 -0
- package/src/events/AgenticaCancelEvent.ts +28 -0
- package/src/events/AgenticaDescribeEvent.ts +61 -0
- package/src/events/AgenticaEvent.ts +36 -0
- package/src/events/AgenticaEventBase.ts +7 -0
- package/src/{typings/AgenticaSource.ts → events/AgenticaEventSource.ts} +1 -1
- package/src/events/AgenticaExecuteEvent.ts +50 -0
- package/src/events/AgenticaInitializeEvent.ts +14 -0
- package/src/events/AgenticaRequestEvent.ts +45 -0
- package/src/events/AgenticaResponseEvent.ts +48 -0
- package/src/events/AgenticaSelectEvent.ts +37 -0
- package/src/events/AgenticaTextEvent.ts +57 -0
- package/src/index.ts +33 -9
- package/src/internal/AgenticaOperationComposer.ts +24 -15
- package/src/internal/ByteArrayUtil.ts +5 -0
- package/src/internal/MPSCUtil.ts +75 -0
- package/src/internal/StreamUtil.ts +64 -0
- package/src/json/IAgenticaEventJson.ts +178 -0
- package/src/json/IAgenticaOperationJson.ts +36 -0
- package/src/json/IAgenticaOperationSelectionJson.ts +19 -0
- package/src/json/IAgenticaPromptJson.ts +130 -0
- package/src/{structures/IAgenticaTokenUsage.ts → json/IAgenticaTokenUsageJson.ts} +10 -10
- package/src/prompts/AgenticaCancelPrompt.ts +32 -0
- package/src/prompts/AgenticaDescribePrompt.ts +41 -0
- package/src/prompts/AgenticaExecutePrompt.ts +52 -0
- package/src/prompts/AgenticaPrompt.ts +14 -0
- package/src/prompts/AgenticaPromptBase.ts +27 -0
- package/src/prompts/AgenticaSelectPrompt.ts +32 -0
- package/src/prompts/AgenticaTextPrompt.ts +31 -0
- package/src/structures/IAgenticaConfig.ts +3 -3
- package/src/structures/IAgenticaExecutor.ts +14 -13
- package/src/structures/IAgenticaProps.ts +2 -3
- package/src/structures/IAgenticaSystemPrompt.ts +12 -11
- package/src/transformers/AgenticaEventTransformer.ts +165 -0
- package/src/transformers/AgenticaPromptTransformer.ts +134 -0
- package/lib/internal/AgenticaPromptFactory.d.ts +0 -7
- package/lib/internal/AgenticaPromptFactory.js +0 -9
- package/lib/internal/AgenticaPromptFactory.js.map +0 -1
- package/lib/internal/AgenticaPromptTransformer.d.ts +0 -10
- package/lib/internal/AgenticaPromptTransformer.js +0 -58
- package/lib/internal/AgenticaPromptTransformer.js.map +0 -1
- package/lib/internal/AgenticaTokenUsageAggregator.d.ts +0 -11
- package/lib/internal/AgenticaTokenUsageAggregator.js.map +0 -1
- package/lib/structures/IAgenticaContext.js.map +0 -1
- package/lib/structures/IAgenticaEvent.d.ts +0 -192
- package/lib/structures/IAgenticaEvent.js.map +0 -1
- package/lib/structures/IAgenticaOperation.d.ts +0 -47
- package/lib/structures/IAgenticaOperation.js.map +0 -1
- package/lib/structures/IAgenticaOperationCollection.js.map +0 -1
- package/lib/structures/IAgenticaOperationSelection.d.ts +0 -50
- package/lib/structures/IAgenticaOperationSelection.js.map +0 -1
- package/lib/structures/IAgenticaPrompt.d.ts +0 -138
- package/lib/structures/IAgenticaPrompt.js.map +0 -1
- package/lib/structures/IAgenticaTokenUsage.js +0 -3
- package/lib/structures/IAgenticaTokenUsage.js.map +0 -1
- package/lib/structures/internal/__IChatCancelFunctionsApplication.js.map +0 -1
- package/lib/structures/internal/__IChatFunctionReference.js.map +0 -1
- package/lib/structures/internal/__IChatInitialApplication.js.map +0 -1
- package/lib/structures/internal/__IChatSelectFunctionsApplication.js.map +0 -1
- package/lib/typings/AgenticaSource.d.ts +0 -1
- package/lib/typings/AgenticaSource.js.map +0 -1
- package/src/internal/AgenticaPromptFactory.ts +0 -32
- package/src/internal/AgenticaPromptTransformer.ts +0 -86
- package/src/internal/AgenticaTokenUsageAggregator.ts +0 -121
- package/src/structures/IAgenticaEvent.ts +0 -229
- package/src/structures/IAgenticaOperationSelection.ts +0 -68
- package/src/structures/IAgenticaPrompt.ts +0 -182
- /package/lib/{structures → context}/internal/__IChatCancelFunctionsApplication.d.ts +0 -0
- /package/lib/{structures → context}/internal/__IChatCancelFunctionsApplication.js +0 -0
- /package/lib/{structures → context}/internal/__IChatFunctionReference.d.ts +0 -0
- /package/lib/{structures → context}/internal/__IChatFunctionReference.js +0 -0
- /package/lib/{structures → context}/internal/__IChatInitialApplication.d.ts +0 -0
- /package/lib/{structures → context}/internal/__IChatInitialApplication.js +0 -0
- /package/lib/{structures → context}/internal/__IChatSelectFunctionsApplication.d.ts +0 -0
- /package/lib/{structures → context}/internal/__IChatSelectFunctionsApplication.js +0 -0
- /package/src/{structures → context}/internal/__IChatCancelFunctionsApplication.ts +0 -0
- /package/src/{structures → context}/internal/__IChatFunctionReference.ts +0 -0
- /package/src/{structures → context}/internal/__IChatInitialApplication.ts +0 -0
- /package/src/{structures → context}/internal/__IChatSelectFunctionsApplication.ts +0 -0
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ChatGptCompletionMessageUtil = void 0;
|
|
37
|
+
const __typia_transform__assertGuard = __importStar(require("typia/lib/internal/_assertGuard.js"));
|
|
38
|
+
const typia_1 = require("typia");
|
|
39
|
+
const ByteArrayUtil_1 = require("../internal/ByteArrayUtil");
|
|
40
|
+
const ChatGptUsageAggregator_1 = require("./ChatGptUsageAggregator");
|
|
41
|
+
var ChatGptCompletionMessageUtil;
|
|
42
|
+
(function (ChatGptCompletionMessageUtil) {
|
|
43
|
+
ChatGptCompletionMessageUtil.transformCompletionChunk = (source) => {
|
|
44
|
+
const str = source instanceof Uint8Array ? ByteArrayUtil_1.ByteArrayUtil.toUtf8(source) : source;
|
|
45
|
+
return (() => { const _io0 = input => "string" === typeof input.id && (Array.isArray(input.choices) && input.choices.every(elem => "object" === typeof elem && null !== elem && _io1(elem))) && "number" === typeof input.created && "string" === typeof input.model && "chat.completion.chunk" === input.object && (null === input.service_tier || undefined === input.service_tier || "scale" === input.service_tier || "default" === input.service_tier) && (undefined === input.system_fingerprint || "string" === typeof input.system_fingerprint) && (null === input.usage || undefined === input.usage || "object" === typeof input.usage && null !== input.usage && _io9(input.usage)); const _io1 = input => "object" === typeof input.delta && null !== input.delta && false === Array.isArray(input.delta) && _io2(input.delta) && (null === input.finish_reason || "function_call" === input.finish_reason || "stop" === input.finish_reason || "length" === input.finish_reason || "tool_calls" === input.finish_reason || "content_filter" === input.finish_reason) && "number" === typeof input.index && (null === input.logprobs || undefined === input.logprobs || "object" === typeof input.logprobs && null !== input.logprobs && _io6(input.logprobs)); const _io2 = input => (null === input.content || undefined === input.content || "string" === typeof input.content) && (undefined === input.function_call || "object" === typeof input.function_call && null !== input.function_call && false === Array.isArray(input.function_call) && _io3(input.function_call)) && (null === input.refusal || undefined === input.refusal || "string" === typeof input.refusal) && (undefined === input.role || "assistant" === input.role || "user" === input.role || "developer" === input.role || "system" === input.role || "tool" === input.role) && (undefined === input.tool_calls || Array.isArray(input.tool_calls) && input.tool_calls.every(elem => "object" === typeof elem && null !== elem && _io4(elem))); const _io3 = input => (undefined === input.arguments || "string" === typeof input.arguments) && (undefined === input.name || "string" === typeof input.name); const _io4 = input => "number" === typeof input.index && (undefined === input.id || "string" === typeof input.id) && (undefined === input["function"] || "object" === typeof input["function"] && null !== input["function"] && false === Array.isArray(input["function"]) && _io5(input["function"])) && (undefined === input.type || "function" === input.type); const _io5 = input => (undefined === input.arguments || "string" === typeof input.arguments) && (undefined === input.name || "string" === typeof input.name); const _io6 = input => (null === input.content || Array.isArray(input.content) && input.content.every(elem => "object" === typeof elem && null !== elem && _io7(elem))) && (null === input.refusal || Array.isArray(input.refusal) && input.refusal.every(elem => "object" === typeof elem && null !== elem && _io7(elem))); const _io7 = input => "string" === typeof input.token && (null === input.bytes || Array.isArray(input.bytes) && input.bytes.every(elem => "number" === typeof elem)) && "number" === typeof input.logprob && (Array.isArray(input.top_logprobs) && input.top_logprobs.every(elem => "object" === typeof elem && null !== elem && _io8(elem))); const _io8 = input => "string" === typeof input.token && (null === input.bytes || Array.isArray(input.bytes) && input.bytes.every(elem => "number" === typeof elem)) && "number" === typeof input.logprob; const _io9 = input => "number" === typeof input.completion_tokens && "number" === typeof input.prompt_tokens && "number" === typeof input.total_tokens && (undefined === input.completion_tokens_details || "object" === typeof input.completion_tokens_details && null !== input.completion_tokens_details && false === Array.isArray(input.completion_tokens_details) && _io10(input.completion_tokens_details)) && (undefined === input.prompt_tokens_details || "object" === typeof input.prompt_tokens_details && null !== input.prompt_tokens_details && false === Array.isArray(input.prompt_tokens_details) && _io11(input.prompt_tokens_details)); const _io10 = input => (undefined === input.accepted_prediction_tokens || "number" === typeof input.accepted_prediction_tokens) && (undefined === input.audio_tokens || "number" === typeof input.audio_tokens) && (undefined === input.reasoning_tokens || "number" === typeof input.reasoning_tokens) && (undefined === input.rejected_prediction_tokens || "number" === typeof input.rejected_prediction_tokens); const _io11 = input => (undefined === input.audio_tokens || "number" === typeof input.audio_tokens) && (undefined === input.cached_tokens || "number" === typeof input.cached_tokens); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
46
|
+
method: "json.assertParse",
|
|
47
|
+
path: _path + ".id",
|
|
48
|
+
expected: "string",
|
|
49
|
+
value: input.id
|
|
50
|
+
}, _errorFactory)) && ((Array.isArray(input.choices) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
51
|
+
method: "json.assertParse",
|
|
52
|
+
path: _path + ".choices",
|
|
53
|
+
expected: "Array<ChatCompletionChunk.Choice>",
|
|
54
|
+
value: input.choices
|
|
55
|
+
}, _errorFactory)) && input.choices.every((elem, _index8) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
56
|
+
method: "json.assertParse",
|
|
57
|
+
path: _path + ".choices[" + _index8 + "]",
|
|
58
|
+
expected: "ChatCompletionChunk.Choice",
|
|
59
|
+
value: elem
|
|
60
|
+
}, _errorFactory)) && _ao1(elem, _path + ".choices[" + _index8 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
61
|
+
method: "json.assertParse",
|
|
62
|
+
path: _path + ".choices[" + _index8 + "]",
|
|
63
|
+
expected: "ChatCompletionChunk.Choice",
|
|
64
|
+
value: elem
|
|
65
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
66
|
+
method: "json.assertParse",
|
|
67
|
+
path: _path + ".choices",
|
|
68
|
+
expected: "Array<ChatCompletionChunk.Choice>",
|
|
69
|
+
value: input.choices
|
|
70
|
+
}, _errorFactory)) && ("number" === typeof input.created || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
71
|
+
method: "json.assertParse",
|
|
72
|
+
path: _path + ".created",
|
|
73
|
+
expected: "number",
|
|
74
|
+
value: input.created
|
|
75
|
+
}, _errorFactory)) && ("string" === typeof input.model || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
76
|
+
method: "json.assertParse",
|
|
77
|
+
path: _path + ".model",
|
|
78
|
+
expected: "string",
|
|
79
|
+
value: input.model
|
|
80
|
+
}, _errorFactory)) && ("chat.completion.chunk" === input.object || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
81
|
+
method: "json.assertParse",
|
|
82
|
+
path: _path + ".object",
|
|
83
|
+
expected: "\"chat.completion.chunk\"",
|
|
84
|
+
value: input.object
|
|
85
|
+
}, _errorFactory)) && (null === input.service_tier || undefined === input.service_tier || "scale" === input.service_tier || "default" === input.service_tier || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
86
|
+
method: "json.assertParse",
|
|
87
|
+
path: _path + ".service_tier",
|
|
88
|
+
expected: "(\"default\" | \"scale\" | null | undefined)",
|
|
89
|
+
value: input.service_tier
|
|
90
|
+
}, _errorFactory)) && (undefined === input.system_fingerprint || "string" === typeof input.system_fingerprint || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
91
|
+
method: "json.assertParse",
|
|
92
|
+
path: _path + ".system_fingerprint",
|
|
93
|
+
expected: "(string | undefined)",
|
|
94
|
+
value: input.system_fingerprint
|
|
95
|
+
}, _errorFactory)) && (null === input.usage || undefined === input.usage || ("object" === typeof input.usage && null !== input.usage || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
96
|
+
method: "json.assertParse",
|
|
97
|
+
path: _path + ".usage",
|
|
98
|
+
expected: "(CompletionUsage | null | undefined)",
|
|
99
|
+
value: input.usage
|
|
100
|
+
}, _errorFactory)) && _ao9(input.usage, _path + ".usage", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
101
|
+
method: "json.assertParse",
|
|
102
|
+
path: _path + ".usage",
|
|
103
|
+
expected: "(CompletionUsage | null | undefined)",
|
|
104
|
+
value: input.usage
|
|
105
|
+
}, _errorFactory)); const _ao1 = (input, _path, _exceptionable = true) => (("object" === typeof input.delta && null !== input.delta && false === Array.isArray(input.delta) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
106
|
+
method: "json.assertParse",
|
|
107
|
+
path: _path + ".delta",
|
|
108
|
+
expected: "ChatCompletionChunk.Choice.Delta",
|
|
109
|
+
value: input.delta
|
|
110
|
+
}, _errorFactory)) && _ao2(input.delta, _path + ".delta", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
111
|
+
method: "json.assertParse",
|
|
112
|
+
path: _path + ".delta",
|
|
113
|
+
expected: "ChatCompletionChunk.Choice.Delta",
|
|
114
|
+
value: input.delta
|
|
115
|
+
}, _errorFactory)) && (null === input.finish_reason || "function_call" === input.finish_reason || "stop" === input.finish_reason || "length" === input.finish_reason || "tool_calls" === input.finish_reason || "content_filter" === input.finish_reason || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
116
|
+
method: "json.assertParse",
|
|
117
|
+
path: _path + ".finish_reason",
|
|
118
|
+
expected: "(\"content_filter\" | \"function_call\" | \"length\" | \"stop\" | \"tool_calls\" | null)",
|
|
119
|
+
value: input.finish_reason
|
|
120
|
+
}, _errorFactory)) && ("number" === typeof input.index || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
121
|
+
method: "json.assertParse",
|
|
122
|
+
path: _path + ".index",
|
|
123
|
+
expected: "number",
|
|
124
|
+
value: input.index
|
|
125
|
+
}, _errorFactory)) && (null === input.logprobs || undefined === input.logprobs || ("object" === typeof input.logprobs && null !== input.logprobs || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
126
|
+
method: "json.assertParse",
|
|
127
|
+
path: _path + ".logprobs",
|
|
128
|
+
expected: "(ChatCompletionChunk.Choice.Logprobs | null | undefined)",
|
|
129
|
+
value: input.logprobs
|
|
130
|
+
}, _errorFactory)) && _ao6(input.logprobs, _path + ".logprobs", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
131
|
+
method: "json.assertParse",
|
|
132
|
+
path: _path + ".logprobs",
|
|
133
|
+
expected: "(ChatCompletionChunk.Choice.Logprobs | null | undefined)",
|
|
134
|
+
value: input.logprobs
|
|
135
|
+
}, _errorFactory)); const _ao2 = (input, _path, _exceptionable = true) => (null === input.content || undefined === input.content || "string" === typeof input.content || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
136
|
+
method: "json.assertParse",
|
|
137
|
+
path: _path + ".content",
|
|
138
|
+
expected: "(null | string | undefined)",
|
|
139
|
+
value: input.content
|
|
140
|
+
}, _errorFactory)) && (undefined === input.function_call || ("object" === typeof input.function_call && null !== input.function_call && false === Array.isArray(input.function_call) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
141
|
+
method: "json.assertParse",
|
|
142
|
+
path: _path + ".function_call",
|
|
143
|
+
expected: "(ChatCompletionChunk.Choice.Delta.FunctionCall | undefined)",
|
|
144
|
+
value: input.function_call
|
|
145
|
+
}, _errorFactory)) && _ao3(input.function_call, _path + ".function_call", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
146
|
+
method: "json.assertParse",
|
|
147
|
+
path: _path + ".function_call",
|
|
148
|
+
expected: "(ChatCompletionChunk.Choice.Delta.FunctionCall | undefined)",
|
|
149
|
+
value: input.function_call
|
|
150
|
+
}, _errorFactory)) && (null === input.refusal || undefined === input.refusal || "string" === typeof input.refusal || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
151
|
+
method: "json.assertParse",
|
|
152
|
+
path: _path + ".refusal",
|
|
153
|
+
expected: "(null | string | undefined)",
|
|
154
|
+
value: input.refusal
|
|
155
|
+
}, _errorFactory)) && (undefined === input.role || "assistant" === input.role || "user" === input.role || "developer" === input.role || "system" === input.role || "tool" === input.role || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
156
|
+
method: "json.assertParse",
|
|
157
|
+
path: _path + ".role",
|
|
158
|
+
expected: "(\"assistant\" | \"developer\" | \"system\" | \"tool\" | \"user\" | undefined)",
|
|
159
|
+
value: input.role
|
|
160
|
+
}, _errorFactory)) && (undefined === input.tool_calls || (Array.isArray(input.tool_calls) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
161
|
+
method: "json.assertParse",
|
|
162
|
+
path: _path + ".tool_calls",
|
|
163
|
+
expected: "(Array<ChatCompletionChunk.Choice.Delta.ToolCall> | undefined)",
|
|
164
|
+
value: input.tool_calls
|
|
165
|
+
}, _errorFactory)) && input.tool_calls.every((elem, _index9) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
166
|
+
method: "json.assertParse",
|
|
167
|
+
path: _path + ".tool_calls[" + _index9 + "]",
|
|
168
|
+
expected: "ChatCompletionChunk.Choice.Delta.ToolCall",
|
|
169
|
+
value: elem
|
|
170
|
+
}, _errorFactory)) && _ao4(elem, _path + ".tool_calls[" + _index9 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
171
|
+
method: "json.assertParse",
|
|
172
|
+
path: _path + ".tool_calls[" + _index9 + "]",
|
|
173
|
+
expected: "ChatCompletionChunk.Choice.Delta.ToolCall",
|
|
174
|
+
value: elem
|
|
175
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
176
|
+
method: "json.assertParse",
|
|
177
|
+
path: _path + ".tool_calls",
|
|
178
|
+
expected: "(Array<ChatCompletionChunk.Choice.Delta.ToolCall> | undefined)",
|
|
179
|
+
value: input.tool_calls
|
|
180
|
+
}, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => (undefined === input.arguments || "string" === typeof input.arguments || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
181
|
+
method: "json.assertParse",
|
|
182
|
+
path: _path + ".arguments",
|
|
183
|
+
expected: "(string | undefined)",
|
|
184
|
+
value: input.arguments
|
|
185
|
+
}, _errorFactory)) && (undefined === input.name || "string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
186
|
+
method: "json.assertParse",
|
|
187
|
+
path: _path + ".name",
|
|
188
|
+
expected: "(string | undefined)",
|
|
189
|
+
value: input.name
|
|
190
|
+
}, _errorFactory)); const _ao4 = (input, _path, _exceptionable = true) => ("number" === typeof input.index || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
191
|
+
method: "json.assertParse",
|
|
192
|
+
path: _path + ".index",
|
|
193
|
+
expected: "number",
|
|
194
|
+
value: input.index
|
|
195
|
+
}, _errorFactory)) && (undefined === input.id || "string" === typeof input.id || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
196
|
+
method: "json.assertParse",
|
|
197
|
+
path: _path + ".id",
|
|
198
|
+
expected: "(string | undefined)",
|
|
199
|
+
value: input.id
|
|
200
|
+
}, _errorFactory)) && (undefined === input["function"] || ("object" === typeof input["function"] && null !== input["function"] && false === Array.isArray(input["function"]) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
201
|
+
method: "json.assertParse",
|
|
202
|
+
path: _path + "[\"function\"]",
|
|
203
|
+
expected: "(ChatCompletionChunk.Choice.Delta.ToolCall.Function | undefined)",
|
|
204
|
+
value: input["function"]
|
|
205
|
+
}, _errorFactory)) && _ao5(input["function"], _path + "[\"function\"]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
206
|
+
method: "json.assertParse",
|
|
207
|
+
path: _path + "[\"function\"]",
|
|
208
|
+
expected: "(ChatCompletionChunk.Choice.Delta.ToolCall.Function | undefined)",
|
|
209
|
+
value: input["function"]
|
|
210
|
+
}, _errorFactory)) && (undefined === input.type || "function" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
211
|
+
method: "json.assertParse",
|
|
212
|
+
path: _path + ".type",
|
|
213
|
+
expected: "(\"function\" | undefined)",
|
|
214
|
+
value: input.type
|
|
215
|
+
}, _errorFactory)); const _ao5 = (input, _path, _exceptionable = true) => (undefined === input.arguments || "string" === typeof input.arguments || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
216
|
+
method: "json.assertParse",
|
|
217
|
+
path: _path + ".arguments",
|
|
218
|
+
expected: "(string | undefined)",
|
|
219
|
+
value: input.arguments
|
|
220
|
+
}, _errorFactory)) && (undefined === input.name || "string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
221
|
+
method: "json.assertParse",
|
|
222
|
+
path: _path + ".name",
|
|
223
|
+
expected: "(string | undefined)",
|
|
224
|
+
value: input.name
|
|
225
|
+
}, _errorFactory)); const _ao6 = (input, _path, _exceptionable = true) => (null === input.content || (Array.isArray(input.content) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
226
|
+
method: "json.assertParse",
|
|
227
|
+
path: _path + ".content",
|
|
228
|
+
expected: "(Array<ChatCompletionTokenLogprob> | null)",
|
|
229
|
+
value: input.content
|
|
230
|
+
}, _errorFactory)) && input.content.every((elem, _index10) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
231
|
+
method: "json.assertParse",
|
|
232
|
+
path: _path + ".content[" + _index10 + "]",
|
|
233
|
+
expected: "ChatCompletionTokenLogprob",
|
|
234
|
+
value: elem
|
|
235
|
+
}, _errorFactory)) && _ao7(elem, _path + ".content[" + _index10 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
236
|
+
method: "json.assertParse",
|
|
237
|
+
path: _path + ".content[" + _index10 + "]",
|
|
238
|
+
expected: "ChatCompletionTokenLogprob",
|
|
239
|
+
value: elem
|
|
240
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
241
|
+
method: "json.assertParse",
|
|
242
|
+
path: _path + ".content",
|
|
243
|
+
expected: "(Array<ChatCompletionTokenLogprob> | null)",
|
|
244
|
+
value: input.content
|
|
245
|
+
}, _errorFactory)) && (null === input.refusal || (Array.isArray(input.refusal) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
246
|
+
method: "json.assertParse",
|
|
247
|
+
path: _path + ".refusal",
|
|
248
|
+
expected: "(Array<ChatCompletionTokenLogprob> | null)",
|
|
249
|
+
value: input.refusal
|
|
250
|
+
}, _errorFactory)) && input.refusal.every((elem, _index11) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
251
|
+
method: "json.assertParse",
|
|
252
|
+
path: _path + ".refusal[" + _index11 + "]",
|
|
253
|
+
expected: "ChatCompletionTokenLogprob",
|
|
254
|
+
value: elem
|
|
255
|
+
}, _errorFactory)) && _ao7(elem, _path + ".refusal[" + _index11 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
256
|
+
method: "json.assertParse",
|
|
257
|
+
path: _path + ".refusal[" + _index11 + "]",
|
|
258
|
+
expected: "ChatCompletionTokenLogprob",
|
|
259
|
+
value: elem
|
|
260
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
261
|
+
method: "json.assertParse",
|
|
262
|
+
path: _path + ".refusal",
|
|
263
|
+
expected: "(Array<ChatCompletionTokenLogprob> | null)",
|
|
264
|
+
value: input.refusal
|
|
265
|
+
}, _errorFactory)); const _ao7 = (input, _path, _exceptionable = true) => ("string" === typeof input.token || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
266
|
+
method: "json.assertParse",
|
|
267
|
+
path: _path + ".token",
|
|
268
|
+
expected: "string",
|
|
269
|
+
value: input.token
|
|
270
|
+
}, _errorFactory)) && (null === input.bytes || (Array.isArray(input.bytes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
271
|
+
method: "json.assertParse",
|
|
272
|
+
path: _path + ".bytes",
|
|
273
|
+
expected: "(Array<number> | null)",
|
|
274
|
+
value: input.bytes
|
|
275
|
+
}, _errorFactory)) && input.bytes.every((elem, _index12) => "number" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
276
|
+
method: "json.assertParse",
|
|
277
|
+
path: _path + ".bytes[" + _index12 + "]",
|
|
278
|
+
expected: "number",
|
|
279
|
+
value: elem
|
|
280
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
281
|
+
method: "json.assertParse",
|
|
282
|
+
path: _path + ".bytes",
|
|
283
|
+
expected: "(Array<number> | null)",
|
|
284
|
+
value: input.bytes
|
|
285
|
+
}, _errorFactory)) && ("number" === typeof input.logprob || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
286
|
+
method: "json.assertParse",
|
|
287
|
+
path: _path + ".logprob",
|
|
288
|
+
expected: "number",
|
|
289
|
+
value: input.logprob
|
|
290
|
+
}, _errorFactory)) && ((Array.isArray(input.top_logprobs) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
291
|
+
method: "json.assertParse",
|
|
292
|
+
path: _path + ".top_logprobs",
|
|
293
|
+
expected: "Array<ChatCompletionTokenLogprob.TopLogprob>",
|
|
294
|
+
value: input.top_logprobs
|
|
295
|
+
}, _errorFactory)) && input.top_logprobs.every((elem, _index13) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
296
|
+
method: "json.assertParse",
|
|
297
|
+
path: _path + ".top_logprobs[" + _index13 + "]",
|
|
298
|
+
expected: "ChatCompletionTokenLogprob.TopLogprob",
|
|
299
|
+
value: elem
|
|
300
|
+
}, _errorFactory)) && _ao8(elem, _path + ".top_logprobs[" + _index13 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
301
|
+
method: "json.assertParse",
|
|
302
|
+
path: _path + ".top_logprobs[" + _index13 + "]",
|
|
303
|
+
expected: "ChatCompletionTokenLogprob.TopLogprob",
|
|
304
|
+
value: elem
|
|
305
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
306
|
+
method: "json.assertParse",
|
|
307
|
+
path: _path + ".top_logprobs",
|
|
308
|
+
expected: "Array<ChatCompletionTokenLogprob.TopLogprob>",
|
|
309
|
+
value: input.top_logprobs
|
|
310
|
+
}, _errorFactory)); const _ao8 = (input, _path, _exceptionable = true) => ("string" === typeof input.token || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
311
|
+
method: "json.assertParse",
|
|
312
|
+
path: _path + ".token",
|
|
313
|
+
expected: "string",
|
|
314
|
+
value: input.token
|
|
315
|
+
}, _errorFactory)) && (null === input.bytes || (Array.isArray(input.bytes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
316
|
+
method: "json.assertParse",
|
|
317
|
+
path: _path + ".bytes",
|
|
318
|
+
expected: "(Array<number> | null)",
|
|
319
|
+
value: input.bytes
|
|
320
|
+
}, _errorFactory)) && input.bytes.every((elem, _index14) => "number" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
321
|
+
method: "json.assertParse",
|
|
322
|
+
path: _path + ".bytes[" + _index14 + "]",
|
|
323
|
+
expected: "number",
|
|
324
|
+
value: elem
|
|
325
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
326
|
+
method: "json.assertParse",
|
|
327
|
+
path: _path + ".bytes",
|
|
328
|
+
expected: "(Array<number> | null)",
|
|
329
|
+
value: input.bytes
|
|
330
|
+
}, _errorFactory)) && ("number" === typeof input.logprob || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
331
|
+
method: "json.assertParse",
|
|
332
|
+
path: _path + ".logprob",
|
|
333
|
+
expected: "number",
|
|
334
|
+
value: input.logprob
|
|
335
|
+
}, _errorFactory)); const _ao9 = (input, _path, _exceptionable = true) => ("number" === typeof input.completion_tokens || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
336
|
+
method: "json.assertParse",
|
|
337
|
+
path: _path + ".completion_tokens",
|
|
338
|
+
expected: "number",
|
|
339
|
+
value: input.completion_tokens
|
|
340
|
+
}, _errorFactory)) && ("number" === typeof input.prompt_tokens || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
341
|
+
method: "json.assertParse",
|
|
342
|
+
path: _path + ".prompt_tokens",
|
|
343
|
+
expected: "number",
|
|
344
|
+
value: input.prompt_tokens
|
|
345
|
+
}, _errorFactory)) && ("number" === typeof input.total_tokens || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
346
|
+
method: "json.assertParse",
|
|
347
|
+
path: _path + ".total_tokens",
|
|
348
|
+
expected: "number",
|
|
349
|
+
value: input.total_tokens
|
|
350
|
+
}, _errorFactory)) && (undefined === input.completion_tokens_details || ("object" === typeof input.completion_tokens_details && null !== input.completion_tokens_details && false === Array.isArray(input.completion_tokens_details) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
351
|
+
method: "json.assertParse",
|
|
352
|
+
path: _path + ".completion_tokens_details",
|
|
353
|
+
expected: "(CompletionUsage.CompletionTokensDetails | undefined)",
|
|
354
|
+
value: input.completion_tokens_details
|
|
355
|
+
}, _errorFactory)) && _ao10(input.completion_tokens_details, _path + ".completion_tokens_details", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
356
|
+
method: "json.assertParse",
|
|
357
|
+
path: _path + ".completion_tokens_details",
|
|
358
|
+
expected: "(CompletionUsage.CompletionTokensDetails | undefined)",
|
|
359
|
+
value: input.completion_tokens_details
|
|
360
|
+
}, _errorFactory)) && (undefined === input.prompt_tokens_details || ("object" === typeof input.prompt_tokens_details && null !== input.prompt_tokens_details && false === Array.isArray(input.prompt_tokens_details) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
361
|
+
method: "json.assertParse",
|
|
362
|
+
path: _path + ".prompt_tokens_details",
|
|
363
|
+
expected: "(CompletionUsage.PromptTokensDetails | undefined)",
|
|
364
|
+
value: input.prompt_tokens_details
|
|
365
|
+
}, _errorFactory)) && _ao11(input.prompt_tokens_details, _path + ".prompt_tokens_details", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
366
|
+
method: "json.assertParse",
|
|
367
|
+
path: _path + ".prompt_tokens_details",
|
|
368
|
+
expected: "(CompletionUsage.PromptTokensDetails | undefined)",
|
|
369
|
+
value: input.prompt_tokens_details
|
|
370
|
+
}, _errorFactory)); const _ao10 = (input, _path, _exceptionable = true) => (undefined === input.accepted_prediction_tokens || "number" === typeof input.accepted_prediction_tokens || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
371
|
+
method: "json.assertParse",
|
|
372
|
+
path: _path + ".accepted_prediction_tokens",
|
|
373
|
+
expected: "(number | undefined)",
|
|
374
|
+
value: input.accepted_prediction_tokens
|
|
375
|
+
}, _errorFactory)) && (undefined === input.audio_tokens || "number" === typeof input.audio_tokens || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
376
|
+
method: "json.assertParse",
|
|
377
|
+
path: _path + ".audio_tokens",
|
|
378
|
+
expected: "(number | undefined)",
|
|
379
|
+
value: input.audio_tokens
|
|
380
|
+
}, _errorFactory)) && (undefined === input.reasoning_tokens || "number" === typeof input.reasoning_tokens || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
381
|
+
method: "json.assertParse",
|
|
382
|
+
path: _path + ".reasoning_tokens",
|
|
383
|
+
expected: "(number | undefined)",
|
|
384
|
+
value: input.reasoning_tokens
|
|
385
|
+
}, _errorFactory)) && (undefined === input.rejected_prediction_tokens || "number" === typeof input.rejected_prediction_tokens || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
386
|
+
method: "json.assertParse",
|
|
387
|
+
path: _path + ".rejected_prediction_tokens",
|
|
388
|
+
expected: "(number | undefined)",
|
|
389
|
+
value: input.rejected_prediction_tokens
|
|
390
|
+
}, _errorFactory)); const _ao11 = (input, _path, _exceptionable = true) => (undefined === input.audio_tokens || "number" === typeof input.audio_tokens || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
391
|
+
method: "json.assertParse",
|
|
392
|
+
path: _path + ".audio_tokens",
|
|
393
|
+
expected: "(number | undefined)",
|
|
394
|
+
value: input.audio_tokens
|
|
395
|
+
}, _errorFactory)) && (undefined === input.cached_tokens || "number" === typeof input.cached_tokens || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
396
|
+
method: "json.assertParse",
|
|
397
|
+
path: _path + ".cached_tokens",
|
|
398
|
+
expected: "(number | undefined)",
|
|
399
|
+
value: input.cached_tokens
|
|
400
|
+
}, _errorFactory)); const __is = input => "object" === typeof input && null !== input && _io0(input); let _errorFactory; const __assert = (input, errorFactory) => {
|
|
401
|
+
if (false === __is(input)) {
|
|
402
|
+
_errorFactory = errorFactory;
|
|
403
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __typia_transform__assertGuard._assertGuard(true, {
|
|
404
|
+
method: "json.assertParse",
|
|
405
|
+
path: _path + "",
|
|
406
|
+
expected: "ChatCompletionChunk",
|
|
407
|
+
value: input
|
|
408
|
+
}, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
409
|
+
method: "json.assertParse",
|
|
410
|
+
path: _path + "",
|
|
411
|
+
expected: "ChatCompletionChunk",
|
|
412
|
+
value: input
|
|
413
|
+
}, _errorFactory))(input, "$input", true);
|
|
414
|
+
}
|
|
415
|
+
return input;
|
|
416
|
+
}; return (input, errorFactory) => __assert(JSON.parse(input), errorFactory); })()(str);
|
|
417
|
+
};
|
|
418
|
+
ChatGptCompletionMessageUtil.accumulate = (origin, chunk) => {
|
|
419
|
+
const choices = origin.choices;
|
|
420
|
+
chunk.choices.forEach((choice) => {
|
|
421
|
+
var _a, _b, _c, _d;
|
|
422
|
+
const accChoice = choices[choice.index];
|
|
423
|
+
if (accChoice) {
|
|
424
|
+
choices[choice.index] = ChatGptCompletionMessageUtil.mergeChoice(accChoice, choice);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
choices[choice.index] = {
|
|
428
|
+
index: choice.index,
|
|
429
|
+
finish_reason: (_a = choice.finish_reason) !== null && _a !== void 0 ? _a : null,
|
|
430
|
+
logprobs: (_b = choice.logprobs) !== null && _b !== void 0 ? _b : null,
|
|
431
|
+
message: {
|
|
432
|
+
tool_calls: choice.delta.tool_calls
|
|
433
|
+
? choice.delta.tool_calls.reduce((acc, cur) => {
|
|
434
|
+
var _a, _b, _c, _d, _e;
|
|
435
|
+
acc[cur.index] = {
|
|
436
|
+
id: (_a = cur.id) !== null && _a !== void 0 ? _a : "",
|
|
437
|
+
type: "function",
|
|
438
|
+
function: {
|
|
439
|
+
name: (_c = (_b = cur.function) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : "",
|
|
440
|
+
arguments: (_e = (_d = cur.function) === null || _d === void 0 ? void 0 : _d.arguments) !== null && _e !== void 0 ? _e : "",
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
return acc;
|
|
444
|
+
}, [])
|
|
445
|
+
: undefined,
|
|
446
|
+
content: (_c = choice.delta.content) !== null && _c !== void 0 ? _c : null,
|
|
447
|
+
refusal: (_d = choice.delta.refusal) !== null && _d !== void 0 ? _d : null,
|
|
448
|
+
role: "assistant",
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
});
|
|
452
|
+
const usage = (() => {
|
|
453
|
+
if (!chunk.usage) {
|
|
454
|
+
return origin.usage;
|
|
455
|
+
}
|
|
456
|
+
if (!origin.usage) {
|
|
457
|
+
return chunk.usage;
|
|
458
|
+
}
|
|
459
|
+
return ChatGptUsageAggregator_1.ChatGptUsageAggregator.sum(origin.usage, chunk.usage);
|
|
460
|
+
})();
|
|
461
|
+
return Object.assign(Object.assign({}, origin), { choices,
|
|
462
|
+
usage });
|
|
463
|
+
};
|
|
464
|
+
ChatGptCompletionMessageUtil.merge = (chunks) => {
|
|
465
|
+
const firstChunk = chunks[0];
|
|
466
|
+
if (!firstChunk)
|
|
467
|
+
throw new Error("No chunks received");
|
|
468
|
+
return chunks.reduce(ChatGptCompletionMessageUtil.accumulate, {
|
|
469
|
+
id: firstChunk.id,
|
|
470
|
+
choices: [],
|
|
471
|
+
created: firstChunk.created,
|
|
472
|
+
model: firstChunk.model,
|
|
473
|
+
object: "chat.completion",
|
|
474
|
+
usage: undefined,
|
|
475
|
+
service_tier: firstChunk.service_tier,
|
|
476
|
+
system_fingerprint: firstChunk.system_fingerprint,
|
|
477
|
+
});
|
|
478
|
+
};
|
|
479
|
+
ChatGptCompletionMessageUtil.mergeChoice = (acc, cur) => {
|
|
480
|
+
var _a;
|
|
481
|
+
var _b;
|
|
482
|
+
if (!acc.finish_reason && cur.finish_reason) {
|
|
483
|
+
acc.finish_reason = cur.finish_reason;
|
|
484
|
+
}
|
|
485
|
+
if (!acc.logprobs && cur.logprobs) {
|
|
486
|
+
acc.logprobs = cur.logprobs;
|
|
487
|
+
}
|
|
488
|
+
if (cur.delta.content) {
|
|
489
|
+
if (!acc.message.content) {
|
|
490
|
+
acc.message.content = cur.delta.content;
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
acc.message.content += cur.delta.content;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
if (cur.delta.refusal) {
|
|
497
|
+
if (!acc.message.refusal) {
|
|
498
|
+
acc.message.refusal = cur.delta.refusal;
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
acc.message.refusal += cur.delta.refusal;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
if (cur.delta.tool_calls) {
|
|
505
|
+
(_a = (_b = acc.message).tool_calls) !== null && _a !== void 0 ? _a : (_b.tool_calls = []);
|
|
506
|
+
const toolCalls = acc.message.tool_calls;
|
|
507
|
+
cur.delta.tool_calls.forEach((toolCall) => {
|
|
508
|
+
var _a, _b, _c, _d, _e;
|
|
509
|
+
const existingToolCall = toolCalls[toolCall.index];
|
|
510
|
+
if (existingToolCall) {
|
|
511
|
+
toolCalls[toolCall.index] = ChatGptCompletionMessageUtil.mergeToolCalls(existingToolCall, toolCall);
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
toolCalls[toolCall.index] = {
|
|
515
|
+
id: (_a = toolCall.id) !== null && _a !== void 0 ? _a : "",
|
|
516
|
+
type: "function",
|
|
517
|
+
function: {
|
|
518
|
+
name: (_c = (_b = toolCall.function) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : "",
|
|
519
|
+
arguments: (_e = (_d = toolCall.function) === null || _d === void 0 ? void 0 : _d.arguments) !== null && _e !== void 0 ? _e : "",
|
|
520
|
+
},
|
|
521
|
+
};
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
return acc;
|
|
525
|
+
};
|
|
526
|
+
ChatGptCompletionMessageUtil.mergeToolCalls = (acc, cur) => {
|
|
527
|
+
var _a, _b, _c;
|
|
528
|
+
if (cur.function) {
|
|
529
|
+
acc.function.arguments += (_a = cur.function.arguments) !== null && _a !== void 0 ? _a : "";
|
|
530
|
+
acc.function.name += (_b = cur.function.name) !== null && _b !== void 0 ? _b : "";
|
|
531
|
+
}
|
|
532
|
+
acc.id += (_c = cur.id) !== null && _c !== void 0 ? _c : "";
|
|
533
|
+
return acc;
|
|
534
|
+
};
|
|
535
|
+
})(ChatGptCompletionMessageUtil || (exports.ChatGptCompletionMessageUtil = ChatGptCompletionMessageUtil = {}));
|
|
536
|
+
//# sourceMappingURL=ChatGptCompletionMessageUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatGptCompletionMessageUtil.js","sourceRoot":"","sources":["../../src/chatgpt/ChatGptCompletionMessageUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,iCAA6B;AAE7B,6DAA0D;AAC1D,qEAAkE;AAElE,IAAiB,4BAA4B,CA0J5C;AA1JD,WAAiB,4BAA4B;IAC9B,qDAAwB,GAAG,CACtC,MAA2B,EACN,EAAE;QACvB,MAAM,GAAG,GACP,MAAM,YAAY,UAAU,CAAC,CAAC,CAAC,6BAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC;AACJ,CAAC,EA1JgB,4BAA4B,4CAA5B,4BAA4B,QA0J5C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { AgenticaContext } from "../context/AgenticaContext";
|
|
3
|
+
import { AgenticaDescribePrompt } from "../prompts/AgenticaDescribePrompt";
|
|
4
|
+
import { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
4
5
|
export declare namespace ChatGptDescribeFunctionAgent {
|
|
5
|
-
const execute: <Model extends ILlmSchema.Model>(ctx:
|
|
6
|
+
const execute: <Model extends ILlmSchema.Model>(ctx: AgenticaContext<Model>, histories: AgenticaExecutePrompt<Model>[]) => Promise<AgenticaDescribePrompt<Model>[]>;
|
|
6
7
|
}
|