Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

ExtendedModelDef.md

74 lines1.5 KB

1---
2id: ExtendedModelDef
3title: ExtendedModelDef
4---
5​
6# Interface: ExtendedModelDef\<TName, TInput, TOptions\>
7​
8Defined in: [packages/typescript/ai/src/extend-adapter.ts:21](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/extend-adapter.ts#L21)
9​
10Definition for a custom model to add to an adapter.
11​
12## Example
13​
14```typescript
15const customModels = [
16 createModel('my-custom-model', ['text', 'image']),
17] as const
18```
19​
20## Type Parameters
21​
22### TName
23​
24`TName` *extends* `string` = `string`
25​
26The model name as a literal string type
27​
28### TInput
29​
30`TInput` *extends* `ReadonlyArray`\<[`Modality`](../type-aliases/Modality.md)\> = `ReadonlyArray`\<[`Modality`](../type-aliases/Modality.md)\>
31​
32Array of supported input modalities
33​
34### TOptions
35​
36`TOptions` = `unknown`
37​
38Provider options type for this model
39​
40## Properties
41​
42### input
43​
44```ts
45input: TInput;
46```
47​
48Defined in: [packages/typescript/ai/src/extend-adapter.ts:29](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/extend-adapter.ts#L29)
49​
50Supported input modalities for this model
51​
52***
53​
54### modelOptions
55​
56```ts
57modelOptions: TOptions;
58```
59​
60Defined in: [packages/typescript/ai/src/extend-adapter.ts:31](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/extend-adapter.ts#L31)
61​
62Type brand for provider options - use `{} as YourOptionsType`
63​
64***
65​
66### name
67​
68```ts
69name: TName;
70```
71​
72Defined in: [packages/typescript/ai/src/extend-adapter.ts:27](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/extend-adapter.ts#L27)
73​
74The model name identifier