ai 3.2.35 → 3.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -214,7 +214,7 @@ has a limit on how many embeddings can be generated in a single call.
214
214
 
215
215
  @returns A result object that contains the embeddings, the value, and additional information.
216
216
  */
217
- declare function embedMany<VALUE>({ model, values, maxRetries, abortSignal, headers, }: {
217
+ declare function embedMany<VALUE>({ model, values, maxRetries, abortSignal, headers, experimental_telemetry: telemetry, }: {
218
218
  /**
219
219
  The embedding model to use.
220
220
  */
@@ -238,6 +238,10 @@ declare function embedMany<VALUE>({ model, values, maxRetries, abortSignal, head
238
238
  Only applicable for HTTP-based providers.
239
239
  */
240
240
  headers?: Record<string, string>;
241
+ /**
242
+ * Optional telemetry configuration (experimental).
243
+ */
244
+ experimental_telemetry?: TelemetrySettings;
241
245
  }): Promise<EmbedManyResult<VALUE>>;
242
246
 
243
247
  type CallSettings = {
@@ -788,7 +792,7 @@ If set and supported by the model, calls will generate deterministic results.
788
792
  @return
789
793
  A result object for accessing the partial object stream and additional information.
790
794
  */
791
- declare function streamObject<T>({ model, schema: inputSchema, mode, system, prompt, messages, maxRetries, abortSignal, headers, onFinish, ...settings }: Omit<CallSettings, 'stopSequences'> & Prompt & {
795
+ declare function streamObject<T>({ model, schema: inputSchema, mode, system, prompt, messages, maxRetries, abortSignal, headers, experimental_telemetry: telemetry, onFinish, ...settings }: Omit<CallSettings, 'stopSequences'> & Prompt & {
792
796
  /**
793
797
  The language model to use.
794
798
  */
@@ -812,6 +816,10 @@ Default and recommended: 'auto' (best mode for the model).
812
816
  */
813
817
  mode?: 'auto' | 'json' | 'tool';
814
818
  /**
819
+ Optional telemetry configuration (experimental).
820
+ */
821
+ experimental_telemetry?: TelemetrySettings;
822
+ /**
815
823
  Callback that is called when the LLM response and the final object validation are finished.
816
824
  */
817
825
  onFinish?: (event: {
@@ -848,12 +856,14 @@ declare class DefaultStreamObjectResult<T> implements StreamObjectResult<T> {
848
856
  readonly warnings: StreamObjectResult<T>['warnings'];
849
857
  readonly usage: StreamObjectResult<T>['usage'];
850
858
  readonly rawResponse: StreamObjectResult<T>['rawResponse'];
851
- constructor({ stream, warnings, rawResponse, schema, onFinish, }: {
859
+ constructor({ stream, warnings, rawResponse, schema, onFinish, rootSpan, doStreamSpan, }: {
852
860
  stream: ReadableStream<string | Omit<LanguageModelV1StreamPart, 'text-delta'>>;
853
861
  warnings: StreamObjectResult<T>['warnings'];
854
862
  rawResponse?: StreamObjectResult<T>['rawResponse'];
855
863
  schema: z.Schema<T> | Schema<T>;
856
864
  onFinish: Parameters<typeof streamObject<T>>[0]['onFinish'];
865
+ rootSpan: Span;
866
+ doStreamSpan: Span;
857
867
  });
858
868
  get object(): Promise<T>;
859
869
  get partialObjectStream(): AsyncIterableStream<DeepPartial<T>>;
package/dist/index.d.ts CHANGED
@@ -214,7 +214,7 @@ has a limit on how many embeddings can be generated in a single call.
214
214
 
215
215
  @returns A result object that contains the embeddings, the value, and additional information.
216
216
  */
217
- declare function embedMany<VALUE>({ model, values, maxRetries, abortSignal, headers, }: {
217
+ declare function embedMany<VALUE>({ model, values, maxRetries, abortSignal, headers, experimental_telemetry: telemetry, }: {
218
218
  /**
219
219
  The embedding model to use.
220
220
  */
@@ -238,6 +238,10 @@ declare function embedMany<VALUE>({ model, values, maxRetries, abortSignal, head
238
238
  Only applicable for HTTP-based providers.
239
239
  */
240
240
  headers?: Record<string, string>;
241
+ /**
242
+ * Optional telemetry configuration (experimental).
243
+ */
244
+ experimental_telemetry?: TelemetrySettings;
241
245
  }): Promise<EmbedManyResult<VALUE>>;
242
246
 
243
247
  type CallSettings = {
@@ -788,7 +792,7 @@ If set and supported by the model, calls will generate deterministic results.
788
792
  @return
789
793
  A result object for accessing the partial object stream and additional information.
790
794
  */
791
- declare function streamObject<T>({ model, schema: inputSchema, mode, system, prompt, messages, maxRetries, abortSignal, headers, onFinish, ...settings }: Omit<CallSettings, 'stopSequences'> & Prompt & {
795
+ declare function streamObject<T>({ model, schema: inputSchema, mode, system, prompt, messages, maxRetries, abortSignal, headers, experimental_telemetry: telemetry, onFinish, ...settings }: Omit<CallSettings, 'stopSequences'> & Prompt & {
792
796
  /**
793
797
  The language model to use.
794
798
  */
@@ -812,6 +816,10 @@ Default and recommended: 'auto' (best mode for the model).
812
816
  */
813
817
  mode?: 'auto' | 'json' | 'tool';
814
818
  /**
819
+ Optional telemetry configuration (experimental).
820
+ */
821
+ experimental_telemetry?: TelemetrySettings;
822
+ /**
815
823
  Callback that is called when the LLM response and the final object validation are finished.
816
824
  */
817
825
  onFinish?: (event: {
@@ -848,12 +856,14 @@ declare class DefaultStreamObjectResult<T> implements StreamObjectResult<T> {
848
856
  readonly warnings: StreamObjectResult<T>['warnings'];
849
857
  readonly usage: StreamObjectResult<T>['usage'];
850
858
  readonly rawResponse: StreamObjectResult<T>['rawResponse'];
851
- constructor({ stream, warnings, rawResponse, schema, onFinish, }: {
859
+ constructor({ stream, warnings, rawResponse, schema, onFinish, rootSpan, doStreamSpan, }: {
852
860
  stream: ReadableStream<string | Omit<LanguageModelV1StreamPart, 'text-delta'>>;
853
861
  warnings: StreamObjectResult<T>['warnings'];
854
862
  rawResponse?: StreamObjectResult<T>['rawResponse'];
855
863
  schema: z.Schema<T> | Schema<T>;
856
864
  onFinish: Parameters<typeof streamObject<T>>[0]['onFinish'];
865
+ rootSpan: Span;
866
+ doStreamSpan: Span;
857
867
  });
858
868
  get object(): Promise<T>;
859
869
  get partialObjectStream(): AsyncIterableStream<DeepPartial<T>>;