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