braintrust 3.28.0 → 3.30.0

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 (54) hide show
  1. package/README.md +1 -1
  2. package/dev/dist/index.d.mts +356 -7
  3. package/dev/dist/index.d.ts +356 -7
  4. package/dev/dist/index.js +2679 -1828
  5. package/dev/dist/index.mjs +1862 -1011
  6. package/dist/apply-auto-instrumentation.js +298 -265
  7. package/dist/apply-auto-instrumentation.mjs +85 -52
  8. package/dist/auto-instrumentations/bundler/esbuild.cjs +56 -6
  9. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  10. package/dist/auto-instrumentations/bundler/next.cjs +56 -6
  11. package/dist/auto-instrumentations/bundler/next.mjs +3 -3
  12. package/dist/auto-instrumentations/bundler/rollup.cjs +56 -6
  13. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  14. package/dist/auto-instrumentations/bundler/vite.cjs +56 -6
  15. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  16. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +56 -6
  17. package/dist/auto-instrumentations/bundler/webpack.cjs +56 -6
  18. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
  19. package/dist/auto-instrumentations/{chunk-26PKVUKB.mjs → chunk-LW4HDHXT.mjs} +12 -4
  20. package/dist/auto-instrumentations/{chunk-HD35AM3M.mjs → chunk-OXINGIEZ.mjs} +1 -1
  21. package/dist/auto-instrumentations/{chunk-NP7V4XB2.mjs → chunk-U64OYU4Q.mjs} +45 -3
  22. package/dist/auto-instrumentations/hook.mjs +967 -136
  23. package/dist/auto-instrumentations/index.cjs +45 -3
  24. package/dist/auto-instrumentations/index.mjs +1 -1
  25. package/dist/browser.d.mts +893 -24
  26. package/dist/browser.d.ts +893 -24
  27. package/dist/browser.js +2795 -1136
  28. package/dist/browser.mjs +2795 -1136
  29. package/dist/{chunk-BBE7SNRV.js → chunk-2XDW3UCG.js} +155 -23
  30. package/dist/{chunk-UPFNQCGB.mjs → chunk-BU6SM54N.mjs} +1830 -1045
  31. package/dist/{chunk-ZHUHZWFY.mjs → chunk-N3JKQ3D3.mjs} +152 -20
  32. package/dist/{chunk-OBBWQW6K.js → chunk-TWCDSYJN.js} +2890 -2105
  33. package/dist/cli.js +5976 -1348
  34. package/dist/edge-light.d.mts +1 -1
  35. package/dist/edge-light.d.ts +1 -1
  36. package/dist/edge-light.js +2795 -1136
  37. package/dist/edge-light.mjs +2795 -1136
  38. package/dist/index.d.mts +893 -24
  39. package/dist/index.d.ts +893 -24
  40. package/dist/index.js +1448 -699
  41. package/dist/index.mjs +848 -99
  42. package/dist/instrumentation/index.d.mts +563 -9
  43. package/dist/instrumentation/index.d.ts +563 -9
  44. package/dist/instrumentation/index.js +2794 -989
  45. package/dist/instrumentation/index.mjs +2794 -989
  46. package/dist/vitest-evals-reporter.js +16 -16
  47. package/dist/vitest-evals-reporter.mjs +2 -2
  48. package/dist/workerd.d.mts +1 -1
  49. package/dist/workerd.d.ts +1 -1
  50. package/dist/workerd.js +2795 -1136
  51. package/dist/workerd.mjs +2795 -1136
  52. package/package.json +1 -1
  53. package/util/dist/index.d.mts +42 -0
  54. package/util/dist/index.d.ts +42 -0
@@ -6550,6 +6550,15 @@ declare const PromptData: z.ZodObject<{
6550
6550
  type: "global";
6551
6551
  name: string;
6552
6552
  function_type?: "preprocessor" | undefined;
6553
+ }>, z.ZodObject<{
6554
+ type: z.ZodLiteral<"inline">;
6555
+ code: z.ZodString;
6556
+ }, "strip", z.ZodTypeAny, {
6557
+ code: string;
6558
+ type: "inline";
6559
+ }, {
6560
+ code: string;
6561
+ type: "inline";
6553
6562
  }>, z.ZodNull]>>;
6554
6563
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
6555
6564
  type: z.ZodLiteral<"function">;
@@ -6860,6 +6869,9 @@ declare const PromptData: z.ZodObject<{
6860
6869
  type: "global";
6861
6870
  name: string;
6862
6871
  function_type: "preprocessor";
6872
+ } | {
6873
+ code: string;
6874
+ type: "inline";
6863
6875
  } | null | undefined;
6864
6876
  origin?: {
6865
6877
  project_id?: string | undefined;
@@ -7134,6 +7146,9 @@ declare const PromptData: z.ZodObject<{
7134
7146
  type: "global";
7135
7147
  name: string;
7136
7148
  function_type?: "preprocessor" | undefined;
7149
+ } | {
7150
+ code: string;
7151
+ type: "inline";
7137
7152
  } | null | undefined;
7138
7153
  origin?: {
7139
7154
  project_id?: string | undefined;
@@ -8579,6 +8594,15 @@ declare const Prompt$1: z.ZodObject<{
8579
8594
  type: "global";
8580
8595
  name: string;
8581
8596
  function_type?: "preprocessor" | undefined;
8597
+ }>, z.ZodObject<{
8598
+ type: z.ZodLiteral<"inline">;
8599
+ code: z.ZodString;
8600
+ }, "strip", z.ZodTypeAny, {
8601
+ code: string;
8602
+ type: "inline";
8603
+ }, {
8604
+ code: string;
8605
+ type: "inline";
8582
8606
  }>, z.ZodNull]>>;
8583
8607
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
8584
8608
  type: z.ZodLiteral<"function">;
@@ -8889,6 +8913,9 @@ declare const Prompt$1: z.ZodObject<{
8889
8913
  type: "global";
8890
8914
  name: string;
8891
8915
  function_type: "preprocessor";
8916
+ } | {
8917
+ code: string;
8918
+ type: "inline";
8892
8919
  } | null | undefined;
8893
8920
  origin?: {
8894
8921
  project_id?: string | undefined;
@@ -9163,6 +9190,9 @@ declare const Prompt$1: z.ZodObject<{
9163
9190
  type: "global";
9164
9191
  name: string;
9165
9192
  function_type?: "preprocessor" | undefined;
9193
+ } | {
9194
+ code: string;
9195
+ type: "inline";
9166
9196
  } | null | undefined;
9167
9197
  origin?: {
9168
9198
  project_id?: string | undefined;
@@ -9454,6 +9484,9 @@ declare const Prompt$1: z.ZodObject<{
9454
9484
  type: "global";
9455
9485
  name: string;
9456
9486
  function_type: "preprocessor";
9487
+ } | {
9488
+ code: string;
9489
+ type: "inline";
9457
9490
  } | null | undefined;
9458
9491
  origin?: {
9459
9492
  project_id?: string | undefined;
@@ -9742,6 +9775,9 @@ declare const Prompt$1: z.ZodObject<{
9742
9775
  type: "global";
9743
9776
  name: string;
9744
9777
  function_type?: "preprocessor" | undefined;
9778
+ } | {
9779
+ code: string;
9780
+ type: "inline";
9745
9781
  } | null | undefined;
9746
9782
  origin?: {
9747
9783
  project_id?: string | undefined;
@@ -9992,7 +10028,6 @@ declare class LazyValue<T> {
9992
10028
  type TemplateFormat = "mustache" | "nunjucks" | "none";
9993
10029
 
9994
10030
  interface GlobalHookAsyncLocalStorage<T> {
9995
- enterWith(store: T): void;
9996
10031
  run<R>(store: T | undefined, callback: () => R): R;
9997
10032
  getStore(): T | undefined;
9998
10033
  }
@@ -10158,6 +10193,14 @@ interface PromptKey {
10158
10193
  */
10159
10194
  id?: string;
10160
10195
  }
10196
+ type PromptMemoryCacheEntry = {
10197
+ value: Prompt;
10198
+ resolvedOrgIdentity?: string;
10199
+ };
10200
+ type PromptDiskCacheEntry = {
10201
+ value: ReturnType<Prompt["_internalSerializeForCache"]>;
10202
+ resolvedOrgIdentity?: string;
10203
+ };
10161
10204
  /**
10162
10205
  * A configurable cache for Braintrust prompts with optional in-memory and filesystem storage.
10163
10206
  *
@@ -10166,10 +10209,19 @@ interface PromptKey {
10166
10209
  declare class PromptCache {
10167
10210
  private readonly memoryCache?;
10168
10211
  private readonly diskCache?;
10212
+ private readonly namespace?;
10213
+ private readonly expectedResolvedOrgIdentity?;
10169
10214
  constructor(options: {
10170
- memoryCache?: LRUCache<string, Prompt>;
10171
- diskCache?: DiskCache<Prompt>;
10215
+ memoryCache?: LRUCache<string, PromptMemoryCacheEntry>;
10216
+ diskCache?: DiskCache<PromptDiskCacheEntry>;
10217
+ namespace?: string;
10218
+ expectedResolvedOrgIdentity?: string;
10172
10219
  });
10220
+ /**
10221
+ * Returns a cache view that shares the same storage layers but isolates all
10222
+ * entries under the provided namespace.
10223
+ */
10224
+ withNamespace(namespace: string, expectedResolvedOrgIdentity?: string): PromptCache;
10173
10225
  /**
10174
10226
  * Retrieves a prompt from the cache.
10175
10227
  * First checks the in-memory LRU cache, then falls back to checking the disk cache if available.
@@ -10193,13 +10245,26 @@ interface ParametersKey {
10193
10245
  projectName?: string;
10194
10246
  id?: string;
10195
10247
  }
10248
+ type ParametersMemoryCacheEntry = {
10249
+ value: RemoteEvalParameters;
10250
+ resolvedOrgIdentity?: string;
10251
+ };
10252
+ type ParametersDiskCacheEntry = {
10253
+ value: ReturnType<RemoteEvalParameters["_internalSerializeForCache"]>;
10254
+ resolvedOrgIdentity?: string;
10255
+ };
10196
10256
  declare class ParametersCache {
10197
10257
  private readonly memoryCache?;
10198
10258
  private readonly diskCache?;
10259
+ private readonly namespace?;
10260
+ private readonly expectedResolvedOrgIdentity?;
10199
10261
  constructor(options: {
10200
- memoryCache?: LRUCache<string, RemoteEvalParameters>;
10201
- diskCache?: DiskCache<RemoteEvalParameters>;
10262
+ memoryCache?: LRUCache<string, ParametersMemoryCacheEntry>;
10263
+ diskCache?: DiskCache<ParametersDiskCacheEntry>;
10264
+ namespace?: string;
10265
+ expectedResolvedOrgIdentity?: string;
10202
10266
  });
10267
+ withNamespace(namespace: string, expectedResolvedOrgIdentity?: string): ParametersCache;
10203
10268
  get(key: ParametersKey): Promise<RemoteEvalParameters | undefined>;
10204
10269
  set(key: ParametersKey, value: RemoteEvalParameters): Promise<void>;
10205
10270
  }
@@ -12569,8 +12634,17 @@ declare const loginSchema: z.ZodObject<{
12569
12634
  debugLogLevelDisabled?: boolean | undefined;
12570
12635
  }>;
12571
12636
  type SerializedBraintrustState = z.infer<typeof loginSchema>;
12637
+ type ResolvedLoaderLoginOptions = Required<Pick<LoginOptions, "apiKey" | "appUrl" | "fetch">> & Pick<LoginOptions, "orgName"> & {
12638
+ forceLogin?: boolean;
12639
+ credentialCacheNamespace: string;
12640
+ existingState?: BraintrustState;
12641
+ };
12642
+ type LoaderCacheViews = {
12643
+ promptCache: PromptCache;
12644
+ parametersCache: ParametersCache;
12645
+ };
12646
+ type LoaderRequestState = Pick<BraintrustState, "appUrl" | "orgId" | "apiConn">;
12572
12647
  declare class BraintrustState {
12573
- private loginParams;
12574
12648
  id: string;
12575
12649
  currentExperiment: Experiment | undefined;
12576
12650
  currentLogger: Logger<false> | undefined;
@@ -12601,12 +12675,23 @@ declare class BraintrustState {
12601
12675
  private _otelFlushCallback;
12602
12676
  spanOriginEnvironment: SpanOriginEnvironment | undefined;
12603
12677
  private traceContextSigningSecret;
12678
+ private loaderLoginCache;
12679
+ private readonly loginParams;
12680
+ private activeLoginOrgNameSelector;
12604
12681
  constructor(loginParams: LoginOptions);
12605
12682
  /** @internal */
12606
12683
  _internalSetTraceContextSigningSecret(secret: string | undefined): void;
12607
12684
  /** @internal */
12608
12685
  _internalGetTraceContextSigningSecret(): string | undefined;
12609
12686
  resetLoginInfo(): void;
12687
+ /** @internal */
12688
+ _internalResolveLoaderLoginOptions({ apiKey, appUrl, orgName, fetch, forceLogin, }: Pick<LoginOptions, "apiKey" | "appUrl" | "orgName" | "fetch"> & {
12689
+ forceLogin?: boolean;
12690
+ }): Promise<ResolvedLoaderLoginOptions>;
12691
+ /** @internal */
12692
+ _internalGetLoaderCacheViews(loginOptions: ResolvedLoaderLoginOptions, requestState?: LoaderRequestState): LoaderCacheViews;
12693
+ /** @internal */
12694
+ _internalGetLoaderState({ apiKey, appUrl, orgName, fetch, forceLogin, existingState, }: ResolvedLoaderLoginOptions): Promise<LoaderRequestState>;
12610
12695
  resetIdGenState(): void;
12611
12696
  [RESET_CONTEXT_MANAGER_STATE](): void;
12612
12697
  get idGenerator(): IDGenerator;
@@ -12645,11 +12730,12 @@ declare class BraintrustState {
12645
12730
  toString(): string;
12646
12731
  }
12647
12732
  declare class HTTPConnection {
12733
+ private readonly classifyTransportErrors;
12648
12734
  base_url: string;
12649
12735
  token: string | null;
12650
12736
  headers: Record<string, string>;
12651
12737
  fetch: typeof globalThis.fetch;
12652
- constructor(base_url: string, fetch: typeof globalThis.fetch);
12738
+ constructor(base_url: string, fetch: typeof globalThis.fetch, classifyTransportErrors?: boolean);
12653
12739
  setFetch(fetch: typeof globalThis.fetch): void;
12654
12740
  ping(): Promise<boolean>;
12655
12741
  make_long_lived(): void;
@@ -13339,6 +13425,251 @@ declare class Prompt<HasId extends boolean = true, HasVersion extends boolean =
13339
13425
  }): PromptBlockDataType;
13340
13426
  private getParsedPromptData;
13341
13427
  static isPrompt(data: unknown): data is Prompt<boolean, boolean>;
13428
+ /** @internal */
13429
+ _internalSerializeForCache(): {
13430
+ metadata: {
13431
+ _xact_id: string;
13432
+ created: string;
13433
+ id: string;
13434
+ prompt_session_id: string;
13435
+ project_id: string;
13436
+ function_data?: unknown;
13437
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | null | undefined;
13438
+ tags?: string[] | null | undefined;
13439
+ _pagination_key?: string | null | undefined;
13440
+ completion?: unknown;
13441
+ prompt_data?: unknown;
13442
+ prompt_session_data?: unknown;
13443
+ object_data?: unknown;
13444
+ } | PromptRowWithId<HasId, HasVersion>;
13445
+ defaults: Partial<Omit<z.objectOutputType<{
13446
+ use_cache: z.ZodOptional<z.ZodBoolean>;
13447
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
13448
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
13449
+ temperature: z.ZodOptional<z.ZodNumber>;
13450
+ top_p: z.ZodOptional<z.ZodNumber>;
13451
+ max_tokens: z.ZodOptional<z.ZodNumber>;
13452
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
13453
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
13454
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
13455
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
13456
+ type: z.ZodLiteral<"json_object">;
13457
+ }, "strip", z.ZodTypeAny, {
13458
+ type: "json_object";
13459
+ }, {
13460
+ type: "json_object";
13461
+ }>, z.ZodObject<{
13462
+ type: z.ZodLiteral<"json_schema">;
13463
+ json_schema: z.ZodObject<{
13464
+ name: z.ZodString;
13465
+ description: z.ZodOptional<z.ZodString>;
13466
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
13467
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
13468
+ }, "strip", z.ZodTypeAny, {
13469
+ name: string;
13470
+ description?: string | undefined;
13471
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13472
+ strict?: boolean | null | undefined;
13473
+ }, {
13474
+ name: string;
13475
+ description?: string | undefined;
13476
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13477
+ strict?: boolean | null | undefined;
13478
+ }>;
13479
+ }, "strip", z.ZodTypeAny, {
13480
+ type: "json_schema";
13481
+ json_schema: {
13482
+ name: string;
13483
+ description?: string | undefined;
13484
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13485
+ strict?: boolean | null | undefined;
13486
+ };
13487
+ }, {
13488
+ type: "json_schema";
13489
+ json_schema: {
13490
+ name: string;
13491
+ description?: string | undefined;
13492
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13493
+ strict?: boolean | null | undefined;
13494
+ };
13495
+ }>, z.ZodObject<{
13496
+ type: z.ZodLiteral<"text">;
13497
+ }, "strip", z.ZodTypeAny, {
13498
+ type: "text";
13499
+ }, {
13500
+ type: "text";
13501
+ }>, z.ZodNull]>>;
13502
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
13503
+ type: z.ZodLiteral<"function">;
13504
+ function: z.ZodObject<{
13505
+ name: z.ZodString;
13506
+ }, "strip", z.ZodTypeAny, {
13507
+ name: string;
13508
+ }, {
13509
+ name: string;
13510
+ }>;
13511
+ }, "strip", z.ZodTypeAny, {
13512
+ function: {
13513
+ name: string;
13514
+ };
13515
+ type: "function";
13516
+ }, {
13517
+ function: {
13518
+ name: string;
13519
+ };
13520
+ type: "function";
13521
+ }>]>>;
13522
+ function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
13523
+ name: z.ZodString;
13524
+ }, "strip", z.ZodTypeAny, {
13525
+ name: string;
13526
+ }, {
13527
+ name: string;
13528
+ }>]>>;
13529
+ n: z.ZodOptional<z.ZodNumber>;
13530
+ stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13531
+ reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
13532
+ verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
13533
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
13534
+ use_cache: z.ZodOptional<z.ZodBoolean>;
13535
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
13536
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
13537
+ max_tokens: z.ZodNumber;
13538
+ temperature: z.ZodNumber;
13539
+ top_p: z.ZodOptional<z.ZodNumber>;
13540
+ top_k: z.ZodOptional<z.ZodNumber>;
13541
+ stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13542
+ max_tokens_to_sample: z.ZodOptional<z.ZodNumber>;
13543
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
13544
+ use_cache: z.ZodOptional<z.ZodBoolean>;
13545
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
13546
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
13547
+ temperature: z.ZodOptional<z.ZodNumber>;
13548
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
13549
+ topP: z.ZodOptional<z.ZodNumber>;
13550
+ topK: z.ZodOptional<z.ZodNumber>;
13551
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
13552
+ use_cache: z.ZodOptional<z.ZodBoolean>;
13553
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
13554
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
13555
+ temperature: z.ZodOptional<z.ZodNumber>;
13556
+ topK: z.ZodOptional<z.ZodNumber>;
13557
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
13558
+ use_cache: z.ZodOptional<z.ZodBoolean>;
13559
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
13560
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
13561
+ }, z.ZodTypeAny, "passthrough"> | undefined, "response_format" | "reasoning_effort" | "use_cache"> & Omit<{
13562
+ max_tokens: number;
13563
+ temperature?: number | undefined;
13564
+ top_p?: number | undefined;
13565
+ max_completion_tokens?: number | undefined;
13566
+ frequency_penalty?: number | undefined;
13567
+ presence_penalty?: number | undefined;
13568
+ response_format?: {
13569
+ type: "json_object";
13570
+ } | {
13571
+ type: "json_schema";
13572
+ json_schema: {
13573
+ name: string;
13574
+ description?: string | undefined;
13575
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13576
+ strict?: boolean | null | undefined;
13577
+ };
13578
+ } | {
13579
+ type: "text";
13580
+ } | null | undefined;
13581
+ tool_choice?: "auto" | "none" | "required" | {
13582
+ function: {
13583
+ name: string;
13584
+ };
13585
+ type: "function";
13586
+ } | undefined;
13587
+ function_call?: "auto" | "none" | {
13588
+ name: string;
13589
+ } | undefined;
13590
+ n?: number | undefined;
13591
+ stop?: string[] | undefined;
13592
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | undefined;
13593
+ verbosity?: "low" | "medium" | "high" | undefined;
13594
+ top_k?: number | undefined;
13595
+ stop_sequences?: string[] | undefined;
13596
+ reasoning_enabled?: boolean | undefined;
13597
+ reasoning_budget?: number | undefined;
13598
+ max_tokens_to_sample?: number | undefined;
13599
+ maxOutputTokens?: number | undefined;
13600
+ topP?: number | undefined;
13601
+ topK?: number | undefined;
13602
+ use_cache?: boolean | undefined;
13603
+ }, "response_format" | "reasoning_effort" | "use_cache"> & {
13604
+ reasoning_effort?: CompiledPromptReasoningEffort;
13605
+ response_format?: {
13606
+ type: "json_object";
13607
+ } | {
13608
+ type: "text";
13609
+ } | (Omit<{
13610
+ type: "json_schema";
13611
+ json_schema: {
13612
+ name: string;
13613
+ description?: string | undefined;
13614
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13615
+ strict?: boolean | null | undefined;
13616
+ };
13617
+ }, "json_schema"> & {
13618
+ json_schema: Omit<{
13619
+ name: string;
13620
+ description?: string | undefined;
13621
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13622
+ strict?: boolean | null | undefined;
13623
+ }, "schema"> & {
13624
+ schema?: Record<string, unknown> | undefined;
13625
+ };
13626
+ }) | undefined;
13627
+ model: string;
13628
+ } & {
13629
+ max_tokens: number;
13630
+ temperature?: number | undefined;
13631
+ top_p?: number | undefined;
13632
+ max_completion_tokens?: number | undefined;
13633
+ frequency_penalty?: number | undefined;
13634
+ presence_penalty?: number | undefined;
13635
+ response_format?: {
13636
+ type: "json_object";
13637
+ } | {
13638
+ type: "json_schema";
13639
+ json_schema: {
13640
+ name: string;
13641
+ description?: string | undefined;
13642
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13643
+ strict?: boolean | null | undefined;
13644
+ };
13645
+ } | {
13646
+ type: "text";
13647
+ } | null | undefined;
13648
+ tool_choice?: "auto" | "none" | "required" | {
13649
+ function: {
13650
+ name: string;
13651
+ };
13652
+ type: "function";
13653
+ } | undefined;
13654
+ function_call?: "auto" | "none" | {
13655
+ name: string;
13656
+ } | undefined;
13657
+ n?: number | undefined;
13658
+ stop?: string[] | undefined;
13659
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | undefined;
13660
+ verbosity?: "low" | "medium" | "high" | undefined;
13661
+ top_k?: number | undefined;
13662
+ stop_sequences?: string[] | undefined;
13663
+ reasoning_enabled?: boolean | undefined;
13664
+ reasoning_budget?: number | undefined;
13665
+ max_tokens_to_sample?: number | undefined;
13666
+ maxOutputTokens?: number | undefined;
13667
+ topP?: number | undefined;
13668
+ topK?: number | undefined;
13669
+ use_cache?: boolean | undefined;
13670
+ } & ChatPrompt & CompletionPrompt>;
13671
+ noTrace: boolean;
13672
+ };
13342
13673
  static fromPromptData(name: string, promptData: PromptDataType): Prompt<false, false>;
13343
13674
  }
13344
13675
  declare class RemoteEvalParameters<HasId extends boolean = true, HasVersion extends boolean = true, T extends Record<string, unknown> = Record<string, unknown>> {
@@ -13352,6 +13683,24 @@ declare class RemoteEvalParameters<HasId extends boolean = true, HasVersion exte
13352
13683
  get version(): HasVersion extends true ? TransactionId : TransactionId | undefined;
13353
13684
  get schema(): Record<string, unknown>;
13354
13685
  get data(): T;
13686
+ /** @internal */
13687
+ _internalSerializeForCache(): {
13688
+ metadata: {
13689
+ _xact_id: string;
13690
+ id: string;
13691
+ project_id: string;
13692
+ function_data: {
13693
+ type: "parameters";
13694
+ __schema: Record<string, unknown>;
13695
+ data?: Record<string, unknown> | undefined;
13696
+ };
13697
+ name: string;
13698
+ slug: string;
13699
+ function_type: "parameters";
13700
+ description?: string | null | undefined;
13701
+ metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
13702
+ };
13703
+ };
13355
13704
  validate(data: unknown): boolean;
13356
13705
  static isParameters(x: unknown): x is RemoteEvalParameters<boolean, boolean, Record<string, unknown>>;
13357
13706
  }