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.
Files changed (4) hide show
  1. package/dist/index.cjs +192 -349
  2. package/dist/index.d.ts +11357 -15873
  3. package/dist/index.js +192 -349
  4. 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.FunctionProfileVersionRequiredSchema = zod_1.default
2116
+ Function_1.FunctionProfileCommitRequiredSchema = zod_1.default
2117
2117
  .union([
2118
2118
  zod_1.default.object({
2119
- function_author: zod_1.default
2119
+ owner: zod_1.default
2120
2120
  .string()
2121
- .describe("The author of the function the profile was published to."),
2122
- function_id: zod_1.default
2121
+ .describe("The owner of the GitHub repository containing the profile."),
2122
+ repository: zod_1.default
2123
2123
  .string()
2124
- .describe("The unique identifier of the function the profile was published to."),
2125
- author: zod_1.default.string().describe("The author of the profile."),
2126
- id: zod_1.default.string().describe("The unique identifier of the profile."),
2127
- version: zod_1.default.uint32().describe("The version of the profile."),
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.ProfileVersionRequiredSchema).meta({
2130
- title: "ProfileVersionRequiredArray",
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 version.");
2135
- Function_1.FunctionProfileVersionOptionalSchema = zod_1.default
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
- function_author: zod_1.default
2138
+ owner: zod_1.default
2139
2139
  .string()
2140
- .describe("The author of the function the profile was published to."),
2141
- function_id: zod_1.default
2140
+ .describe("The owner of the GitHub repository containing the profile."),
2141
+ repository: zod_1.default
2142
2142
  .string()
2143
- .describe("The unique identifier of the function the profile was published to."),
2144
- author: zod_1.default.string().describe("The author of the profile."),
2145
- id: zod_1.default.string().describe("The unique identifier of the profile."),
2146
- version: zod_1.default
2147
- .uint32()
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.ProfileVersionOptionalSchema))
2150
+ .lazy(() => zod_1.default.array(Function_1.ProfileCommitOptionalSchema))
2154
2151
  .meta({
2155
- title: "ProfileVersionOptionalArray",
2152
+ title: "ProfileCommitOptionalArray",
2156
2153
  recursive: true,
2157
2154
  }),
2158
2155
  ])
2159
- .describe("A function profile where remote profiles may omit a version.");
2160
- Function_1.ProfileVersionRequiredSchema = zod_1.default
2161
- .union([
2162
- Function_1.FunctionProfileVersionRequiredSchema,
2163
- Function_1.VectorCompletionProfileSchema,
2164
- ])
2165
- .describe("A profile where remote function profiles must specify a version.");
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
- author: zod_1.default
2380
+ owner: zod_1.default
2390
2381
  .string()
2391
- .describe("The author of the remote published scalar function."),
2392
- id: zod_1.default
2382
+ .describe("The owner of the GitHub repository containing the function."),
2383
+ repository: zod_1.default
2393
2384
  .string()
2394
- .describe("The unique identifier of the remote published scalar function."),
2395
- version: zod_1.default
2396
- .uint32()
2397
- .describe("The version of the remote published scalar function."),
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
- author: zod_1.default
2397
+ owner: zod_1.default
2407
2398
  .string()
2408
- .describe("The author of the remote published vector function."),
2409
- id: zod_1.default
2399
+ .describe("The owner of the GitHub repository containing the function."),
2400
+ repository: zod_1.default
2410
2401
  .string()
2411
- .describe("The unique identifier of the remote published vector function."),
2412
- version: zod_1.default
2413
- .uint32()
2414
- .describe("The version of the remote published vector function."),
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
- Request.FunctionExecutionParamsBaseSchema = zod_1.default
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
- // Execute Inline Function
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 an inline function and streaming the response.")
2519
- .meta({ title: "FunctionExecutionParamsExecuteInlineStreaming" });
2520
- Request.FunctionExecutionParamsExecuteInlineNonStreamingSchema = Request.FunctionExecutionParamsExecuteInlineBaseSchema.extend({
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 an inline function with a unary response.")
2524
- .meta({ title: "FunctionExecutionParamsExecuteInlineNonStreaming" });
2525
- Request.FunctionExecutionParamsExecuteInlineSchema = zod_1.default
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.FunctionExecutionParamsExecuteInlineStreamingSchema,
2528
- Request.FunctionExecutionParamsExecuteInlineNonStreamingSchema,
2512
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileStreamingSchema,
2513
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileNonStreamingSchema,
2529
2514
  ])
2530
- .describe("Parameters for executing an inline function.")
2531
- .meta({ title: "FunctionExecutionParamsExecuteInline" });
2532
- // Execute Published Function
2533
- Request.FunctionExecutionParamsExecuteBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2534
- profile: Function_1.FunctionProfileVersionOptionalSchema.optional().nullable(),
2535
- }).describe("Base parameters for executing a remote published function.");
2536
- Request.FunctionExecutionParamsExecuteStreamingSchema = Request.FunctionExecutionParamsExecuteBaseSchema.extend({
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 published function and streaming the response.")
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: "FunctionExecutionParamsPublishScalarFunctionStreaming",
2526
+ title: "FunctionExecutionParamsRemoteFunctionInlineProfileStreaming",
2595
2527
  });
2596
- Request.FunctionExecutionParamsPublishScalarFunctionNonStreamingSchema = Request.FunctionExecutionParamsPublishScalarFunctionBaseSchema.extend({
2528
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileNonStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionInlineProfileBaseSchema.extend({
2597
2529
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2598
2530
  })
2599
- .describe("Parameters for executing and publishing an inline scalar function with a unary response.")
2531
+ .describe("Parameters for executing a remote function with an inline profile with a unary response.")
2600
2532
  .meta({
2601
- title: "FunctionExecutionParamsPublishScalarFunctionNonStreaming",
2533
+ title: "FunctionExecutionParamsRemoteFunctionInlineProfileNonStreaming",
2602
2534
  });
2603
- Request.FunctionExecutionParamsPublishScalarFunctionSchema = zod_1.default
2535
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileSchema = zod_1.default
2604
2536
  .union([
2605
- Request.FunctionExecutionParamsPublishScalarFunctionStreamingSchema,
2606
- Request.FunctionExecutionParamsPublishScalarFunctionNonStreamingSchema,
2537
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileStreamingSchema,
2538
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileNonStreamingSchema,
2607
2539
  ])
2608
- .describe("Parameters for executing and publishing an inline scalar function.")
2609
- .meta({ title: "FunctionExecutionParamsPublishScalarFunction" });
2610
- // Publish Vector Function
2611
- Request.FunctionExecutionParamsPublishVectorFunctionBaseSchema = Request.FunctionExecutionParamsBaseSchema.extend({
2612
- function: Function_1.VectorSchema,
2613
- publish_function: zod_1.default
2614
- .object({
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 and publishing an inline vector function and streaming the response.")
2549
+ .describe("Parameters for executing an inline function with a remote profile and streaming the response.")
2656
2550
  .meta({
2657
- title: "FunctionExecutionParamsPublishVectorFunctionStreaming",
2551
+ title: "FunctionExecutionParamsInlineFunctionRemoteProfileStreaming",
2658
2552
  });
2659
- Request.FunctionExecutionParamsPublishVectorFunctionNonStreamingSchema = Request.FunctionExecutionParamsPublishVectorFunctionBaseSchema.extend({
2553
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileNonStreamingSchema = Request.FunctionExecutionParamsInlineFunctionRemoteProfileBaseSchema.extend({
2660
2554
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2661
2555
  })
2662
- .describe("Parameters for executing and publishing an inline vector function with a unary response.")
2556
+ .describe("Parameters for executing an inline function with a remote profile with a unary response.")
2663
2557
  .meta({
2664
- title: "FunctionExecutionParamsPublishVectorFunctionNonStreaming",
2558
+ title: "FunctionExecutionParamsInlineFunctionRemoteProfileNonStreaming",
2665
2559
  });
2666
- Request.FunctionExecutionParamsPublishVectorFunctionSchema = zod_1.default
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.FunctionExecutionParamsPublishScalarFunctionStreamingSchema,
2677
- Request.FunctionExecutionParamsPublishVectorFunctionStreamingSchema,
2562
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileStreamingSchema,
2563
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileNonStreamingSchema,
2678
2564
  ])
2679
- .describe("Parameters for executing and publishing an inline function and streaming the response.")
2680
- .meta({ title: "FunctionExecutionParamsPublishFunctionStreaming" });
2681
- Request.FunctionExecutionParamsPublishFunctionNonStreamingSchema = zod_1.default
2682
- .union([
2683
- Request.FunctionExecutionParamsPublishScalarFunctionNonStreamingSchema,
2684
- Request.FunctionExecutionParamsPublishVectorFunctionNonStreamingSchema,
2685
- ])
2686
- .describe("Parameters for executing and publishing an inline function with a unary response.")
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 a remote published function, publishing a profile, and streaming the response.")
2723
- .meta({ title: "FunctionExecutionParamsPublishProfileStreaming" });
2724
- Request.FunctionExecutionParamsPublishProfileNonStreamingSchema = Request.FunctionExecutionParamsPublishProfileBaseSchema.extend({
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 a remote published function and publishing a profile with a unary response.")
2728
- .meta({ title: "FunctionExecutionParamsPublishProfileNonStreaming" });
2729
- Request.FunctionExecutionParamsPublishProfileSchema = zod_1.default
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.FunctionExecutionParamsPublishProfileStreamingSchema,
2732
- Request.FunctionExecutionParamsPublishProfileNonStreamingSchema,
2588
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileStreamingSchema,
2589
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileNonStreamingSchema,
2733
2590
  ])
2734
- .describe("Parameters for executing a remote published function and publishing a profile.")
2735
- .meta({ title: "FunctionExecutionParamsPublishProfile" });
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.ProfileVersionRequiredSchema)
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.ProfileVersionRequiredSchema)
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
- function_author: zod_1.default
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 author of the function the profile was published to."),
3317
- function_id: zod_1.default
3176
+ .describe("The name of the GitHub repository containing the profile."),
3177
+ commit: zod_1.default
3318
3178
  .string()
3319
- .describe("The unique identifier of the function the profile was published to."),
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, function_author, function_id, author, id, version, options) {
3371
- const response = await openai.get(version !== null && version !== undefined
3372
- ? `/functions/${function_author}/${function_id}/profiles/${author}/${id}/${version}/usage`
3373
- : `/functions/${function_author}/${function_id}/profiles/${author}/${id}/usage`, options);
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 executeInline(openai, body, options) {
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.executeInline = executeInline;
3384
- async function execute(openai, author, id, version, body, options) {
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(version !== null && version !== undefined
3387
- ? `/functions/${author}/${id}/${version}`
3388
- : `/functions/${author}/${id}`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
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.execute = execute;
3392
- async function publishFunction(openai, author, id, version, body, options) {
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(`/functions/${author}/${id}/${version}/publish`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
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.publishFunction = publishFunction;
3398
- async function publishProfile(openai, function_author, function_id, body, options) {
3229
+ Function_1.executeInlineFunctionRemoteProfile = executeInlineFunctionRemoteProfile;
3230
+ async function executeRemoteFunctionRemoteProfile(openai, fowner, frepository, fcommit, powner, prepository, pcommit, body, options) {
3399
3231
  var _a;
3400
- const response = await openai.post(`/functions/${function_author}/${function_id}/profiles/publish`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
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.publishProfile = publishProfile;
3404
- async function computeProfile(openai, author, id, version, body, options) {
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(version !== null && version !== undefined
3407
- ? `/functions/${author}/${id}/${version}/profiles/compute`
3408
- : `/functions/${author}/${id}/profiles/compute`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
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
- author: zod_1.default.string().describe("The author of the function."),
3414
- id: zod_1.default.string().describe("The unique identifier of the function."),
3415
- version: zod_1.default.uint32().describe("The version of the function."),
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, author, id, version, options) {
3468
- const response = await openai.get(version !== null && version !== undefined
3469
- ? `/functions/${author}/${id}/${version}/usage`
3470
- : `/functions/${author}/${id}/usage`, options);
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;