weave-typescript 0.8.0 → 0.10.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.
@@ -3,18 +3,32 @@ export declare const protobufPackage = "weaveapi.llmx.v1";
3
3
  /** Core capability types that models can support */
4
4
  export declare enum CapabilityType {
5
5
  CAPABILITY_TYPE_UNSPECIFIED = 0,
6
- CAPABILITY_TYPE_STRUCTURED_RESPONSE = 1,
7
- CAPABILITY_TYPE_STREAMING = 2,
8
- CAPABILITY_TYPE_FUNCTION_CALLING = 3,
9
- CAPABILITY_TYPE_VISION = 4,
10
- CAPABILITY_TYPE_TOOL_USE = 5,
11
- CAPABILITY_TYPE_SYSTEM_PROMPT = 6,
12
- CAPABILITY_TYPE_CACHING = 7,
13
- CAPABILITY_TYPE_REASONING = 8,
14
- CAPABILITY_TYPE_AUDIO = 9,
15
- CAPABILITY_TYPE_VIDEO = 10,
16
- CAPABILITY_TYPE_EMBEDDINGS = 11,
17
- CAPABILITY_TYPE_FINE_TUNING = 12,
6
+ /** CAPABILITY_TYPE_TEXT - Basic text input/output capability */
7
+ CAPABILITY_TYPE_TEXT = 1,
8
+ /** CAPABILITY_TYPE_STRUCTURED_RESPONSE - Structured output (JSON, XML, etc.) */
9
+ CAPABILITY_TYPE_STRUCTURED_RESPONSE = 2,
10
+ /** CAPABILITY_TYPE_STREAMING - Server-sent or websocket streaming of partial outputs */
11
+ CAPABILITY_TYPE_STREAMING = 3,
12
+ /** CAPABILITY_TYPE_FUNCTION_CALLING - Tool/function calling with schemaed arguments */
13
+ CAPABILITY_TYPE_FUNCTION_CALLING = 4,
14
+ /** CAPABILITY_TYPE_VISION - Image understanding and/or generation */
15
+ CAPABILITY_TYPE_VISION = 5,
16
+ /** CAPABILITY_TYPE_TOOL_USE - General tool use beyond plain function calls */
17
+ CAPABILITY_TYPE_TOOL_USE = 6,
18
+ /** CAPABILITY_TYPE_SYSTEM_PROMPT - System messages/prompt steering support */
19
+ CAPABILITY_TYPE_SYSTEM_PROMPT = 7,
20
+ /** CAPABILITY_TYPE_CACHING - Prompt/context caching capabilities */
21
+ CAPABILITY_TYPE_CACHING = 8,
22
+ /** CAPABILITY_TYPE_REASONING - Advanced reasoning controls/strategies */
23
+ CAPABILITY_TYPE_REASONING = 9,
24
+ /** CAPABILITY_TYPE_AUDIO - Audio STT/TTS support */
25
+ CAPABILITY_TYPE_AUDIO = 10,
26
+ /** CAPABILITY_TYPE_VIDEO - Video analysis/generation support */
27
+ CAPABILITY_TYPE_VIDEO = 11,
28
+ /** CAPABILITY_TYPE_EMBEDDINGS - Vector embedding generation */
29
+ CAPABILITY_TYPE_EMBEDDINGS = 12,
30
+ /** CAPABILITY_TYPE_FINE_TUNING - Custom model training/fine-tuning */
31
+ CAPABILITY_TYPE_FINE_TUNING = 13,
18
32
  UNRECOGNIZED = -1
19
33
  }
20
34
  export declare function capabilityTypeFromJSON(object: any): CapabilityType;
@@ -160,10 +174,35 @@ export declare enum Hyperparameter {
160
174
  }
161
175
  export declare function hyperparameterFromJSON(object: any): Hyperparameter;
162
176
  export declare function hyperparameterToJSON(object: Hyperparameter): string;
163
- /** Base capability configuration */
177
+ /** Modality direction - whether a modality supports input, output, or both */
178
+ export declare enum ModalityDirection {
179
+ MODALITY_DIRECTION_UNSPECIFIED = 0,
180
+ /** MODALITY_DIRECTION_INPUT_ONLY - Can only process/analyze (e.g., image analysis) */
181
+ MODALITY_DIRECTION_INPUT_ONLY = 1,
182
+ /** MODALITY_DIRECTION_OUTPUT_ONLY - Can only generate (e.g., TTS without STT) */
183
+ MODALITY_DIRECTION_OUTPUT_ONLY = 2,
184
+ /** MODALITY_DIRECTION_INPUT_OUTPUT - Can both process and generate */
185
+ MODALITY_DIRECTION_INPUT_OUTPUT = 3,
186
+ UNRECOGNIZED = -1
187
+ }
188
+ export declare function modalityDirectionFromJSON(object: any): ModalityDirection;
189
+ export declare function modalityDirectionToJSON(object: ModalityDirection): string;
190
+ /**
191
+ * Capability represents a specific feature/ability of a model with its configuration.
192
+ * Each capability has a type and optional detailed configuration.
193
+ */
164
194
  export interface Capability {
195
+ /**
196
+ * The type of capability this represents.
197
+ * Example: CAPABILITY_TYPE_FUNCTION_CALLING for function/tool calling
198
+ */
165
199
  type: CapabilityType;
200
+ /**
201
+ * Whether this capability is currently enabled/available.
202
+ * Example: true if the model supports and has this feature active
203
+ */
166
204
  enabled: boolean;
205
+ text?: Text | undefined;
167
206
  structuredResponse?: StructuredResponse | undefined;
168
207
  streaming?: Streaming | undefined;
169
208
  functionCalling?: FunctionCalling | undefined;
@@ -176,117 +215,467 @@ export interface Capability {
176
215
  video?: Video | undefined;
177
216
  embeddings?: Embeddings | undefined;
178
217
  fineTuning?: FineTuning | undefined;
218
+ /**
219
+ * Unstructured additional information about this capability.
220
+ * Used for provider-specific details that don't fit the structured fields.
221
+ * Example: "Supports up to 10 parallel function calls with automatic retry"
222
+ * Example: "Beta feature - may have unexpected behavior"
223
+ * Example: "Optimized for conversational use cases"
224
+ */
225
+ additionalInfo: string;
226
+ }
227
+ /** Text capability configuration for basic text input/output */
228
+ export interface Text {
229
+ /**
230
+ * Direction of text support (input, output, or both)
231
+ * Example: MODALITY_DIRECTION_INPUT_OUTPUT for chat models
232
+ */
233
+ direction: ModalityDirection;
234
+ /**
235
+ * Maximum input text length in characters (if limited)
236
+ * Example: 32000 for models with character limits
237
+ */
238
+ maxInputLength: number;
239
+ /**
240
+ * Maximum output text length in characters (if limited)
241
+ * Example: 4096 for models with output limits
242
+ */
243
+ maxOutputLength: number;
244
+ /**
245
+ * Supported languages for text processing
246
+ * Examples: ["en", "es", "fr", "de", "zh", "ja"]
247
+ */
248
+ supportedLanguages: string[];
249
+ /**
250
+ * Whether the model supports multi-turn conversations
251
+ * Example: true for chat models, false for completion-only models
252
+ */
253
+ supportsConversation: boolean;
254
+ /**
255
+ * Whether the model can maintain context across messages
256
+ * Example: true for stateful models
257
+ */
258
+ supportsContext: boolean;
179
259
  }
180
260
  /** Structured response capability configuration */
181
261
  export interface StructuredResponse {
262
+ /**
263
+ * Optional guidance to include in the system prompt to elicit structured output
264
+ * Example: "Always return valid JSON matching the provided schema"
265
+ */
182
266
  systemPromptHint: string;
267
+ /**
268
+ * Supported output formats for structured responses
269
+ * Examples: [DATA_FORMAT_JSON, DATA_FORMAT_YAML]
270
+ */
183
271
  supportedFormats: DataFormat[];
272
+ /**
273
+ * Maximum allowed nesting depth for JSON schema objects/arrays
274
+ * Example: 5 for moderately complex schemas
275
+ */
184
276
  maxSchemaDepth: number;
277
+ /**
278
+ * Whether structured output requires tool/function use (vs. direct generation)
279
+ * Example: true for providers that only return JSON via tool calls
280
+ */
185
281
  requiresToolUse: boolean;
282
+ /**
283
+ * Whether the model must be in a special "JSON mode" to honor schemas
284
+ * Example: true for models that enforce strict JSON output when enabled
285
+ */
186
286
  requiresJsonMode: boolean;
287
+ /**
288
+ * Maximum number of top-level properties in object schemas
289
+ * Example: 50
290
+ */
187
291
  maxProperties: number;
292
+ /**
293
+ * JSON Schema primitive/types supported by the model
294
+ * Examples: [JSON_SCHEMA_TYPE_OBJECT, JSON_SCHEMA_TYPE_ARRAY, JSON_SCHEMA_TYPE_STRING]
295
+ */
188
296
  supportedTypes: JsonSchemaType[];
189
- /** Can stream structured responses (not just generate them) */
297
+ /**
298
+ * Can stream structured responses (not just generate them)
299
+ * Example: true if partial JSON chunks are streamed
300
+ */
190
301
  supportsStreaming: boolean;
191
302
  }
192
303
  /** Streaming capability configuration */
193
304
  export interface Streaming {
305
+ /**
306
+ * Delimiter used between streamed chunks, if any
307
+ * Example: "\n\n" for event-stream boundaries
308
+ */
194
309
  chunkDelimiter: string;
310
+ /**
311
+ * Preferred buffer size used by the provider when batching output
312
+ * Example: 1024 (bytes)
313
+ */
195
314
  bufferSize: number;
315
+ /**
316
+ * Whether Server-Sent Events (SSE) is supported
317
+ * Example: true if provider uses text/event-stream
318
+ */
196
319
  supportsSse: boolean;
320
+ /**
321
+ * Whether token usage info can be emitted incrementally during streaming
322
+ * Example: true if usage deltas are included in stream
323
+ */
197
324
  supportsUsage: boolean;
325
+ /**
326
+ * Typical size of individual streamed chunks in bytes
327
+ * Example: 256
328
+ */
198
329
  avgChunkSizeBytes: number;
330
+ /**
331
+ * Maximum delay between streamed chunks in milliseconds
332
+ * Example: 200
333
+ */
199
334
  maxChunkDelayMs: number;
200
335
  }
201
336
  /** Function calling capability configuration */
202
337
  export interface FunctionCalling {
338
+ /**
339
+ * Maximum number of functions that can be registered per request
340
+ * Example: 128
341
+ */
203
342
  maxFunctions: number;
343
+ /**
344
+ * Maximum number of tool/function calls that may be executed in parallel
345
+ * Example: 5
346
+ */
204
347
  maxParallelCalls: number;
348
+ /**
349
+ * Whether the model can plan and invoke multiple tools concurrently
350
+ * Example: true for models with parallel tool-use orchestration
351
+ */
205
352
  supportsParallel: boolean;
353
+ /**
354
+ * Whether requests must use a special "tool" role or channel for calls
355
+ * Example: true if provider requires tool role messages
356
+ */
206
357
  requiresToolRole: boolean;
358
+ /**
359
+ * Whether intermediate tool call tokens/results are streamable
360
+ * Example: true if tool call arguments/results are streamed as they are produced
361
+ */
207
362
  supportsStreaming: boolean;
363
+ /**
364
+ * JSON schema types supported for function parameters
365
+ * Examples: [JSON_SCHEMA_TYPE_OBJECT, JSON_SCHEMA_TYPE_ARRAY, JSON_SCHEMA_TYPE_STRING]
366
+ */
208
367
  supportedParameterTypes: JsonSchemaType[];
368
+ /**
369
+ * Maximum nesting depth allowed for function/tool call plans
370
+ * Example: 3 for limited recursion
371
+ */
209
372
  maxNestingDepth: number;
210
373
  }
211
374
  /** Vision capability configuration */
212
375
  export interface Vision {
376
+ /**
377
+ * Direction of vision support
378
+ * Example: MODALITY_DIRECTION_INPUT_ONLY for analysis-only models
379
+ * Example: MODALITY_DIRECTION_OUTPUT_ONLY for image generation models (DALL-E)
380
+ * Example: MODALITY_DIRECTION_INPUT_OUTPUT for models that can both analyze and generate
381
+ */
382
+ direction: ModalityDirection;
383
+ /**
384
+ * Supported image file formats
385
+ * Examples: [IMAGE_FORMAT_JPEG, IMAGE_FORMAT_PNG, IMAGE_FORMAT_WEBP]
386
+ */
213
387
  supportedFormats: ImageFormat[];
388
+ /**
389
+ * Maximum size per image in bytes
390
+ * Example: 20971520 (20MB) for GPT-4-vision
391
+ */
214
392
  maxImageSizeBytes: number;
393
+ /**
394
+ * Maximum images per API request (for input)
395
+ * Example: 10 for GPT-4-vision, 1 for some models
396
+ */
215
397
  maxImagesPerRequest: number;
216
- supportsImageGeneration: boolean;
217
- supportsVideoFrames: boolean;
398
+ /**
399
+ * Maximum image width in pixels
400
+ * Example: 4096 for high-resolution support
401
+ */
218
402
  maxResolutionWidth: number;
403
+ /**
404
+ * Maximum image height in pixels
405
+ * Example: 4096 for high-resolution support
406
+ */
219
407
  maxResolutionHeight: number;
408
+ /**
409
+ * Supports optical character recognition
410
+ * Example: true if model can extract text from images
411
+ */
220
412
  supportsOcr: boolean;
413
+ /**
414
+ * Supports object detection/localization
415
+ * Example: true if model can identify and locate objects
416
+ */
221
417
  supportsObjectDetection: boolean;
418
+ /**
419
+ * Can process video frames as images
420
+ * Example: true if model accepts video frame extraction
421
+ */
422
+ supportsVideoFrames: boolean;
222
423
  }
223
424
  /** Tool use capability configuration */
224
425
  export interface ToolUse {
426
+ /**
427
+ * Maximum number of tools that can be registered or considered
428
+ * Example: 64
429
+ */
225
430
  maxTools: number;
431
+ /**
432
+ * Whether the model can chain tool invocations one after another
433
+ * Example: true for stepwise tool planning
434
+ */
226
435
  supportsSequential: boolean;
436
+ /**
437
+ * Whether the model can invoke multiple tools concurrently
438
+ * Example: true for parallelized tool execution
439
+ */
227
440
  supportsParallel: boolean;
441
+ /**
442
+ * Maximum number of tool-use rounds allowed in a single request
443
+ * Example: 10
444
+ */
228
445
  maxToolRounds: number;
446
+ /**
447
+ * Types of tools supported by the provider/model
448
+ * Examples: [TOOL_TYPE_FUNCTION, TOOL_TYPE_RETRIEVAL]
449
+ */
229
450
  supportedToolTypes: ToolType[];
230
451
  }
231
452
  /** System prompt capability configuration */
232
453
  export interface SystemPrompt {
454
+ /**
455
+ * Maximum allowed length of system prompt content (characters or tokens)
456
+ * Example: 8000 (characters)
457
+ */
233
458
  maxLength: number;
459
+ /**
460
+ * Whether multiple system prompts (or segments) can be supplied
461
+ * Example: true if the provider supports multiple system messages
462
+ */
234
463
  supportsMultiple: boolean;
464
+ /**
465
+ * Whether system prompts can be cached for re-use
466
+ * Example: true if provider supports prompt caching hints
467
+ */
235
468
  supportsCaching: boolean;
469
+ /**
470
+ * Preferred/required format for system prompts (plain, markdown, etc.)
471
+ * Example: DATA_FORMAT_MARKDOWN
472
+ */
236
473
  format: DataFormat;
237
474
  }
238
475
  /** Caching capability configuration */
239
476
  export interface Caching {
477
+ /**
478
+ * Strategy used to compute cache keys for requests/responses
479
+ * Examples: CACHE_STRATEGY_HASH, CACHE_STRATEGY_SEMANTIC
480
+ */
240
481
  cacheKeyStrategy: CacheStrategy;
482
+ /**
483
+ * Maximum total cache capacity (bytes)
484
+ * Example: 1073741824 for 1GB
485
+ */
241
486
  maxCacheSizeBytes: number;
487
+ /**
488
+ * Default time-to-live for cache entries (seconds)
489
+ * Example: 3600 for 1 hour
490
+ */
242
491
  cacheTtlSeconds: number;
492
+ /**
493
+ * Whether the model/provider supports caching of conversation context
494
+ * Example: true for context window reuse
495
+ */
243
496
  supportsContextCaching: boolean;
497
+ /**
498
+ * Whether the model/provider supports caching of prompts/prefixes
499
+ * Example: true for prefix caching/token reuse
500
+ */
244
501
  supportsPromptCaching: boolean;
502
+ /**
503
+ * Minimum number of tokens required for an entry to be cacheable
504
+ * Example: 128
505
+ */
245
506
  minCacheableTokens: number;
246
507
  }
247
508
  /** Reasoning capability configuration */
248
509
  export interface Reasoning {
510
+ /**
511
+ * Whether the model can produce hidden chain-of-thought/assistant reasoning
512
+ * Example: true for models supporting private CoT traces
513
+ */
249
514
  supportsChainOfThought: boolean;
515
+ /**
516
+ * Whether the model can expose discrete step indices or markers
517
+ * Example: true for models that number reasoning steps
518
+ */
250
519
  supportsStepTracking: boolean;
520
+ /**
521
+ * Maximum number of internal reasoning steps supported
522
+ * Example: 64
523
+ */
251
524
  maxReasoningSteps: number;
525
+ /**
526
+ * Whether the model can revise earlier steps based on later insights
527
+ * Example: true for self-correction/self-reflection
528
+ */
252
529
  supportsSelfCorrection: boolean;
530
+ /**
531
+ * Supported high-level reasoning strategies
532
+ * Examples: [REASONING_STRATEGY_STEP_BY_STEP, REASONING_STRATEGY_SELF_CONSISTENCY]
533
+ */
253
534
  reasoningStrategies: ReasoningStrategy[];
254
535
  }
255
536
  /** Audio capability configuration */
256
537
  export interface Audio {
538
+ /**
539
+ * Direction of audio support
540
+ * Example: MODALITY_DIRECTION_INPUT_ONLY for speech-to-text only
541
+ * Example: MODALITY_DIRECTION_OUTPUT_ONLY for text-to-speech only
542
+ * Example: MODALITY_DIRECTION_INPUT_OUTPUT for models supporting both STT and TTS
543
+ */
544
+ direction: ModalityDirection;
545
+ /**
546
+ * Supported audio file formats
547
+ * Examples: [AUDIO_FORMAT_MP3, AUDIO_FORMAT_WAV, AUDIO_FORMAT_M4A]
548
+ */
257
549
  supportedFormats: AudioFormat[];
550
+ /**
551
+ * Maximum audio duration in seconds
552
+ * Example: 600 for 10-minute limit
553
+ */
258
554
  maxDurationSeconds: number;
555
+ /**
556
+ * Maximum audio file size in bytes
557
+ * Example: 26214400 (25MB) limit
558
+ */
259
559
  maxFileSizeBytes: number;
260
- supportsTranscription: boolean;
261
- supportsGeneration: boolean;
560
+ /**
561
+ * Supported languages for audio processing
562
+ * Examples: ["en", "es", "fr", "de", "zh", "ja"]
563
+ */
262
564
  supportedLanguages: string[];
565
+ /**
566
+ * Supports real-time streaming (for live audio)
567
+ * Example: true for real-time voice models
568
+ */
569
+ supportsStreaming: boolean;
570
+ /**
571
+ * Supports voice cloning or voice selection
572
+ * Example: true if TTS can use different voices
573
+ */
574
+ supportsVoiceSelection: boolean;
263
575
  }
264
576
  /** Video capability configuration */
265
577
  export interface Video {
578
+ /**
579
+ * Direction of video support
580
+ * Example: MODALITY_DIRECTION_INPUT_ONLY for video analysis/understanding
581
+ * Example: MODALITY_DIRECTION_OUTPUT_ONLY for video generation
582
+ * Example: MODALITY_DIRECTION_INPUT_OUTPUT for models that can both analyze and generate
583
+ */
584
+ direction: ModalityDirection;
585
+ /**
586
+ * Supported video file formats
587
+ * Examples: [VIDEO_FORMAT_MP4, VIDEO_FORMAT_MOV, VIDEO_FORMAT_AVI]
588
+ */
266
589
  supportedFormats: VideoFormat[];
590
+ /**
591
+ * Maximum video duration in seconds
592
+ * Example: 120 for 2-minute limit
593
+ */
267
594
  maxDurationSeconds: number;
595
+ /**
596
+ * Maximum video file size in bytes
597
+ * Example: 1073741824 (1GB) limit
598
+ */
268
599
  maxFileSizeBytes: number;
600
+ /**
601
+ * Maximum frames per second supported
602
+ * Example: 30 for standard frame rate
603
+ */
269
604
  maxFps: number;
605
+ /**
606
+ * Supports extracting and analyzing individual frames
607
+ * Example: true if model can process video as a sequence of images
608
+ */
270
609
  supportsFrameExtraction: boolean;
610
+ /**
611
+ * Maximum number of frames that can be analyzed
612
+ * Example: 100 for frame-by-frame analysis limit
613
+ */
614
+ maxFrames: number;
271
615
  }
272
616
  /** Embeddings capability configuration */
273
617
  export interface Embeddings {
618
+ /**
619
+ * Dimensionality of the vector space produced by the model
620
+ * Example: 1536
621
+ */
274
622
  embeddingDimensions: number;
623
+ /**
624
+ * Maximum number of tokens accepted per input item
625
+ * Example: 8192
626
+ */
275
627
  maxInputTokens: number;
628
+ /**
629
+ * Whether the API supports batching multiple inputs in one call
630
+ * Example: true
631
+ */
276
632
  supportsBatch: boolean;
633
+ /**
634
+ * Maximum number of items allowed per batch
635
+ * Example: 128
636
+ */
277
637
  maxBatchSize: number;
638
+ /**
639
+ * Supported similarity/distance metrics for index/search
640
+ * Examples: [DISTANCE_METRIC_COSINE, DISTANCE_METRIC_DOT_PRODUCT]
641
+ */
278
642
  distanceMetrics: DistanceMetric[];
279
643
  }
280
644
  /** Fine-tuning capability configuration */
281
645
  export interface FineTuning {
646
+ /**
647
+ * Minimum number of training examples required to start fine-tuning
648
+ * Example: 50
649
+ */
282
650
  minExamples: number;
651
+ /**
652
+ * Maximum number of training examples supported in a single job
653
+ * Example: 500000
654
+ */
283
655
  maxExamples: number;
656
+ /**
657
+ * Supported dataset/file formats for fine-tuning
658
+ * Examples: [DATA_FORMAT_JSONL, DATA_FORMAT_CSV]
659
+ */
284
660
  supportedFormats: DataFormat[];
661
+ /**
662
+ * Maximum size of individual training files (MB)
663
+ * Example: 512
664
+ */
285
665
  maxFileSizeMb: number;
666
+ /**
667
+ * Whether a separate validation set can be provided
668
+ * Example: true
669
+ */
286
670
  supportsValidationSet: boolean;
671
+ /**
672
+ * Hyperparameters that can be configured for training
673
+ * Examples: [HYPERPARAMETER_LEARNING_RATE, HYPERPARAMETER_EPOCHS]
674
+ */
287
675
  hyperparameters: Hyperparameter[];
288
676
  }
289
677
  export declare const Capability: MessageFns<Capability>;
678
+ export declare const Text: MessageFns<Text>;
290
679
  export declare const StructuredResponse: MessageFns<StructuredResponse>;
291
680
  export declare const Streaming: MessageFns<Streaming>;
292
681
  export declare const FunctionCalling: MessageFns<FunctionCalling>;