objectiveai 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +41 -2
- package/dist/index.d.ts +18335 -2974
- package/dist/index.js +41 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2480,6 +2480,18 @@ export var Function;
|
|
|
2480
2480
|
.optional()
|
|
2481
2481
|
.nullable()
|
|
2482
2482
|
.describe("The retry token provided by a previous incomplete or failed function execution."),
|
|
2483
|
+
reasoning: z
|
|
2484
|
+
.object({
|
|
2485
|
+
model: Chat.Completions.Request.ModelSchema,
|
|
2486
|
+
models: z
|
|
2487
|
+
.array(Chat.Completions.Request.ModelSchema)
|
|
2488
|
+
.optional()
|
|
2489
|
+
.nullable()
|
|
2490
|
+
.describe("Fallback Ensemble LLMs to use if the primary Ensemble LLM fails."),
|
|
2491
|
+
})
|
|
2492
|
+
.optional()
|
|
2493
|
+
.nullable()
|
|
2494
|
+
.describe("If provided, a reasoning summary for the Function Execution will be generated. This reasoning summary attempts to detail why the final Output is what it is, based on AI assertions made during execution."),
|
|
2483
2495
|
input: Function_1.InputSchema_,
|
|
2484
2496
|
provider: Chat.Completions.Request.ProviderSchema.optional().nullable(),
|
|
2485
2497
|
seed: Chat.Completions.Request.SeedSchema.optional().nullable(),
|
|
@@ -2705,12 +2717,33 @@ export var Function;
|
|
|
2705
2717
|
Streaming.TaskChunkSchema = z
|
|
2706
2718
|
.union([TaskChunk.FunctionSchema, TaskChunk.VectorCompletionSchema])
|
|
2707
2719
|
.describe("A chunk of a task execution.");
|
|
2720
|
+
let ReasoningSummaryChunk;
|
|
2721
|
+
(function (ReasoningSummaryChunk) {
|
|
2722
|
+
function merged(a, b) {
|
|
2723
|
+
const [base, baseChanged] = Chat.Completions.Response.Streaming.ChatCompletionChunk.merged(a, b);
|
|
2724
|
+
const [error, errorChanged] = merge(a.error, b.error);
|
|
2725
|
+
if (baseChanged || errorChanged) {
|
|
2726
|
+
return [
|
|
2727
|
+
Object.assign(Object.assign({}, base), (error !== undefined ? { error } : {})),
|
|
2728
|
+
true,
|
|
2729
|
+
];
|
|
2730
|
+
}
|
|
2731
|
+
else {
|
|
2732
|
+
return [a, false];
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
ReasoningSummaryChunk.merged = merged;
|
|
2736
|
+
})(ReasoningSummaryChunk = Streaming.ReasoningSummaryChunk || (Streaming.ReasoningSummaryChunk = {}));
|
|
2737
|
+
Streaming.ReasoningSummaryChunkSchema = Chat.Completions.Response.Streaming.ChatCompletionChunkSchema.extend({
|
|
2738
|
+
error: ObjectiveAIErrorSchema.optional().describe("When present, indicates that an error occurred during the chat completion."),
|
|
2739
|
+
}).describe("A chunk of a reasoning summary generation.");
|
|
2708
2740
|
let FunctionExecutionChunk;
|
|
2709
2741
|
(function (FunctionExecutionChunk) {
|
|
2710
2742
|
function merged(a, b) {
|
|
2711
2743
|
const id = a.id;
|
|
2712
2744
|
const [tasks, tasksChanged] = TaskChunk.mergedList(a.tasks, b.tasks);
|
|
2713
2745
|
const [tasks_errors, tasks_errorsChanged] = merge(a.tasks_errors, b.tasks_errors);
|
|
2746
|
+
const [reasoning, reasoningChanged] = merge(a.reasoning, b.reasoning);
|
|
2714
2747
|
const [output, outputChanged] = merge(a.output, b.output);
|
|
2715
2748
|
const [error, errorChanged] = merge(a.error, b.error);
|
|
2716
2749
|
const [retry_token, retry_tokenChanged] = merge(a.retry_token, b.retry_token);
|
|
@@ -2721,13 +2754,14 @@ export var Function;
|
|
|
2721
2754
|
const [usage, usageChanged] = merge(a.usage, b.usage);
|
|
2722
2755
|
if (tasksChanged ||
|
|
2723
2756
|
tasks_errorsChanged ||
|
|
2757
|
+
reasoningChanged ||
|
|
2724
2758
|
outputChanged ||
|
|
2725
2759
|
errorChanged ||
|
|
2726
2760
|
retry_tokenChanged ||
|
|
2727
2761
|
usageChanged) {
|
|
2728
2762
|
return [
|
|
2729
|
-
Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id,
|
|
2730
|
-
tasks }, (tasks_errors !== undefined ? { tasks_errors } : {})), (output !== undefined ? { output } : {})), (error !== undefined ? { error } : {})), (retry_token !== undefined ? { retry_token } : {})), { created, function: function_, profile,
|
|
2763
|
+
Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id,
|
|
2764
|
+
tasks }, (tasks_errors !== undefined ? { tasks_errors } : {})), (reasoning !== undefined ? { reasoning } : {})), (output !== undefined ? { output } : {})), (error !== undefined ? { error } : {})), (retry_token !== undefined ? { retry_token } : {})), { created, function: function_, profile,
|
|
2731
2765
|
object }), (usage !== undefined ? { usage } : {})),
|
|
2732
2766
|
true,
|
|
2733
2767
|
];
|
|
@@ -2750,6 +2784,7 @@ export var Function;
|
|
|
2750
2784
|
.boolean()
|
|
2751
2785
|
.optional()
|
|
2752
2786
|
.describe("When true, indicates that one or more tasks encountered errors during execution."),
|
|
2787
|
+
reasoning: Streaming.ReasoningSummaryChunkSchema.optional(),
|
|
2753
2788
|
output: z
|
|
2754
2789
|
.union([
|
|
2755
2790
|
z
|
|
@@ -2816,6 +2851,9 @@ export var Function;
|
|
|
2816
2851
|
Unary.TaskSchema = z
|
|
2817
2852
|
.union([Task.FunctionSchema, Task.VectorCompletionSchema])
|
|
2818
2853
|
.describe("A task execution.");
|
|
2854
|
+
Unary.ReasoningSummarySchema = Chat.Completions.Response.Unary.ChatCompletionSchema.extend({
|
|
2855
|
+
error: ObjectiveAIErrorSchema.nullable().describe("When non-null, indicates that an error occurred during the chat completion."),
|
|
2856
|
+
}).describe("A reasoning summary generation.");
|
|
2819
2857
|
Unary.FunctionExecutionSchema = z
|
|
2820
2858
|
.object({
|
|
2821
2859
|
id: z
|
|
@@ -2827,6 +2865,7 @@ export var Function;
|
|
|
2827
2865
|
tasks_errors: z
|
|
2828
2866
|
.boolean()
|
|
2829
2867
|
.describe("When true, indicates that one or more tasks encountered errors during execution."),
|
|
2868
|
+
reasoning: Unary.ReasoningSummarySchema.nullable(),
|
|
2830
2869
|
output: z
|
|
2831
2870
|
.union([
|
|
2832
2871
|
z
|