objectiveai 1.2.1 → 1.2.2
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 +192 -349
- package/dist/index.d.ts +11357 -15873
- package/dist/index.js +192 -349
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2113,62 +2113,53 @@ var Function;
|
|
|
2113
2113
|
profile: Vector.Completions.Request.ProfileSchema,
|
|
2114
2114
|
})
|
|
2115
2115
|
.describe("A vector completion profile containing an Ensemble and array of weights.");
|
|
2116
|
-
Function_1.
|
|
2116
|
+
Function_1.FunctionProfileCommitRequiredSchema = zod_1.default
|
|
2117
2117
|
.union([
|
|
2118
2118
|
zod_1.default.object({
|
|
2119
|
-
|
|
2119
|
+
owner: zod_1.default
|
|
2120
2120
|
.string()
|
|
2121
|
-
.describe("The
|
|
2122
|
-
|
|
2121
|
+
.describe("The owner of the GitHub repository containing the profile."),
|
|
2122
|
+
repository: zod_1.default
|
|
2123
2123
|
.string()
|
|
2124
|
-
.describe("The
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2124
|
+
.describe("The name of the GitHub repository containing the profile."),
|
|
2125
|
+
commit: zod_1.default
|
|
2126
|
+
.string()
|
|
2127
|
+
.describe("The commit SHA of the GitHub repository containing the profile."),
|
|
2128
2128
|
}),
|
|
2129
|
-
zod_1.default.lazy(() => zod_1.default.array(Function_1.
|
|
2130
|
-
title: "
|
|
2129
|
+
zod_1.default.lazy(() => zod_1.default.array(Function_1.ProfileCommitRequiredSchema).meta({
|
|
2130
|
+
title: "ProfileCommitRequiredArray",
|
|
2131
2131
|
recursive: true,
|
|
2132
2132
|
})),
|
|
2133
2133
|
])
|
|
2134
|
-
.describe("A function profile where remote profiles must specify a
|
|
2135
|
-
Function_1.
|
|
2134
|
+
.describe("A function profile where remote profiles must specify a commit.");
|
|
2135
|
+
Function_1.FunctionProfileCommitOptionalSchema = zod_1.default
|
|
2136
2136
|
.union([
|
|
2137
2137
|
zod_1.default.object({
|
|
2138
|
-
|
|
2138
|
+
owner: zod_1.default
|
|
2139
2139
|
.string()
|
|
2140
|
-
.describe("The
|
|
2141
|
-
|
|
2140
|
+
.describe("The owner of the GitHub repository containing the profile."),
|
|
2141
|
+
repository: zod_1.default
|
|
2142
2142
|
.string()
|
|
2143
|
-
.describe("The
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
.
|
|
2148
|
-
.optional()
|
|
2149
|
-
.nullable()
|
|
2150
|
-
.describe("The version of the profile."),
|
|
2143
|
+
.describe("The name of the GitHub repository containing the profile."),
|
|
2144
|
+
commit: zod_1.default
|
|
2145
|
+
.string()
|
|
2146
|
+
.describe("The commit SHA of the GitHub repository containing the profile.")
|
|
2147
|
+
.optional(),
|
|
2151
2148
|
}),
|
|
2152
2149
|
zod_1.default
|
|
2153
|
-
.lazy(() => zod_1.default.array(Function_1.
|
|
2150
|
+
.lazy(() => zod_1.default.array(Function_1.ProfileCommitOptionalSchema))
|
|
2154
2151
|
.meta({
|
|
2155
|
-
title: "
|
|
2152
|
+
title: "ProfileCommitOptionalArray",
|
|
2156
2153
|
recursive: true,
|
|
2157
2154
|
}),
|
|
2158
2155
|
])
|
|
2159
|
-
.describe("A function profile where remote profiles may omit a
|
|
2160
|
-
Function_1.
|
|
2161
|
-
.union([
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
.describe("A profile where remote function profiles
|
|
2166
|
-
Function_1.ProfileVersionOptionalSchema = zod_1.default
|
|
2167
|
-
.union([
|
|
2168
|
-
Function_1.FunctionProfileVersionOptionalSchema,
|
|
2169
|
-
Function_1.VectorCompletionProfileSchema,
|
|
2170
|
-
])
|
|
2171
|
-
.describe("A profile where remote function profiles may omit a version.");
|
|
2156
|
+
.describe("A function profile where remote profiles may omit a commit.");
|
|
2157
|
+
Function_1.ProfileCommitRequiredSchema = zod_1.default
|
|
2158
|
+
.union([Function_1.FunctionProfileCommitRequiredSchema, Function_1.VectorCompletionProfileSchema])
|
|
2159
|
+
.describe("A profile where remote function profiles must specify a commit.");
|
|
2160
|
+
Function_1.ProfileCommitOptionalSchema = zod_1.default
|
|
2161
|
+
.union([Function_1.FunctionProfileCommitOptionalSchema, Function_1.VectorCompletionProfileSchema])
|
|
2162
|
+
.describe("A profile where remote function profiles may omit a commit.");
|
|
2172
2163
|
Function_1.InputSchemaSchema = zod_1.default.lazy(() => zod_1.default
|
|
2173
2164
|
.union([
|
|
2174
2165
|
InputSchema.ObjectSchema,
|
|
@@ -2386,15 +2377,15 @@ var Function;
|
|
|
2386
2377
|
TaskExpression.ScalarFunctionSchema = zod_1.default
|
|
2387
2378
|
.object({
|
|
2388
2379
|
type: zod_1.default.literal("scalar.function"),
|
|
2389
|
-
|
|
2380
|
+
owner: zod_1.default
|
|
2390
2381
|
.string()
|
|
2391
|
-
.describe("The
|
|
2392
|
-
|
|
2382
|
+
.describe("The owner of the GitHub repository containing the function."),
|
|
2383
|
+
repository: zod_1.default
|
|
2393
2384
|
.string()
|
|
2394
|
-
.describe("The
|
|
2395
|
-
|
|
2396
|
-
.
|
|
2397
|
-
.describe("The
|
|
2385
|
+
.describe("The name of the GitHub repository containing the function."),
|
|
2386
|
+
commit: zod_1.default
|
|
2387
|
+
.string()
|
|
2388
|
+
.describe("The commit SHA of the GitHub repository containing the function."),
|
|
2398
2389
|
skip: TaskExpression.SkipSchema.optional().nullable(),
|
|
2399
2390
|
map: TaskExpression.MapSchema.optional().nullable(),
|
|
2400
2391
|
input: Function_1.InputExpressionSchema,
|
|
@@ -2403,15 +2394,15 @@ var Function;
|
|
|
2403
2394
|
TaskExpression.VectorFunctionSchema = zod_1.default
|
|
2404
2395
|
.object({
|
|
2405
2396
|
type: zod_1.default.literal("vector.function"),
|
|
2406
|
-
|
|
2397
|
+
owner: zod_1.default
|
|
2407
2398
|
.string()
|
|
2408
|
-
.describe("The
|
|
2409
|
-
|
|
2399
|
+
.describe("The owner of the GitHub repository containing the function."),
|
|
2400
|
+
repository: zod_1.default
|
|
2410
2401
|
.string()
|
|
2411
|
-
.describe("The
|
|
2412
|
-
|
|
2413
|
-
.
|
|
2414
|
-
.describe("The
|
|
2402
|
+
.describe("The name of the GitHub repository containing the function."),
|
|
2403
|
+
commit: zod_1.default
|
|
2404
|
+
.string()
|
|
2405
|
+
.describe("The commit SHA of the GitHub repository containing the function."),
|
|
2415
2406
|
skip: TaskExpression.SkipSchema.optional().nullable(),
|
|
2416
2407
|
map: TaskExpression.MapSchema.optional().nullable(),
|
|
2417
2408
|
input: Function_1.InputExpressionSchema,
|
|
@@ -2443,9 +2434,6 @@ var Function;
|
|
|
2443
2434
|
Function_1.ScalarSchema = zod_1.default
|
|
2444
2435
|
.object({
|
|
2445
2436
|
type: zod_1.default.literal("scalar.function"),
|
|
2446
|
-
author: zod_1.default.string().describe("The author of the scalar function."),
|
|
2447
|
-
id: zod_1.default.string().describe("The unique identifier of the scalar function."),
|
|
2448
|
-
version: zod_1.default.uint32().describe("The version of the scalar function."),
|
|
2449
2437
|
description: zod_1.default
|
|
2450
2438
|
.string()
|
|
2451
2439
|
.describe("The description of the scalar function."),
|
|
@@ -2464,9 +2452,6 @@ var Function;
|
|
|
2464
2452
|
Function_1.VectorSchema = zod_1.default
|
|
2465
2453
|
.object({
|
|
2466
2454
|
type: zod_1.default.literal("vector.function"),
|
|
2467
|
-
author: zod_1.default.string().describe("The author of the vector function."),
|
|
2468
|
-
id: zod_1.default.string().describe("The unique identifier of the vector function."),
|
|
2469
|
-
version: zod_1.default.uint32().describe("The version of the vector function."),
|
|
2470
2455
|
description: zod_1.default
|
|
2471
2456
|
.string()
|
|
2472
2457
|
.describe("The description of the vector function."),
|
|
@@ -2492,7 +2477,8 @@ var Function;
|
|
|
2492
2477
|
(function (Executions) {
|
|
2493
2478
|
let Request;
|
|
2494
2479
|
(function (Request) {
|
|
2495
|
-
|
|
2480
|
+
// Remote Function Remote Profile
|
|
2481
|
+
Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema = zod_1.default
|
|
2496
2482
|
.object({
|
|
2497
2483
|
retry_token: zod_1.default
|
|
2498
2484
|
.string()
|
|
@@ -2506,233 +2492,104 @@ var Function;
|
|
|
2506
2492
|
first_chunk_timeout: Chat.Completions.Request.FirstChunkTimeoutSchema.optional().nullable(),
|
|
2507
2493
|
other_chunk_timeout: Chat.Completions.Request.OtherChunkTimeoutSchema.optional().nullable(),
|
|
2508
2494
|
})
|
|
2509
|
-
.describe("Base parameters for executing a function.");
|
|
2510
|
-
|
|
2511
|
-
Request.FunctionExecutionParamsExecuteInlineBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
|
|
2512
|
-
function: zod_1.default.lazy(() => exports.FunctionSchema),
|
|
2513
|
-
profile: Function_1.FunctionProfileVersionOptionalSchema,
|
|
2514
|
-
}).describe("Base parameters for executing an inline function.");
|
|
2515
|
-
Request.FunctionExecutionParamsExecuteInlineStreamingSchema = Request.FunctionExecutionParamsExecuteInlineBaseSchema.extend({
|
|
2495
|
+
.describe("Base parameters for executing a remote function with a remote profile.");
|
|
2496
|
+
Request.FunctionExecutionParamsRemoteFunctionRemoteProfileStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
|
|
2516
2497
|
stream: Chat.Completions.Request.StreamTrueSchema,
|
|
2517
2498
|
})
|
|
2518
|
-
.describe("Parameters for executing
|
|
2519
|
-
.meta({
|
|
2520
|
-
|
|
2499
|
+
.describe("Parameters for executing a remote function with a remote profile and streaming the response.")
|
|
2500
|
+
.meta({
|
|
2501
|
+
title: "FunctionExecutionParamsRemoteFunctionRemoteProfileStreaming",
|
|
2502
|
+
});
|
|
2503
|
+
Request.FunctionExecutionParamsRemoteFunctionRemoteProfileNonStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
|
|
2521
2504
|
stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
|
|
2522
2505
|
})
|
|
2523
|
-
.describe("Parameters for executing
|
|
2524
|
-
.meta({
|
|
2525
|
-
|
|
2506
|
+
.describe("Parameters for executing a remote function with a remote profile with a unary response.")
|
|
2507
|
+
.meta({
|
|
2508
|
+
title: "FunctionExecutionParamsRemoteFunctionRemoteProfileNonStreaming",
|
|
2509
|
+
});
|
|
2510
|
+
Request.FunctionExecutionParamsRemoteFunctionRemoteProfileSchema = zod_1.default
|
|
2526
2511
|
.union([
|
|
2527
|
-
Request.
|
|
2528
|
-
Request.
|
|
2512
|
+
Request.FunctionExecutionParamsRemoteFunctionRemoteProfileStreamingSchema,
|
|
2513
|
+
Request.FunctionExecutionParamsRemoteFunctionRemoteProfileNonStreamingSchema,
|
|
2529
2514
|
])
|
|
2530
|
-
.describe("Parameters for executing
|
|
2531
|
-
.meta({ title: "
|
|
2532
|
-
//
|
|
2533
|
-
Request.
|
|
2534
|
-
profile: Function_1.
|
|
2535
|
-
}).describe("Base parameters for executing a remote
|
|
2536
|
-
Request.
|
|
2515
|
+
.describe("Parameters for executing a remote function with a remote profile.")
|
|
2516
|
+
.meta({ title: "FunctionExecutionParamsRemoteFunctionRemoteProfile" });
|
|
2517
|
+
// Remote Function Inline Profile
|
|
2518
|
+
Request.FunctionExecutionParamsRemoteFunctionInlineProfileBaseSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
|
|
2519
|
+
profile: Function_1.FunctionProfileCommitOptionalSchema,
|
|
2520
|
+
}).describe("Base parameters for executing a remote function with an inline profile.");
|
|
2521
|
+
Request.FunctionExecutionParamsRemoteFunctionInlineProfileStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionInlineProfileBaseSchema.extend({
|
|
2537
2522
|
stream: Chat.Completions.Request.StreamTrueSchema,
|
|
2538
2523
|
})
|
|
2539
|
-
.describe("Parameters for executing a remote
|
|
2540
|
-
.meta({ title: "FunctionExecutionParamsExecuteStreaming" });
|
|
2541
|
-
Request.FunctionExecutionParamsExecuteNonStreamingSchema = Request.FunctionExecutionParamsExecuteBaseSchema.extend({
|
|
2542
|
-
stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
|
|
2543
|
-
})
|
|
2544
|
-
.describe("Parameters for executing a remote published function with a unary response.")
|
|
2545
|
-
.meta({ title: "FunctionExecutionParamsExecuteNonStreaming" });
|
|
2546
|
-
Request.FunctionExecutionParamsExecuteSchema = zod_1.default
|
|
2547
|
-
.union([
|
|
2548
|
-
Request.FunctionExecutionParamsExecuteStreamingSchema,
|
|
2549
|
-
Request.FunctionExecutionParamsExecuteNonStreamingSchema,
|
|
2550
|
-
])
|
|
2551
|
-
.describe("Parameters for executing a remote published function.")
|
|
2552
|
-
.meta({ title: "FunctionExecutionParamsExecute" });
|
|
2553
|
-
// Publish Scalar Function
|
|
2554
|
-
Request.FunctionExecutionParamsPublishScalarFunctionBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
|
|
2555
|
-
function: Function_1.ScalarSchema,
|
|
2556
|
-
publish_function: zod_1.default
|
|
2557
|
-
.object({
|
|
2558
|
-
description: zod_1.default
|
|
2559
|
-
.string()
|
|
2560
|
-
.describe("The description of the published scalar function."),
|
|
2561
|
-
changelog: zod_1.default
|
|
2562
|
-
.string()
|
|
2563
|
-
.optional()
|
|
2564
|
-
.nullable()
|
|
2565
|
-
.describe("When present, describes changes from the previous version or versions."),
|
|
2566
|
-
input_schema: Function_1.InputSchemaSchema,
|
|
2567
|
-
})
|
|
2568
|
-
.describe("Details about the scalar function to be published."),
|
|
2569
|
-
profile: Function_1.FunctionProfileVersionRequiredSchema,
|
|
2570
|
-
publish_profile: zod_1.default
|
|
2571
|
-
.object({
|
|
2572
|
-
id: zod_1.default
|
|
2573
|
-
.literal("default")
|
|
2574
|
-
.describe('The identifier of the profile to publish. Must be "default" when publishing a function.'),
|
|
2575
|
-
version: zod_1.default
|
|
2576
|
-
.uint32()
|
|
2577
|
-
.describe("The version of the profile to publish. Must match the function's version."),
|
|
2578
|
-
description: zod_1.default
|
|
2579
|
-
.string()
|
|
2580
|
-
.describe("The description of the published profile."),
|
|
2581
|
-
changelog: zod_1.default
|
|
2582
|
-
.string()
|
|
2583
|
-
.optional()
|
|
2584
|
-
.nullable()
|
|
2585
|
-
.describe("When present, describes changes from the previous version or versions."),
|
|
2586
|
-
})
|
|
2587
|
-
.describe("Details about the profile to be published."),
|
|
2588
|
-
}).describe("Base parameters for executing and publishing an inline scalar function.");
|
|
2589
|
-
Request.FunctionExecutionParamsPublishScalarFunctionStreamingSchema = Request.FunctionExecutionParamsPublishScalarFunctionBaseSchema.extend({
|
|
2590
|
-
stream: Chat.Completions.Request.StreamTrueSchema,
|
|
2591
|
-
})
|
|
2592
|
-
.describe("Parameters for executing and publishing an inline scalar function and streaming the response.")
|
|
2524
|
+
.describe("Parameters for executing a remote function with an inline profile and streaming the response.")
|
|
2593
2525
|
.meta({
|
|
2594
|
-
title: "
|
|
2526
|
+
title: "FunctionExecutionParamsRemoteFunctionInlineProfileStreaming",
|
|
2595
2527
|
});
|
|
2596
|
-
Request.
|
|
2528
|
+
Request.FunctionExecutionParamsRemoteFunctionInlineProfileNonStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionInlineProfileBaseSchema.extend({
|
|
2597
2529
|
stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
|
|
2598
2530
|
})
|
|
2599
|
-
.describe("Parameters for executing
|
|
2531
|
+
.describe("Parameters for executing a remote function with an inline profile with a unary response.")
|
|
2600
2532
|
.meta({
|
|
2601
|
-
title: "
|
|
2533
|
+
title: "FunctionExecutionParamsRemoteFunctionInlineProfileNonStreaming",
|
|
2602
2534
|
});
|
|
2603
|
-
Request.
|
|
2535
|
+
Request.FunctionExecutionParamsRemoteFunctionInlineProfileSchema = zod_1.default
|
|
2604
2536
|
.union([
|
|
2605
|
-
Request.
|
|
2606
|
-
Request.
|
|
2537
|
+
Request.FunctionExecutionParamsRemoteFunctionInlineProfileStreamingSchema,
|
|
2538
|
+
Request.FunctionExecutionParamsRemoteFunctionInlineProfileNonStreamingSchema,
|
|
2607
2539
|
])
|
|
2608
|
-
.describe("Parameters for executing
|
|
2609
|
-
.meta({ title: "
|
|
2610
|
-
//
|
|
2611
|
-
Request.
|
|
2612
|
-
function:
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
description: zod_1.default
|
|
2616
|
-
.string()
|
|
2617
|
-
.describe("The description of the published vector function."),
|
|
2618
|
-
changelog: zod_1.default
|
|
2619
|
-
.string()
|
|
2620
|
-
.optional()
|
|
2621
|
-
.nullable()
|
|
2622
|
-
.describe("When present, describes changes from the previous version or versions."),
|
|
2623
|
-
input_schema: Function_1.InputSchemaSchema,
|
|
2624
|
-
output_length: zod_1.default
|
|
2625
|
-
.union([
|
|
2626
|
-
zod_1.default.uint32().describe("The fixed length of the output vector."),
|
|
2627
|
-
exports.ExpressionSchema.describe("An expression which evaluates to the length of the output vector. Will only be provided with the function input. The output length must be determinable from the input alone."),
|
|
2628
|
-
])
|
|
2629
|
-
.describe("The length of the output vector."),
|
|
2630
|
-
})
|
|
2631
|
-
.describe("Details about the vector function to be published."),
|
|
2632
|
-
profile: Function_1.FunctionProfileVersionRequiredSchema,
|
|
2633
|
-
publish_profile: zod_1.default
|
|
2634
|
-
.object({
|
|
2635
|
-
id: zod_1.default
|
|
2636
|
-
.literal("default")
|
|
2637
|
-
.describe('The identifier of the profile to publish. Must be "default" when publishing a function.'),
|
|
2638
|
-
version: zod_1.default
|
|
2639
|
-
.uint32()
|
|
2640
|
-
.describe("The version of the profile to publish. Must match the function's version."),
|
|
2641
|
-
description: zod_1.default
|
|
2642
|
-
.string()
|
|
2643
|
-
.describe("The description of the published profile."),
|
|
2644
|
-
changelog: zod_1.default
|
|
2645
|
-
.string()
|
|
2646
|
-
.optional()
|
|
2647
|
-
.nullable()
|
|
2648
|
-
.describe("When present, describes changes from the previous version or versions."),
|
|
2649
|
-
})
|
|
2650
|
-
.describe("Details about the profile to be published."),
|
|
2651
|
-
}).describe("Base parameters for executing and publishing an inline vector function.");
|
|
2652
|
-
Request.FunctionExecutionParamsPublishVectorFunctionStreamingSchema = Request.FunctionExecutionParamsPublishVectorFunctionBaseSchema.extend({
|
|
2540
|
+
.describe("Parameters for executing a remote function with an inline profile.")
|
|
2541
|
+
.meta({ title: "FunctionExecutionParamsRemoteFunctionInlineProfile" });
|
|
2542
|
+
// Inline Function Remote Profile
|
|
2543
|
+
Request.FunctionExecutionParamsInlineFunctionRemoteProfileBaseSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
|
|
2544
|
+
function: zod_1.default.lazy(() => exports.FunctionSchema),
|
|
2545
|
+
}).describe("Base parameters for executing an inline function with a remote profile.");
|
|
2546
|
+
Request.FunctionExecutionParamsInlineFunctionRemoteProfileStreamingSchema = Request.FunctionExecutionParamsInlineFunctionRemoteProfileBaseSchema.extend({
|
|
2653
2547
|
stream: Chat.Completions.Request.StreamTrueSchema,
|
|
2654
2548
|
})
|
|
2655
|
-
.describe("Parameters for executing
|
|
2549
|
+
.describe("Parameters for executing an inline function with a remote profile and streaming the response.")
|
|
2656
2550
|
.meta({
|
|
2657
|
-
title: "
|
|
2551
|
+
title: "FunctionExecutionParamsInlineFunctionRemoteProfileStreaming",
|
|
2658
2552
|
});
|
|
2659
|
-
Request.
|
|
2553
|
+
Request.FunctionExecutionParamsInlineFunctionRemoteProfileNonStreamingSchema = Request.FunctionExecutionParamsInlineFunctionRemoteProfileBaseSchema.extend({
|
|
2660
2554
|
stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
|
|
2661
2555
|
})
|
|
2662
|
-
.describe("Parameters for executing
|
|
2556
|
+
.describe("Parameters for executing an inline function with a remote profile with a unary response.")
|
|
2663
2557
|
.meta({
|
|
2664
|
-
title: "
|
|
2558
|
+
title: "FunctionExecutionParamsInlineFunctionRemoteProfileNonStreaming",
|
|
2665
2559
|
});
|
|
2666
|
-
Request.
|
|
2667
|
-
.union([
|
|
2668
|
-
Request.FunctionExecutionParamsPublishVectorFunctionStreamingSchema,
|
|
2669
|
-
Request.FunctionExecutionParamsPublishVectorFunctionNonStreamingSchema,
|
|
2670
|
-
])
|
|
2671
|
-
.describe("Parameters for executing and publishing an inline vector function.")
|
|
2672
|
-
.meta({ title: "FunctionExecutionParamsPublishVectorFunction" });
|
|
2673
|
-
// Publish Function
|
|
2674
|
-
Request.FunctionExecutionParamsPublishFunctionStreamingSchema = zod_1.default
|
|
2560
|
+
Request.FunctionExecutionParamsInlineFunctionRemoteProfileSchema = zod_1.default
|
|
2675
2561
|
.union([
|
|
2676
|
-
Request.
|
|
2677
|
-
Request.
|
|
2562
|
+
Request.FunctionExecutionParamsInlineFunctionRemoteProfileStreamingSchema,
|
|
2563
|
+
Request.FunctionExecutionParamsInlineFunctionRemoteProfileNonStreamingSchema,
|
|
2678
2564
|
])
|
|
2679
|
-
.describe("Parameters for executing
|
|
2680
|
-
.meta({ title: "
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
.meta({ title: "FunctionExecutionParamsPublishFunctionNonStreaming" });
|
|
2688
|
-
Request.FunctionExecutionParamsPublishFunctionSchema = zod_1.default
|
|
2689
|
-
.union([
|
|
2690
|
-
Request.FunctionExecutionParamsPublishScalarFunctionSchema,
|
|
2691
|
-
Request.FunctionExecutionParamsPublishVectorFunctionSchema,
|
|
2692
|
-
])
|
|
2693
|
-
.describe("Parameters for executing and publishing an inline function.")
|
|
2694
|
-
.meta({ title: "FunctionExecutionParamsPublishFunction" });
|
|
2695
|
-
// Publish Profile
|
|
2696
|
-
Request.FunctionExecutionParamsPublishProfileBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
|
|
2697
|
-
profile: zod_1.default
|
|
2698
|
-
.array(Function_1.ProfileVersionRequiredSchema)
|
|
2699
|
-
.describe("The profile to publish."),
|
|
2700
|
-
publish_profile: zod_1.default
|
|
2701
|
-
.object({
|
|
2702
|
-
id: zod_1.default
|
|
2703
|
-
.string()
|
|
2704
|
-
.describe("The unique identifier of the profile to publish."),
|
|
2705
|
-
version: zod_1.default
|
|
2706
|
-
.uint32()
|
|
2707
|
-
.describe("The version of the profile to publish."),
|
|
2708
|
-
description: zod_1.default
|
|
2709
|
-
.string()
|
|
2710
|
-
.describe("The description of the published profile."),
|
|
2711
|
-
changelog: zod_1.default
|
|
2712
|
-
.string()
|
|
2713
|
-
.optional()
|
|
2714
|
-
.nullable()
|
|
2715
|
-
.describe("When present, describes changes from the previous version or versions."),
|
|
2716
|
-
})
|
|
2717
|
-
.describe("Details about the profile to be published."),
|
|
2718
|
-
}).describe("Base parameters for executing a remote published function and publishing a profile.");
|
|
2719
|
-
Request.FunctionExecutionParamsPublishProfileStreamingSchema = Request.FunctionExecutionParamsPublishProfileBaseSchema.extend({
|
|
2565
|
+
.describe("Parameters for executing an inline function with a remote profile.")
|
|
2566
|
+
.meta({ title: "FunctionExecutionParamsInlineFunctionRemoteProfile" });
|
|
2567
|
+
// Inline Function Inline Profile
|
|
2568
|
+
Request.FunctionExecutionParamsInlineFunctionInlineProfileBaseSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
|
|
2569
|
+
function: zod_1.default.lazy(() => exports.FunctionSchema),
|
|
2570
|
+
profile: Function_1.FunctionProfileCommitOptionalSchema,
|
|
2571
|
+
}).describe("Base parameters for executing an inline function with an inline profile.");
|
|
2572
|
+
Request.FunctionExecutionParamsInlineFunctionInlineProfileStreamingSchema = Request.FunctionExecutionParamsInlineFunctionInlineProfileBaseSchema.extend({
|
|
2720
2573
|
stream: Chat.Completions.Request.StreamTrueSchema,
|
|
2721
2574
|
})
|
|
2722
|
-
.describe("Parameters for executing
|
|
2723
|
-
.meta({
|
|
2724
|
-
|
|
2575
|
+
.describe("Parameters for executing an inline function with an inline profile and streaming the response.")
|
|
2576
|
+
.meta({
|
|
2577
|
+
title: "FunctionExecutionParamsInlineFunctionInlineProfileStreaming",
|
|
2578
|
+
});
|
|
2579
|
+
Request.FunctionExecutionParamsInlineFunctionInlineProfileNonStreamingSchema = Request.FunctionExecutionParamsInlineFunctionInlineProfileBaseSchema.extend({
|
|
2725
2580
|
stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
|
|
2726
2581
|
})
|
|
2727
|
-
.describe("Parameters for executing
|
|
2728
|
-
.meta({
|
|
2729
|
-
|
|
2582
|
+
.describe("Parameters for executing an inline function with an inline profile with a unary response.")
|
|
2583
|
+
.meta({
|
|
2584
|
+
title: "FunctionExecutionParamsInlineFunctionInlineProfileNonStreaming",
|
|
2585
|
+
});
|
|
2586
|
+
Request.FunctionExecutionParamsInlineFunctionInlineProfileSchema = zod_1.default
|
|
2730
2587
|
.union([
|
|
2731
|
-
Request.
|
|
2732
|
-
Request.
|
|
2588
|
+
Request.FunctionExecutionParamsInlineFunctionInlineProfileStreamingSchema,
|
|
2589
|
+
Request.FunctionExecutionParamsInlineFunctionInlineProfileNonStreamingSchema,
|
|
2733
2590
|
])
|
|
2734
|
-
.describe("Parameters for executing
|
|
2735
|
-
.meta({ title: "
|
|
2591
|
+
.describe("Parameters for executing an inline function with an inline profile.")
|
|
2592
|
+
.meta({ title: "FunctionExecutionParamsInlineFunctionInlineProfile" });
|
|
2736
2593
|
})(Request = Executions.Request || (Executions.Request = {}));
|
|
2737
2594
|
let Response;
|
|
2738
2595
|
(function (Response) {
|
|
@@ -3249,7 +3106,7 @@ var Function;
|
|
|
3249
3106
|
.optional()
|
|
3250
3107
|
.describe("When true, indicates that one or more function executions encountered errors during profile computation."),
|
|
3251
3108
|
profile: zod_1.default
|
|
3252
|
-
.array(Function_1.
|
|
3109
|
+
.array(Function_1.ProfileCommitRequiredSchema)
|
|
3253
3110
|
.optional()
|
|
3254
3111
|
.describe("The computed function profile."),
|
|
3255
3112
|
fitting_stats: Response.FittingStatsSchema.optional(),
|
|
@@ -3292,7 +3149,7 @@ var Function;
|
|
|
3292
3149
|
.boolean()
|
|
3293
3150
|
.describe("When true, indicates that one or more function executions encountered errors during profile computation."),
|
|
3294
3151
|
profile: zod_1.default
|
|
3295
|
-
.array(Function_1.
|
|
3152
|
+
.array(Function_1.ProfileCommitRequiredSchema)
|
|
3296
3153
|
.describe("The computed function profile."),
|
|
3297
3154
|
fitting_stats: Response.FittingStatsSchema,
|
|
3298
3155
|
created: zod_1.default
|
|
@@ -3311,48 +3168,21 @@ var Function;
|
|
|
3311
3168
|
let Profile;
|
|
3312
3169
|
(function (Profile) {
|
|
3313
3170
|
Profile.ListItemSchema = zod_1.default.object({
|
|
3314
|
-
|
|
3171
|
+
owner: zod_1.default
|
|
3172
|
+
.string()
|
|
3173
|
+
.describe("The owner of the GitHub repository containing the profile."),
|
|
3174
|
+
repository: zod_1.default
|
|
3315
3175
|
.string()
|
|
3316
|
-
.describe("The
|
|
3317
|
-
|
|
3176
|
+
.describe("The name of the GitHub repository containing the profile."),
|
|
3177
|
+
commit: zod_1.default
|
|
3318
3178
|
.string()
|
|
3319
|
-
.describe("The
|
|
3320
|
-
author: zod_1.default.string().describe("The author of the profile."),
|
|
3321
|
-
id: zod_1.default.string().describe("The unique identifier of the profile."),
|
|
3322
|
-
version: zod_1.default.uint32().describe("The version of the profile."),
|
|
3179
|
+
.describe("The commit SHA of the GitHub repository containing the profile."),
|
|
3323
3180
|
});
|
|
3324
3181
|
async function list(openai, options) {
|
|
3325
3182
|
const response = await openai.get("/functions/profiles", options);
|
|
3326
3183
|
return response;
|
|
3327
3184
|
}
|
|
3328
3185
|
Profile.list = list;
|
|
3329
|
-
Profile.RetrieveItemSchema = zod_1.default.object({
|
|
3330
|
-
created: zod_1.default
|
|
3331
|
-
.uint32()
|
|
3332
|
-
.describe("The UNIX timestamp (in seconds) when the profile was created."),
|
|
3333
|
-
shape: zod_1.default
|
|
3334
|
-
.string()
|
|
3335
|
-
.describe("The shape of the profile. Unless Task Skip expressions work out favorably, profiles only work for functions with the same shape."),
|
|
3336
|
-
function_author: zod_1.default
|
|
3337
|
-
.string()
|
|
3338
|
-
.describe("The author of the function the profile was published to."),
|
|
3339
|
-
function_id: zod_1.default
|
|
3340
|
-
.string()
|
|
3341
|
-
.describe("The unique identifier of the function the profile was published to."),
|
|
3342
|
-
author: zod_1.default.string().describe("The author of the profile."),
|
|
3343
|
-
id: zod_1.default.string().describe("The unique identifier of the profile."),
|
|
3344
|
-
version: zod_1.default.uint32().describe("The version of the profile."),
|
|
3345
|
-
profile: zod_1.default
|
|
3346
|
-
.array(Function.ProfileVersionRequiredSchema)
|
|
3347
|
-
.describe("The function profile."),
|
|
3348
|
-
});
|
|
3349
|
-
async function retrieve(openai, function_author, function_id, author, id, version, options) {
|
|
3350
|
-
const response = await openai.get(version !== null && version !== undefined
|
|
3351
|
-
? `/functions/${function_author}/${function_id}/profiles/${author}/${id}/${version}`
|
|
3352
|
-
: `/functions/${function_author}/${function_id}/profiles/${author}/${id}`, options);
|
|
3353
|
-
return response;
|
|
3354
|
-
}
|
|
3355
|
-
Profile.retrieve = retrieve;
|
|
3356
3186
|
Profile.HistoricalUsageSchema = zod_1.default.object({
|
|
3357
3187
|
requests: zod_1.default
|
|
3358
3188
|
.uint32()
|
|
@@ -3367,89 +3197,102 @@ var Function;
|
|
|
3367
3197
|
.number()
|
|
3368
3198
|
.describe("The total cost incurred by using this Profile."),
|
|
3369
3199
|
});
|
|
3370
|
-
async function retrieveUsage(openai,
|
|
3371
|
-
const response = await openai.get(
|
|
3372
|
-
? `/functions
|
|
3373
|
-
: `/functions
|
|
3200
|
+
async function retrieveUsage(openai, powner, prepository, pcommit, options) {
|
|
3201
|
+
const response = await openai.get(pcommit !== null && pcommit !== undefined
|
|
3202
|
+
? `/functions/profiles/${powner}/${prepository}/${pcommit}/usage`
|
|
3203
|
+
: `/functions/profiles/${powner}/${prepository}/usage`, options);
|
|
3374
3204
|
return response;
|
|
3375
3205
|
}
|
|
3376
3206
|
Profile.retrieveUsage = retrieveUsage;
|
|
3377
3207
|
})(Profile = Function_1.Profile || (Function_1.Profile = {}));
|
|
3378
|
-
async function
|
|
3208
|
+
async function executeInlineFunctionInlineProfile(openai, body, options) {
|
|
3379
3209
|
var _a;
|
|
3380
3210
|
const response = await openai.post("/functions", Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
|
|
3381
3211
|
return response;
|
|
3382
3212
|
}
|
|
3383
|
-
Function_1.
|
|
3384
|
-
async function
|
|
3213
|
+
Function_1.executeInlineFunctionInlineProfile = executeInlineFunctionInlineProfile;
|
|
3214
|
+
async function executeRemoteFunctionInlineProfile(openai, fowner, frepository, fcommit, body, options) {
|
|
3385
3215
|
var _a;
|
|
3386
|
-
const response = await openai.post(
|
|
3387
|
-
? `/functions/${
|
|
3388
|
-
: `/functions/${
|
|
3216
|
+
const response = await openai.post(fcommit !== null && fcommit !== undefined
|
|
3217
|
+
? `/functions/${fowner}/${frepository}/${fcommit}`
|
|
3218
|
+
: `/functions/${fowner}/${frepository}`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
|
|
3389
3219
|
return response;
|
|
3390
3220
|
}
|
|
3391
|
-
Function_1.
|
|
3392
|
-
async function
|
|
3221
|
+
Function_1.executeRemoteFunctionInlineProfile = executeRemoteFunctionInlineProfile;
|
|
3222
|
+
async function executeInlineFunctionRemoteProfile(openai, powner, prepository, pcommit, body, options) {
|
|
3393
3223
|
var _a;
|
|
3394
|
-
const response = await openai.post(
|
|
3224
|
+
const response = await openai.post(pcommit !== null && pcommit !== undefined
|
|
3225
|
+
? `/functions/profiles/${powner}/${prepository}/${pcommit}`
|
|
3226
|
+
: `/functions/profiles/${powner}/${prepository}`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
|
|
3395
3227
|
return response;
|
|
3396
3228
|
}
|
|
3397
|
-
Function_1.
|
|
3398
|
-
async function
|
|
3229
|
+
Function_1.executeInlineFunctionRemoteProfile = executeInlineFunctionRemoteProfile;
|
|
3230
|
+
async function executeRemoteFunctionRemoteProfile(openai, fowner, frepository, fcommit, powner, prepository, pcommit, body, options) {
|
|
3399
3231
|
var _a;
|
|
3400
|
-
|
|
3232
|
+
let url;
|
|
3233
|
+
if (fcommit !== null && fcommit !== undefined) {
|
|
3234
|
+
if (pcommit !== null && pcommit !== undefined) {
|
|
3235
|
+
url = `/functions/${fowner}/${frepository}/${fcommit}/profiles/${powner}/${prepository}/${pcommit}`;
|
|
3236
|
+
}
|
|
3237
|
+
else {
|
|
3238
|
+
url = `/functions/${fowner}/${frepository}/${fcommit}/profiles/${powner}/${prepository}`;
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
else if (pcommit !== null && pcommit !== undefined) {
|
|
3242
|
+
url = `/functions/${fowner}/${frepository}/profiles/${powner}/${prepository}/${pcommit}`;
|
|
3243
|
+
}
|
|
3244
|
+
else {
|
|
3245
|
+
url = `/functions/${fowner}/${frepository}/profiles/${powner}/${prepository}`;
|
|
3246
|
+
}
|
|
3247
|
+
const response = await openai.post(url, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
|
|
3401
3248
|
return response;
|
|
3402
3249
|
}
|
|
3403
|
-
Function_1.
|
|
3404
|
-
async function
|
|
3250
|
+
Function_1.executeRemoteFunctionRemoteProfile = executeRemoteFunctionRemoteProfile;
|
|
3251
|
+
async function execute(openai, function_, profile, body, options) {
|
|
3252
|
+
if ("owner" in function_ && "repository" in function_) {
|
|
3253
|
+
if ("owner" in profile && "repository" in profile) {
|
|
3254
|
+
const requestBody = body;
|
|
3255
|
+
return executeRemoteFunctionRemoteProfile(openai, function_.owner, function_.repository, function_.commit, profile.owner, profile.repository, profile.commit, requestBody, options);
|
|
3256
|
+
}
|
|
3257
|
+
else {
|
|
3258
|
+
const requestBody = Object.assign(Object.assign({}, body), { profile });
|
|
3259
|
+
return executeRemoteFunctionInlineProfile(openai, function_.owner, function_.repository, function_.commit, requestBody, options);
|
|
3260
|
+
}
|
|
3261
|
+
}
|
|
3262
|
+
else if ("owner" in profile && "repository" in profile) {
|
|
3263
|
+
const requestBody = Object.assign(Object.assign({}, body), { function: function_ });
|
|
3264
|
+
return executeInlineFunctionRemoteProfile(openai, profile.owner, profile.repository, profile.commit, requestBody, options);
|
|
3265
|
+
}
|
|
3266
|
+
else {
|
|
3267
|
+
const requestBody = Object.assign(Object.assign({}, body), { function: function_, profile });
|
|
3268
|
+
return executeInlineFunctionInlineProfile(openai, requestBody, options);
|
|
3269
|
+
}
|
|
3270
|
+
}
|
|
3271
|
+
Function_1.execute = execute;
|
|
3272
|
+
async function computeProfile(openai, fowner, frepository, fcommit, body, options) {
|
|
3405
3273
|
var _a;
|
|
3406
|
-
const response = await openai.post(
|
|
3407
|
-
? `/functions/${
|
|
3408
|
-
: `/functions/${
|
|
3274
|
+
const response = await openai.post(fcommit !== null && fcommit !== undefined
|
|
3275
|
+
? `/functions/${fowner}/${frepository}/${fcommit}/profiles/compute`
|
|
3276
|
+
: `/functions/${fowner}/${frepository}/profiles/compute`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
|
|
3409
3277
|
return response;
|
|
3410
3278
|
}
|
|
3411
3279
|
Function_1.computeProfile = computeProfile;
|
|
3412
3280
|
Function_1.ListItemSchema = zod_1.default.object({
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3281
|
+
owner: zod_1.default
|
|
3282
|
+
.string()
|
|
3283
|
+
.describe("The owner of the GitHub repository containing the function."),
|
|
3284
|
+
repository: zod_1.default
|
|
3285
|
+
.string()
|
|
3286
|
+
.describe("The name of the GitHub repository containing the function."),
|
|
3287
|
+
commit: zod_1.default
|
|
3288
|
+
.string()
|
|
3289
|
+
.describe("The commit SHA of the GitHub repository containing the function."),
|
|
3416
3290
|
});
|
|
3417
3291
|
async function list(openai, options) {
|
|
3418
3292
|
const response = await openai.get("/functions", options);
|
|
3419
3293
|
return response;
|
|
3420
3294
|
}
|
|
3421
3295
|
Function_1.list = list;
|
|
3422
|
-
Function_1.ScalarRetrieveItemSchema = Function_1.ScalarSchema.extend({
|
|
3423
|
-
created: zod_1.default
|
|
3424
|
-
.uint32()
|
|
3425
|
-
.describe("The UNIX timestamp (in seconds) when the function was created."),
|
|
3426
|
-
shape: zod_1.default
|
|
3427
|
-
.string()
|
|
3428
|
-
.describe("The shape of the function. Unless Task Skip expressions work out favorably, functions only work with profiles that have the same shape."),
|
|
3429
|
-
})
|
|
3430
|
-
.describe("A retrieved scalar function.")
|
|
3431
|
-
.meta({ title: "RetrievedScalarFunction" });
|
|
3432
|
-
Function_1.VectorRetrieveItemSchema = Function_1.VectorSchema.extend({
|
|
3433
|
-
created: zod_1.default
|
|
3434
|
-
.uint32()
|
|
3435
|
-
.describe("The UNIX timestamp (in seconds) when the function was created."),
|
|
3436
|
-
shape: zod_1.default
|
|
3437
|
-
.string()
|
|
3438
|
-
.describe("The shape of the function. Unless Task Skip expressions work out favorably, functions only work with profiles that have the same shape."),
|
|
3439
|
-
})
|
|
3440
|
-
.describe("A retrieved vector function.")
|
|
3441
|
-
.meta({ title: "RetrievedVectorFunction" });
|
|
3442
|
-
Function_1.RetrieveItemSchema = zod_1.default.discriminatedUnion("type", [
|
|
3443
|
-
Function_1.ScalarRetrieveItemSchema,
|
|
3444
|
-
Function_1.VectorRetrieveItemSchema,
|
|
3445
|
-
]);
|
|
3446
|
-
async function retrieve(openai, author, id, version, options) {
|
|
3447
|
-
const response = await openai.get(version !== null && version !== undefined
|
|
3448
|
-
? `/functions/${author}/${id}/${version}`
|
|
3449
|
-
: `/functions/${author}/${id}`, options);
|
|
3450
|
-
return response;
|
|
3451
|
-
}
|
|
3452
|
-
Function_1.retrieve = retrieve;
|
|
3453
3296
|
Function_1.HistoricalUsageSchema = zod_1.default.object({
|
|
3454
3297
|
requests: zod_1.default
|
|
3455
3298
|
.uint32()
|
|
@@ -3464,10 +3307,10 @@ var Function;
|
|
|
3464
3307
|
.number()
|
|
3465
3308
|
.describe("The total cost incurred by using this Function."),
|
|
3466
3309
|
});
|
|
3467
|
-
async function retrieveUsage(openai,
|
|
3468
|
-
const response = await openai.get(
|
|
3469
|
-
? `/functions/${
|
|
3470
|
-
: `/functions/${
|
|
3310
|
+
async function retrieveUsage(openai, fowner, frepository, fcommit, options) {
|
|
3311
|
+
const response = await openai.get(fcommit !== null && fcommit !== undefined
|
|
3312
|
+
? `/functions/${fowner}/${frepository}/${fcommit}/usage`
|
|
3313
|
+
: `/functions/${fowner}/${frepository}/usage`, options);
|
|
3471
3314
|
return response;
|
|
3472
3315
|
}
|
|
3473
3316
|
Function_1.retrieveUsage = retrieveUsage;
|