objectiveai 1.2.1 → 1.2.3

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 +194 -374
  2. package/dist/index.d.ts +11349 -15877
  3. package/dist/index.js +194 -374
  4. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -2113,62 +2113,54 @@ 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()
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.")
2149
2147
  .nullable()
2150
- .describe("The version of the profile."),
2148
+ .optional(),
2151
2149
  }),
2152
2150
  zod_1.default
2153
- .lazy(() => zod_1.default.array(Function_1.ProfileVersionOptionalSchema))
2151
+ .lazy(() => zod_1.default.array(Function_1.ProfileCommitOptionalSchema))
2154
2152
  .meta({
2155
- title: "ProfileVersionOptionalArray",
2153
+ title: "ProfileCommitOptionalArray",
2156
2154
  recursive: true,
2157
2155
  }),
2158
2156
  ])
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.");
2157
+ .describe("A function profile where remote profiles may omit a commit.");
2158
+ Function_1.ProfileCommitRequiredSchema = zod_1.default
2159
+ .union([Function_1.FunctionProfileCommitRequiredSchema, Function_1.VectorCompletionProfileSchema])
2160
+ .describe("A profile where remote function profiles must specify a commit.");
2161
+ Function_1.ProfileCommitOptionalSchema = zod_1.default
2162
+ .union([Function_1.FunctionProfileCommitOptionalSchema, Function_1.VectorCompletionProfileSchema])
2163
+ .describe("A profile where remote function profiles may omit a commit.");
2172
2164
  Function_1.InputSchemaSchema = zod_1.default.lazy(() => zod_1.default
2173
2165
  .union([
2174
2166
  InputSchema.ObjectSchema,
@@ -2386,15 +2378,15 @@ var Function;
2386
2378
  TaskExpression.ScalarFunctionSchema = zod_1.default
2387
2379
  .object({
2388
2380
  type: zod_1.default.literal("scalar.function"),
2389
- author: zod_1.default
2381
+ owner: zod_1.default
2390
2382
  .string()
2391
- .describe("The author of the remote published scalar function."),
2392
- id: zod_1.default
2383
+ .describe("The owner of the GitHub repository containing the function."),
2384
+ repository: zod_1.default
2393
2385
  .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."),
2386
+ .describe("The name of the GitHub repository containing the function."),
2387
+ commit: zod_1.default
2388
+ .string()
2389
+ .describe("The commit SHA of the GitHub repository containing the function."),
2398
2390
  skip: TaskExpression.SkipSchema.optional().nullable(),
2399
2391
  map: TaskExpression.MapSchema.optional().nullable(),
2400
2392
  input: Function_1.InputExpressionSchema,
@@ -2403,15 +2395,15 @@ var Function;
2403
2395
  TaskExpression.VectorFunctionSchema = zod_1.default
2404
2396
  .object({
2405
2397
  type: zod_1.default.literal("vector.function"),
2406
- author: zod_1.default
2398
+ owner: zod_1.default
2407
2399
  .string()
2408
- .describe("The author of the remote published vector function."),
2409
- id: zod_1.default
2400
+ .describe("The owner of the GitHub repository containing the function."),
2401
+ repository: zod_1.default
2410
2402
  .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."),
2403
+ .describe("The name of the GitHub repository containing the function."),
2404
+ commit: zod_1.default
2405
+ .string()
2406
+ .describe("The commit SHA of the GitHub repository containing the function."),
2415
2407
  skip: TaskExpression.SkipSchema.optional().nullable(),
2416
2408
  map: TaskExpression.MapSchema.optional().nullable(),
2417
2409
  input: Function_1.InputExpressionSchema,
@@ -2443,9 +2435,6 @@ var Function;
2443
2435
  Function_1.ScalarSchema = zod_1.default
2444
2436
  .object({
2445
2437
  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
2438
  description: zod_1.default
2450
2439
  .string()
2451
2440
  .describe("The description of the scalar function."),
@@ -2464,9 +2453,6 @@ var Function;
2464
2453
  Function_1.VectorSchema = zod_1.default
2465
2454
  .object({
2466
2455
  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
2456
  description: zod_1.default
2471
2457
  .string()
2472
2458
  .describe("The description of the vector function."),
@@ -2492,7 +2478,8 @@ var Function;
2492
2478
  (function (Executions) {
2493
2479
  let Request;
2494
2480
  (function (Request) {
2495
- Request.FunctionExecutionParamsBaseSchema = zod_1.default
2481
+ // Remote Function Remote Profile
2482
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema = zod_1.default
2496
2483
  .object({
2497
2484
  retry_token: zod_1.default
2498
2485
  .string()
@@ -2506,233 +2493,104 @@ var Function;
2506
2493
  first_chunk_timeout: Chat.Completions.Request.FirstChunkTimeoutSchema.optional().nullable(),
2507
2494
  other_chunk_timeout: Chat.Completions.Request.OtherChunkTimeoutSchema.optional().nullable(),
2508
2495
  })
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({
2516
- stream: Chat.Completions.Request.StreamTrueSchema,
2517
- })
2518
- .describe("Parameters for executing an inline function and streaming the response.")
2519
- .meta({ title: "FunctionExecutionParamsExecuteInlineStreaming" });
2520
- Request.FunctionExecutionParamsExecuteInlineNonStreamingSchema = Request.FunctionExecutionParamsExecuteInlineBaseSchema.extend({
2521
- stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2522
- })
2523
- .describe("Parameters for executing an inline function with a unary response.")
2524
- .meta({ title: "FunctionExecutionParamsExecuteInlineNonStreaming" });
2525
- Request.FunctionExecutionParamsExecuteInlineSchema = zod_1.default
2526
- .union([
2527
- Request.FunctionExecutionParamsExecuteInlineStreamingSchema,
2528
- Request.FunctionExecutionParamsExecuteInlineNonStreamingSchema,
2529
- ])
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({
2496
+ .describe("Base parameters for executing a remote function with a remote profile.");
2497
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
2537
2498
  stream: Chat.Completions.Request.StreamTrueSchema,
2538
2499
  })
2539
- .describe("Parameters for executing a remote published function and streaming the response.")
2540
- .meta({ title: "FunctionExecutionParamsExecuteStreaming" });
2541
- Request.FunctionExecutionParamsExecuteNonStreamingSchema = Request.FunctionExecutionParamsExecuteBaseSchema.extend({
2500
+ .describe("Parameters for executing a remote function with a remote profile and streaming the response.")
2501
+ .meta({
2502
+ title: "FunctionExecutionParamsRemoteFunctionRemoteProfileStreaming",
2503
+ });
2504
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileNonStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
2542
2505
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2543
2506
  })
2544
- .describe("Parameters for executing a remote published function with a unary response.")
2545
- .meta({ title: "FunctionExecutionParamsExecuteNonStreaming" });
2546
- Request.FunctionExecutionParamsExecuteSchema = zod_1.default
2507
+ .describe("Parameters for executing a remote function with a remote profile with a unary response.")
2508
+ .meta({
2509
+ title: "FunctionExecutionParamsRemoteFunctionRemoteProfileNonStreaming",
2510
+ });
2511
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileSchema = zod_1.default
2547
2512
  .union([
2548
- Request.FunctionExecutionParamsExecuteStreamingSchema,
2549
- Request.FunctionExecutionParamsExecuteNonStreamingSchema,
2513
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileStreamingSchema,
2514
+ Request.FunctionExecutionParamsRemoteFunctionRemoteProfileNonStreamingSchema,
2550
2515
  ])
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({
2516
+ .describe("Parameters for executing a remote function with a remote profile.")
2517
+ .meta({ title: "FunctionExecutionParamsRemoteFunctionRemoteProfile" });
2518
+ // Remote Function Inline Profile
2519
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileBaseSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
2520
+ profile: Function_1.FunctionProfileCommitOptionalSchema,
2521
+ }).describe("Base parameters for executing a remote function with an inline profile.");
2522
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionInlineProfileBaseSchema.extend({
2590
2523
  stream: Chat.Completions.Request.StreamTrueSchema,
2591
2524
  })
2592
- .describe("Parameters for executing and publishing an inline scalar function and streaming the response.")
2525
+ .describe("Parameters for executing a remote function with an inline profile and streaming the response.")
2593
2526
  .meta({
2594
- title: "FunctionExecutionParamsPublishScalarFunctionStreaming",
2527
+ title: "FunctionExecutionParamsRemoteFunctionInlineProfileStreaming",
2595
2528
  });
2596
- Request.FunctionExecutionParamsPublishScalarFunctionNonStreamingSchema = Request.FunctionExecutionParamsPublishScalarFunctionBaseSchema.extend({
2529
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileNonStreamingSchema = Request.FunctionExecutionParamsRemoteFunctionInlineProfileBaseSchema.extend({
2597
2530
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2598
2531
  })
2599
- .describe("Parameters for executing and publishing an inline scalar function with a unary response.")
2532
+ .describe("Parameters for executing a remote function with an inline profile with a unary response.")
2600
2533
  .meta({
2601
- title: "FunctionExecutionParamsPublishScalarFunctionNonStreaming",
2534
+ title: "FunctionExecutionParamsRemoteFunctionInlineProfileNonStreaming",
2602
2535
  });
2603
- Request.FunctionExecutionParamsPublishScalarFunctionSchema = zod_1.default
2536
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileSchema = zod_1.default
2604
2537
  .union([
2605
- Request.FunctionExecutionParamsPublishScalarFunctionStreamingSchema,
2606
- Request.FunctionExecutionParamsPublishScalarFunctionNonStreamingSchema,
2538
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileStreamingSchema,
2539
+ Request.FunctionExecutionParamsRemoteFunctionInlineProfileNonStreamingSchema,
2607
2540
  ])
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({
2541
+ .describe("Parameters for executing a remote function with an inline profile.")
2542
+ .meta({ title: "FunctionExecutionParamsRemoteFunctionInlineProfile" });
2543
+ // Inline Function Remote Profile
2544
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileBaseSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
2545
+ function: zod_1.default.lazy(() => exports.FunctionSchema),
2546
+ }).describe("Base parameters for executing an inline function with a remote profile.");
2547
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileStreamingSchema = Request.FunctionExecutionParamsInlineFunctionRemoteProfileBaseSchema.extend({
2653
2548
  stream: Chat.Completions.Request.StreamTrueSchema,
2654
2549
  })
2655
- .describe("Parameters for executing and publishing an inline vector function and streaming the response.")
2550
+ .describe("Parameters for executing an inline function with a remote profile and streaming the response.")
2656
2551
  .meta({
2657
- title: "FunctionExecutionParamsPublishVectorFunctionStreaming",
2552
+ title: "FunctionExecutionParamsInlineFunctionRemoteProfileStreaming",
2658
2553
  });
2659
- Request.FunctionExecutionParamsPublishVectorFunctionNonStreamingSchema = Request.FunctionExecutionParamsPublishVectorFunctionBaseSchema.extend({
2554
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileNonStreamingSchema = Request.FunctionExecutionParamsInlineFunctionRemoteProfileBaseSchema.extend({
2660
2555
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2661
2556
  })
2662
- .describe("Parameters for executing and publishing an inline vector function with a unary response.")
2557
+ .describe("Parameters for executing an inline function with a remote profile with a unary response.")
2663
2558
  .meta({
2664
- title: "FunctionExecutionParamsPublishVectorFunctionNonStreaming",
2559
+ title: "FunctionExecutionParamsInlineFunctionRemoteProfileNonStreaming",
2665
2560
  });
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
2561
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileSchema = zod_1.default
2675
2562
  .union([
2676
- Request.FunctionExecutionParamsPublishScalarFunctionStreamingSchema,
2677
- Request.FunctionExecutionParamsPublishVectorFunctionStreamingSchema,
2563
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileStreamingSchema,
2564
+ Request.FunctionExecutionParamsInlineFunctionRemoteProfileNonStreamingSchema,
2678
2565
  ])
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({
2566
+ .describe("Parameters for executing an inline function with a remote profile.")
2567
+ .meta({ title: "FunctionExecutionParamsInlineFunctionRemoteProfile" });
2568
+ // Inline Function Inline Profile
2569
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileBaseSchema = Request.FunctionExecutionParamsRemoteFunctionRemoteProfileBaseSchema.extend({
2570
+ function: zod_1.default.lazy(() => exports.FunctionSchema),
2571
+ profile: Function_1.FunctionProfileCommitOptionalSchema,
2572
+ }).describe("Base parameters for executing an inline function with an inline profile.");
2573
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileStreamingSchema = Request.FunctionExecutionParamsInlineFunctionInlineProfileBaseSchema.extend({
2720
2574
  stream: Chat.Completions.Request.StreamTrueSchema,
2721
2575
  })
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({
2576
+ .describe("Parameters for executing an inline function with an inline profile and streaming the response.")
2577
+ .meta({
2578
+ title: "FunctionExecutionParamsInlineFunctionInlineProfileStreaming",
2579
+ });
2580
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileNonStreamingSchema = Request.FunctionExecutionParamsInlineFunctionInlineProfileBaseSchema.extend({
2725
2581
  stream: Chat.Completions.Request.StreamFalseSchema.optional().nullable(),
2726
2582
  })
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
2583
+ .describe("Parameters for executing an inline function with an inline profile with a unary response.")
2584
+ .meta({
2585
+ title: "FunctionExecutionParamsInlineFunctionInlineProfileNonStreaming",
2586
+ });
2587
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileSchema = zod_1.default
2730
2588
  .union([
2731
- Request.FunctionExecutionParamsPublishProfileStreamingSchema,
2732
- Request.FunctionExecutionParamsPublishProfileNonStreamingSchema,
2589
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileStreamingSchema,
2590
+ Request.FunctionExecutionParamsInlineFunctionInlineProfileNonStreamingSchema,
2733
2591
  ])
2734
- .describe("Parameters for executing a remote published function and publishing a profile.")
2735
- .meta({ title: "FunctionExecutionParamsPublishProfile" });
2592
+ .describe("Parameters for executing an inline function with an inline profile.")
2593
+ .meta({ title: "FunctionExecutionParamsInlineFunctionInlineProfile" });
2736
2594
  })(Request = Executions.Request || (Executions.Request = {}));
2737
2595
  let Response;
2738
2596
  (function (Response) {
@@ -2862,8 +2720,6 @@ var Function;
2862
2720
  const [output, outputChanged] = merge(a.output, b.output);
2863
2721
  const [error, errorChanged] = merge(a.error, b.error);
2864
2722
  const [retry_token, retry_tokenChanged] = merge(a.retry_token, b.retry_token);
2865
- const [function_published, function_publishedChanged] = merge(a.function_published, b.function_published);
2866
- const [profile_published, profile_publishedChanged] = merge(a.profile_published, b.profile_published);
2867
2723
  const created = a.created;
2868
2724
  const function_ = a.function;
2869
2725
  const profile = a.profile;
@@ -2874,16 +2730,10 @@ var Function;
2874
2730
  outputChanged ||
2875
2731
  errorChanged ||
2876
2732
  retry_tokenChanged ||
2877
- function_publishedChanged ||
2878
- profile_publishedChanged ||
2879
2733
  usageChanged) {
2880
2734
  return [
2881
- Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id,
2882
- tasks }, (tasks_errors !== undefined ? { tasks_errors } : {})), (output !== undefined ? { output } : {})), (error !== undefined ? { error } : {})), (retry_token !== undefined ? { retry_token } : {})), (function_published !== undefined
2883
- ? { function_published }
2884
- : {})), (profile_published !== undefined
2885
- ? { profile_published }
2886
- : {})), { created, function: function_, profile,
2735
+ Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id,
2736
+ tasks }, (tasks_errors !== undefined ? { tasks_errors } : {})), (output !== undefined ? { output } : {})), (error !== undefined ? { error } : {})), (retry_token !== undefined ? { retry_token } : {})), { created, function: function_, profile,
2887
2737
  object }), (usage !== undefined ? { usage } : {})),
2888
2738
  true,
2889
2739
  ];
@@ -2923,14 +2773,6 @@ var Function;
2923
2773
  .string()
2924
2774
  .optional()
2925
2775
  .describe("A token which may be used to retry the function execution."),
2926
- function_published: zod_1.default
2927
- .boolean()
2928
- .optional()
2929
- .describe("When true, indicates that a function was published as part of this execution."),
2930
- profile_published: zod_1.default
2931
- .boolean()
2932
- .optional()
2933
- .describe("When true, indicates that a profile was published as part of this execution."),
2934
2776
  created: zod_1.default
2935
2777
  .uint32()
2936
2778
  .describe("The UNIX timestamp (in seconds) when the function execution chunk was created."),
@@ -3007,14 +2849,6 @@ var Function;
3007
2849
  .string()
3008
2850
  .nullable()
3009
2851
  .describe("A token which may be used to retry the function execution."),
3010
- function_published: zod_1.default
3011
- .boolean()
3012
- .optional()
3013
- .describe("When true, indicates that a function was published as part of this execution."),
3014
- profile_published: zod_1.default
3015
- .boolean()
3016
- .optional()
3017
- .describe("When true, indicates that a profile was published as part of this execution."),
3018
2852
  created: zod_1.default
3019
2853
  .uint32()
3020
2854
  .describe("The UNIX timestamp (in seconds) when the function execution chunk was created."),
@@ -3249,7 +3083,7 @@ var Function;
3249
3083
  .optional()
3250
3084
  .describe("When true, indicates that one or more function executions encountered errors during profile computation."),
3251
3085
  profile: zod_1.default
3252
- .array(Function_1.ProfileVersionRequiredSchema)
3086
+ .array(Function_1.ProfileCommitRequiredSchema)
3253
3087
  .optional()
3254
3088
  .describe("The computed function profile."),
3255
3089
  fitting_stats: Response.FittingStatsSchema.optional(),
@@ -3292,7 +3126,7 @@ var Function;
3292
3126
  .boolean()
3293
3127
  .describe("When true, indicates that one or more function executions encountered errors during profile computation."),
3294
3128
  profile: zod_1.default
3295
- .array(Function_1.ProfileVersionRequiredSchema)
3129
+ .array(Function_1.ProfileCommitRequiredSchema)
3296
3130
  .describe("The computed function profile."),
3297
3131
  fitting_stats: Response.FittingStatsSchema,
3298
3132
  created: zod_1.default
@@ -3311,48 +3145,21 @@ var Function;
3311
3145
  let Profile;
3312
3146
  (function (Profile) {
3313
3147
  Profile.ListItemSchema = zod_1.default.object({
3314
- function_author: zod_1.default
3148
+ owner: zod_1.default
3149
+ .string()
3150
+ .describe("The owner of the GitHub repository containing the profile."),
3151
+ repository: zod_1.default
3315
3152
  .string()
3316
- .describe("The author of the function the profile was published to."),
3317
- function_id: zod_1.default
3153
+ .describe("The name of the GitHub repository containing the profile."),
3154
+ commit: zod_1.default
3318
3155
  .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."),
3156
+ .describe("The commit SHA of the GitHub repository containing the profile."),
3323
3157
  });
3324
3158
  async function list(openai, options) {
3325
3159
  const response = await openai.get("/functions/profiles", options);
3326
3160
  return response;
3327
3161
  }
3328
3162
  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
3163
  Profile.HistoricalUsageSchema = zod_1.default.object({
3357
3164
  requests: zod_1.default
3358
3165
  .uint32()
@@ -3367,89 +3174,102 @@ var Function;
3367
3174
  .number()
3368
3175
  .describe("The total cost incurred by using this Profile."),
3369
3176
  });
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);
3177
+ async function retrieveUsage(openai, powner, prepository, pcommit, options) {
3178
+ const response = await openai.get(pcommit !== null && pcommit !== undefined
3179
+ ? `/functions/profiles/${powner}/${prepository}/${pcommit}/usage`
3180
+ : `/functions/profiles/${powner}/${prepository}/usage`, options);
3374
3181
  return response;
3375
3182
  }
3376
3183
  Profile.retrieveUsage = retrieveUsage;
3377
3184
  })(Profile = Function_1.Profile || (Function_1.Profile = {}));
3378
- async function executeInline(openai, body, options) {
3185
+ async function executeInlineFunctionInlineProfile(openai, body, options) {
3379
3186
  var _a;
3380
3187
  const response = await openai.post("/functions", Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3381
3188
  return response;
3382
3189
  }
3383
- Function_1.executeInline = executeInline;
3384
- async function execute(openai, author, id, version, body, options) {
3190
+ Function_1.executeInlineFunctionInlineProfile = executeInlineFunctionInlineProfile;
3191
+ async function executeRemoteFunctionInlineProfile(openai, fowner, frepository, fcommit, body, options) {
3385
3192
  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));
3193
+ const response = await openai.post(fcommit !== null && fcommit !== undefined
3194
+ ? `/functions/${fowner}/${frepository}/${fcommit}`
3195
+ : `/functions/${fowner}/${frepository}`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3389
3196
  return response;
3390
3197
  }
3391
- Function_1.execute = execute;
3392
- async function publishFunction(openai, author, id, version, body, options) {
3198
+ Function_1.executeRemoteFunctionInlineProfile = executeRemoteFunctionInlineProfile;
3199
+ async function executeInlineFunctionRemoteProfile(openai, powner, prepository, pcommit, body, options) {
3393
3200
  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));
3201
+ const response = await openai.post(pcommit !== null && pcommit !== undefined
3202
+ ? `/functions/profiles/${powner}/${prepository}/${pcommit}`
3203
+ : `/functions/profiles/${powner}/${prepository}`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3395
3204
  return response;
3396
3205
  }
3397
- Function_1.publishFunction = publishFunction;
3398
- async function publishProfile(openai, function_author, function_id, body, options) {
3206
+ Function_1.executeInlineFunctionRemoteProfile = executeInlineFunctionRemoteProfile;
3207
+ async function executeRemoteFunctionRemoteProfile(openai, fowner, frepository, fcommit, powner, prepository, pcommit, body, options) {
3399
3208
  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));
3209
+ let url;
3210
+ if (fcommit !== null && fcommit !== undefined) {
3211
+ if (pcommit !== null && pcommit !== undefined) {
3212
+ url = `/functions/${fowner}/${frepository}/${fcommit}/profiles/${powner}/${prepository}/${pcommit}`;
3213
+ }
3214
+ else {
3215
+ url = `/functions/${fowner}/${frepository}/${fcommit}/profiles/${powner}/${prepository}`;
3216
+ }
3217
+ }
3218
+ else if (pcommit !== null && pcommit !== undefined) {
3219
+ url = `/functions/${fowner}/${frepository}/profiles/${powner}/${prepository}/${pcommit}`;
3220
+ }
3221
+ else {
3222
+ url = `/functions/${fowner}/${frepository}/profiles/${powner}/${prepository}`;
3223
+ }
3224
+ const response = await openai.post(url, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3401
3225
  return response;
3402
3226
  }
3403
- Function_1.publishProfile = publishProfile;
3404
- async function computeProfile(openai, author, id, version, body, options) {
3227
+ Function_1.executeRemoteFunctionRemoteProfile = executeRemoteFunctionRemoteProfile;
3228
+ async function execute(openai, function_, profile, body, options) {
3229
+ if ("owner" in function_ && "repository" in function_) {
3230
+ if ("owner" in profile && "repository" in profile) {
3231
+ const requestBody = body;
3232
+ return executeRemoteFunctionRemoteProfile(openai, function_.owner, function_.repository, function_.commit, profile.owner, profile.repository, profile.commit, requestBody, options);
3233
+ }
3234
+ else {
3235
+ const requestBody = Object.assign(Object.assign({}, body), { profile });
3236
+ return executeRemoteFunctionInlineProfile(openai, function_.owner, function_.repository, function_.commit, requestBody, options);
3237
+ }
3238
+ }
3239
+ else if ("owner" in profile && "repository" in profile) {
3240
+ const requestBody = Object.assign(Object.assign({}, body), { function: function_ });
3241
+ return executeInlineFunctionRemoteProfile(openai, profile.owner, profile.repository, profile.commit, requestBody, options);
3242
+ }
3243
+ else {
3244
+ const requestBody = Object.assign(Object.assign({}, body), { function: function_, profile });
3245
+ return executeInlineFunctionInlineProfile(openai, requestBody, options);
3246
+ }
3247
+ }
3248
+ Function_1.execute = execute;
3249
+ async function computeProfile(openai, fowner, frepository, fcommit, body, options) {
3405
3250
  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));
3251
+ const response = await openai.post(fcommit !== null && fcommit !== undefined
3252
+ ? `/functions/${fowner}/${frepository}/${fcommit}/profiles/compute`
3253
+ : `/functions/${fowner}/${frepository}/profiles/compute`, Object.assign({ body, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false }, options));
3409
3254
  return response;
3410
3255
  }
3411
3256
  Function_1.computeProfile = computeProfile;
3412
3257
  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."),
3258
+ owner: zod_1.default
3259
+ .string()
3260
+ .describe("The owner of the GitHub repository containing the function."),
3261
+ repository: zod_1.default
3262
+ .string()
3263
+ .describe("The name of the GitHub repository containing the function."),
3264
+ commit: zod_1.default
3265
+ .string()
3266
+ .describe("The commit SHA of the GitHub repository containing the function."),
3416
3267
  });
3417
3268
  async function list(openai, options) {
3418
3269
  const response = await openai.get("/functions", options);
3419
3270
  return response;
3420
3271
  }
3421
3272
  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
3273
  Function_1.HistoricalUsageSchema = zod_1.default.object({
3454
3274
  requests: zod_1.default
3455
3275
  .uint32()
@@ -3464,10 +3284,10 @@ var Function;
3464
3284
  .number()
3465
3285
  .describe("The total cost incurred by using this Function."),
3466
3286
  });
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);
3287
+ async function retrieveUsage(openai, fowner, frepository, fcommit, options) {
3288
+ const response = await openai.get(fcommit !== null && fcommit !== undefined
3289
+ ? `/functions/${fowner}/${frepository}/${fcommit}/usage`
3290
+ : `/functions/${fowner}/${frepository}/usage`, options);
3471
3291
  return response;
3472
3292
  }
3473
3293
  Function_1.retrieveUsage = retrieveUsage;