aimodels 0.3.5 → 0.3.7

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
@@ -42,7 +42,12 @@ declare class ModelCollection extends Array<Model> {
42
42
  /** Filter models by minimum context window size */
43
43
  withMinContext(tokens: number): ModelCollection;
44
44
  }
45
- interface TokenModelContext {
45
+ interface BaseContext {
46
+ /** The type discriminator */
47
+ type: string;
48
+ }
49
+ interface TokenContext extends BaseContext {
50
+ type: "token";
46
51
  /** Maximum input tokens the model can accept */
47
52
  total: number | null;
48
53
  /** Maximum tokens the model can generate in response */
@@ -54,15 +59,56 @@ interface TokenModelContext {
54
59
  */
55
60
  outputIsFixed?: 1;
56
61
  }
57
- interface ImageModelContext {
62
+ interface CharacterContext extends BaseContext {
63
+ type: "character";
64
+ /** Maximum input characters the model can accept */
65
+ total: number | null;
66
+ /** Maximum characters the model can generate in response */
67
+ maxOutput: number | null;
68
+ }
69
+ interface ImageContext extends BaseContext {
70
+ type: "image";
58
71
  /** Maximum outputs per request */
59
72
  maxOutput: number;
60
- /** Available image sizes */
73
+ /** Available image sizes (e.g. "1024x1024") */
61
74
  sizes: string[];
62
- /** Available quality settings */
75
+ /** Available quality settings (e.g. "standard", "hd") */
63
76
  qualities: string[];
64
77
  }
65
- type ModelContext = TokenModelContext | ImageModelContext;
78
+ interface AudioInputContext extends BaseContext {
79
+ type: "audio-in";
80
+ /** Maximum duration in seconds, null if unlimited */
81
+ maxDuration?: number | null;
82
+ /** Supported input formats */
83
+ formats?: string[];
84
+ /** Maximum file size in bytes */
85
+ maxSize?: number | null;
86
+ }
87
+ interface AudioOutputContext extends BaseContext {
88
+ type: "audio-out";
89
+ /** Maximum text length that can be converted to speech */
90
+ maxInput?: number | null;
91
+ /** Supported output formats */
92
+ formats?: string[];
93
+ /** Available voices */
94
+ voices?: string[];
95
+ /** Available quality settings */
96
+ qualities?: string[];
97
+ }
98
+ interface EmbeddingContext extends BaseContext {
99
+ type: "embedding";
100
+ /** Maximum input size */
101
+ total: number;
102
+ /** Unit of measurement for input */
103
+ unit: "tokens" | "characters";
104
+ /** Size of output embedding vectors */
105
+ dimensions: number;
106
+ /** Type of embeddings produced */
107
+ embeddingType?: "text" | "image" | "audio" | "multimodal";
108
+ /** Normalization of output vectors */
109
+ normalized?: boolean;
110
+ }
111
+ type ModelContext = TokenContext | CharacterContext | ImageContext | AudioInputContext | AudioOutputContext | EmbeddingContext;
66
112
  interface Model {
67
113
  /** Unique identifier */
68
114
  id: string;
@@ -82,6 +128,10 @@ interface Model {
82
128
  aliases?: string[];
83
129
  /** Context window information */
84
130
  context: ModelContext;
131
+ /** Base model ID this model extends */
132
+ extends?: string;
133
+ /** Properties that override the base model */
134
+ overrides?: Partial<Omit<Model, 'id' | 'extends' | 'overrides'>>;
85
135
  }
86
136
 
87
137
  interface Provider {
package/dist/index.d.ts CHANGED
@@ -42,7 +42,12 @@ declare class ModelCollection extends Array<Model> {
42
42
  /** Filter models by minimum context window size */
43
43
  withMinContext(tokens: number): ModelCollection;
44
44
  }
45
- interface TokenModelContext {
45
+ interface BaseContext {
46
+ /** The type discriminator */
47
+ type: string;
48
+ }
49
+ interface TokenContext extends BaseContext {
50
+ type: "token";
46
51
  /** Maximum input tokens the model can accept */
47
52
  total: number | null;
48
53
  /** Maximum tokens the model can generate in response */
@@ -54,15 +59,56 @@ interface TokenModelContext {
54
59
  */
55
60
  outputIsFixed?: 1;
56
61
  }
57
- interface ImageModelContext {
62
+ interface CharacterContext extends BaseContext {
63
+ type: "character";
64
+ /** Maximum input characters the model can accept */
65
+ total: number | null;
66
+ /** Maximum characters the model can generate in response */
67
+ maxOutput: number | null;
68
+ }
69
+ interface ImageContext extends BaseContext {
70
+ type: "image";
58
71
  /** Maximum outputs per request */
59
72
  maxOutput: number;
60
- /** Available image sizes */
73
+ /** Available image sizes (e.g. "1024x1024") */
61
74
  sizes: string[];
62
- /** Available quality settings */
75
+ /** Available quality settings (e.g. "standard", "hd") */
63
76
  qualities: string[];
64
77
  }
65
- type ModelContext = TokenModelContext | ImageModelContext;
78
+ interface AudioInputContext extends BaseContext {
79
+ type: "audio-in";
80
+ /** Maximum duration in seconds, null if unlimited */
81
+ maxDuration?: number | null;
82
+ /** Supported input formats */
83
+ formats?: string[];
84
+ /** Maximum file size in bytes */
85
+ maxSize?: number | null;
86
+ }
87
+ interface AudioOutputContext extends BaseContext {
88
+ type: "audio-out";
89
+ /** Maximum text length that can be converted to speech */
90
+ maxInput?: number | null;
91
+ /** Supported output formats */
92
+ formats?: string[];
93
+ /** Available voices */
94
+ voices?: string[];
95
+ /** Available quality settings */
96
+ qualities?: string[];
97
+ }
98
+ interface EmbeddingContext extends BaseContext {
99
+ type: "embedding";
100
+ /** Maximum input size */
101
+ total: number;
102
+ /** Unit of measurement for input */
103
+ unit: "tokens" | "characters";
104
+ /** Size of output embedding vectors */
105
+ dimensions: number;
106
+ /** Type of embeddings produced */
107
+ embeddingType?: "text" | "image" | "audio" | "multimodal";
108
+ /** Normalization of output vectors */
109
+ normalized?: boolean;
110
+ }
111
+ type ModelContext = TokenContext | CharacterContext | ImageContext | AudioInputContext | AudioOutputContext | EmbeddingContext;
66
112
  interface Model {
67
113
  /** Unique identifier */
68
114
  id: string;
@@ -82,6 +128,10 @@ interface Model {
82
128
  aliases?: string[];
83
129
  /** Context window information */
84
130
  context: ModelContext;
131
+ /** Base model ID this model extends */
132
+ extends?: string;
133
+ /** Properties that override the base model */
134
+ overrides?: Partial<Omit<Model, 'id' | 'extends' | 'overrides'>>;
85
135
  }
86
136
 
87
137
  interface Provider {