@tanstack/ai-muse 0.0.0-stage → 0.0.1
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/LICENSE +21 -0
- package/README.md +79 -2
- package/dist/esm/adapters/text.d.ts +51 -0
- package/dist/esm/adapters/text.js +53 -0
- package/dist/esm/adapters/text.js.map +1 -0
- package/dist/esm/byok.d.ts +1 -0
- package/dist/esm/byok.js +11 -0
- package/dist/esm/byok.js.map +1 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/message-types.d.ts +43 -0
- package/dist/esm/model-meta.d.ts +369 -0
- package/dist/esm/model-meta.js +214 -0
- package/dist/esm/model-meta.js.map +1 -0
- package/dist/esm/text/text-provider-options.d.ts +57 -0
- package/dist/esm/utils/client.d.ts +28 -0
- package/dist/esm/utils/client.js +38 -0
- package/dist/esm/utils/client.js.map +1 -0
- package/package.json +69 -3
- package/src/adapters/text.ts +113 -0
- package/src/byok.ts +7 -0
- package/src/index.ts +36 -0
- package/src/message-types.ts +45 -0
- package/src/model-meta.ts +329 -0
- package/src/text/text-provider-options.ts +66 -0
- package/src/utils/client.ts +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tanner Linsley
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,80 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source
|
|
4
|
+
media="(prefers-color-scheme: dark)"
|
|
5
|
+
srcset="https://tanstack.com/api/readme/ai.png?theme=dark"
|
|
6
|
+
/>
|
|
7
|
+
<source
|
|
8
|
+
media="(prefers-color-scheme: light)"
|
|
9
|
+
srcset="https://tanstack.com/api/readme/ai.png"
|
|
10
|
+
/>
|
|
11
|
+
<img
|
|
12
|
+
src="https://tanstack.com/api/readme/ai.png"
|
|
13
|
+
alt="TanStack AI"
|
|
14
|
+
width="900"
|
|
15
|
+
/>
|
|
16
|
+
</picture>
|
|
17
|
+
</div>
|
|
2
18
|
|
|
3
|
-
|
|
19
|
+
<br />
|
|
20
|
+
|
|
21
|
+
# @tanstack/ai-muse
|
|
22
|
+
|
|
23
|
+
Muse provider adapter for TanStack AI.
|
|
24
|
+
|
|
25
|
+
Muse is served by the Meta Model API through an OpenAI-compatible Chat
|
|
26
|
+
Completions endpoint at `https://api.meta.ai/v1`, so this adapter drives it
|
|
27
|
+
with an OpenAI-compatible client through a `baseURL` override. It gives you
|
|
28
|
+
tree-shakeable text adapters for the Muse model family, including the
|
|
29
|
+
flagship `muse-ember-1.0` (Ember) model.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install @tanstack/ai-muse @tanstack/ai
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { museText } from '@tanstack/ai-muse'
|
|
41
|
+
import { chat } from '@tanstack/ai'
|
|
42
|
+
|
|
43
|
+
// Reads the API key from MUSE_API_KEY (MODEL_API_KEY, the name used in
|
|
44
|
+
// Meta's docs, is also accepted).
|
|
45
|
+
const adapter = museText('muse-ember-1.0')
|
|
46
|
+
|
|
47
|
+
const result = await chat({
|
|
48
|
+
adapter,
|
|
49
|
+
threadId: 'thread-1',
|
|
50
|
+
stream: false,
|
|
51
|
+
messages: [{ role: 'user', content: 'Write a haiku about embers.' }],
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
console.log(result.text)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Pass an explicit key when you do not want to read it from the environment:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { createMuseText } from '@tanstack/ai-muse'
|
|
61
|
+
|
|
62
|
+
const adapter = createMuseText('muse-ember-1.0', 'your-meta-model-api-key')
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Models
|
|
66
|
+
|
|
67
|
+
Chat models served by the Meta Model API:
|
|
68
|
+
|
|
69
|
+
- `muse-ember-1.0` — flagship for high-volume execution (Ember)
|
|
70
|
+
- `muse-wonder-1.0`
|
|
71
|
+
- `muse-spark-1.3`, `muse-spark-1.2`, `muse-spark-1.1`
|
|
72
|
+
- `muse-spark-1.3-contributor`, `muse-spark-1.2-contributor` — Contributor
|
|
73
|
+
mode: discounted rates, your traffic may be used for training
|
|
74
|
+
|
|
75
|
+
All of these accept `text` and `image` input through this adapter. (On the
|
|
76
|
+
API itself they also accept video, audio, and PDF input, which this adapter
|
|
77
|
+
does not yet expose.)
|
|
78
|
+
|
|
79
|
+
Muse Glimmer is an open-weight model you run yourself; it is not served by
|
|
80
|
+
the Meta Model API and is not part of this adapter.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OpenAIBaseChatCompletionsTextAdapter, OpenAIBaseTextAdapterOptions } from '@tanstack/openai-base';
|
|
2
|
+
import { Modality } from '@tanstack/ai';
|
|
3
|
+
import { MUSE_CHAT_MODELS, MuseChatModelToolCapabilitiesByName, MuseModelReasoningByName, ResolveInputModalities, ResolveProviderOptions } from '../model-meta.js';
|
|
4
|
+
import { MuseMessageMetadataByModality } from '../message-types.js';
|
|
5
|
+
import { MuseClientConfig } from '../utils/client.js';
|
|
6
|
+
/** The reasoning levels of a model, for `chat({ reasoning })`. `never`: none. */
|
|
7
|
+
type ResolveReasoning<TModel extends string> = TModel extends keyof MuseModelReasoningByName ? MuseModelReasoningByName[TModel] : never;
|
|
8
|
+
type ResolveToolCapabilities<TModel extends string> = TModel extends keyof MuseChatModelToolCapabilitiesByName ? NonNullable<MuseChatModelToolCapabilitiesByName[TModel]> : readonly [];
|
|
9
|
+
/**
|
|
10
|
+
* Configuration for the Muse text adapter.
|
|
11
|
+
*/
|
|
12
|
+
export interface MuseTextConfig extends MuseClientConfig, OpenAIBaseTextAdapterOptions {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Re-export of the public provider options type.
|
|
16
|
+
*/
|
|
17
|
+
export type { ExternalTextProviderOptions as MuseTextProviderOptions } from '../text/text-provider-options.js';
|
|
18
|
+
/**
|
|
19
|
+
* Muse Text (Chat) Adapter
|
|
20
|
+
*
|
|
21
|
+
* Tree-shakeable adapter for Muse chat/text completion. Muse exposes an
|
|
22
|
+
* OpenAI-compatible Chat Completions endpoint, so we drive it with an
|
|
23
|
+
* OpenAI-compatible client via a `baseURL` override. There are no Muse-only
|
|
24
|
+
* wire quirks, so the OpenAI Chat Completions base handles streaming, tools,
|
|
25
|
+
* reasoning, and structured output unchanged.
|
|
26
|
+
*/
|
|
27
|
+
export declare class MuseTextAdapter<TModel extends (typeof MUSE_CHAT_MODELS)[number], TProviderOptions extends Record<string, any> = ResolveProviderOptions<TModel>, TInputModalities extends ReadonlyArray<Modality> = ResolveInputModalities<TModel>, TToolCapabilities extends ReadonlyArray<string> = ResolveToolCapabilities<TModel>> extends OpenAIBaseChatCompletionsTextAdapter<TModel, TProviderOptions, TInputModalities, MuseMessageMetadataByModality, TToolCapabilities, ResolveReasoning<TModel>> {
|
|
28
|
+
readonly kind: "text";
|
|
29
|
+
readonly name: "muse";
|
|
30
|
+
readonly inputModalities: readonly ("text" | "image" | "audio" | "video" | "document")[] | undefined;
|
|
31
|
+
constructor(config: MuseTextConfig, model: TModel);
|
|
32
|
+
protected modelReasoning(model: string): import('@tanstack/ai').ModelReasoning | undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Creates a Muse text adapter with an explicit API key.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const adapter = createMuseText('muse-ember-1.0', 'muse_...');
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function createMuseText<TModel extends (typeof MUSE_CHAT_MODELS)[number]>(model: TModel, apiKey: string, config?: Omit<MuseTextConfig, 'apiKey'>): MuseTextAdapter<TModel>;
|
|
43
|
+
/**
|
|
44
|
+
* Creates a Muse text adapter with the API key from `MUSE_API_KEY`.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const adapter = museText('muse-ember-1.0');
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare function museText<TModel extends (typeof MUSE_CHAT_MODELS)[number]>(model: TModel, config?: Omit<MuseTextConfig, 'apiKey'>): MuseTextAdapter<TModel>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { MUSE_MODEL_INPUT_MODALITIES, MUSE_MODEL_REASONING } from "../model-meta.js";
|
|
2
|
+
import { getMuseApiKeyFromEnv, withMuseDefaults } from "../utils/client.js";
|
|
3
|
+
import { OpenAIBaseChatCompletionsTextAdapter, createOpenAIClient } from "@tanstack/openai-base";
|
|
4
|
+
//#region src/adapters/text.ts
|
|
5
|
+
/**
|
|
6
|
+
* Muse Text (Chat) Adapter
|
|
7
|
+
*
|
|
8
|
+
* Tree-shakeable adapter for Muse chat/text completion. Muse exposes an
|
|
9
|
+
* OpenAI-compatible Chat Completions endpoint, so we drive it with an
|
|
10
|
+
* OpenAI-compatible client via a `baseURL` override. There are no Muse-only
|
|
11
|
+
* wire quirks, so the OpenAI Chat Completions base handles streaming, tools,
|
|
12
|
+
* reasoning, and structured output unchanged.
|
|
13
|
+
*/
|
|
14
|
+
var MuseTextAdapter = class extends OpenAIBaseChatCompletionsTextAdapter {
|
|
15
|
+
kind = "text";
|
|
16
|
+
name = "muse";
|
|
17
|
+
inputModalities = MUSE_MODEL_INPUT_MODALITIES[this.model];
|
|
18
|
+
constructor(config, model) {
|
|
19
|
+
super(model, "muse", createOpenAIClient(withMuseDefaults(config)), config);
|
|
20
|
+
}
|
|
21
|
+
modelReasoning(model) {
|
|
22
|
+
return MUSE_MODEL_REASONING[model];
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Creates a Muse text adapter with an explicit API key.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const adapter = createMuseText('muse-ember-1.0', 'muse_...');
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
function createMuseText(model, apiKey, config) {
|
|
34
|
+
return new MuseTextAdapter({
|
|
35
|
+
apiKey,
|
|
36
|
+
...config
|
|
37
|
+
}, model);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates a Muse text adapter with the API key from `MUSE_API_KEY`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const adapter = museText('muse-ember-1.0');
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
function museText(model, config) {
|
|
48
|
+
return createMuseText(model, getMuseApiKeyFromEnv(), config);
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { MuseTextAdapter, createMuseText, museText };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","names":[],"sources":["../../../src/adapters/text.ts"],"sourcesContent":["import {\n OpenAIBaseChatCompletionsTextAdapter,\n createOpenAIClient,\n} from '@tanstack/openai-base'\nimport {\n MUSE_MODEL_INPUT_MODALITIES,\n MUSE_MODEL_REASONING,\n} from '../model-meta'\nimport { getMuseApiKeyFromEnv, withMuseDefaults } from '../utils/client'\nimport type { Modality } from '@tanstack/ai'\nimport type {\n MUSE_CHAT_MODELS,\n MuseChatModelToolCapabilitiesByName,\n MuseModelReasoningByName,\n ResolveInputModalities,\n ResolveProviderOptions,\n} from '../model-meta'\nimport type { MuseMessageMetadataByModality } from '../message-types'\nimport type { MuseClientConfig } from '../utils/client'\nimport type { OpenAIBaseTextAdapterOptions } from '@tanstack/openai-base'\n\n/** The reasoning levels of a model, for `chat({ reasoning })`. `never`: none. */\ntype ResolveReasoning<TModel extends string> =\n TModel extends keyof MuseModelReasoningByName\n ? MuseModelReasoningByName[TModel]\n : never\n\ntype ResolveToolCapabilities<TModel extends string> =\n TModel extends keyof MuseChatModelToolCapabilitiesByName\n ? NonNullable<MuseChatModelToolCapabilitiesByName[TModel]>\n : readonly []\n\n/**\n * Configuration for the Muse text adapter.\n */\nexport interface MuseTextConfig\n extends MuseClientConfig, OpenAIBaseTextAdapterOptions {}\n\n/**\n * Re-export of the public provider options type.\n */\nexport type { ExternalTextProviderOptions as MuseTextProviderOptions } from '../text/text-provider-options'\n\n/**\n * Muse Text (Chat) Adapter\n *\n * Tree-shakeable adapter for Muse chat/text completion. Muse exposes an\n * OpenAI-compatible Chat Completions endpoint, so we drive it with an\n * OpenAI-compatible client via a `baseURL` override. There are no Muse-only\n * wire quirks, so the OpenAI Chat Completions base handles streaming, tools,\n * reasoning, and structured output unchanged.\n */\nexport class MuseTextAdapter<\n TModel extends (typeof MUSE_CHAT_MODELS)[number],\n TProviderOptions extends Record<string, any> = ResolveProviderOptions<TModel>,\n TInputModalities extends ReadonlyArray<Modality> =\n ResolveInputModalities<TModel>,\n TToolCapabilities extends ReadonlyArray<string> =\n ResolveToolCapabilities<TModel>,\n> extends OpenAIBaseChatCompletionsTextAdapter<\n TModel,\n TProviderOptions,\n TInputModalities,\n MuseMessageMetadataByModality,\n TToolCapabilities,\n ResolveReasoning<TModel>\n> {\n override readonly kind = 'text' as const\n override readonly name = 'muse' as const\n override readonly inputModalities = MUSE_MODEL_INPUT_MODALITIES[this.model]\n\n constructor(config: MuseTextConfig, model: TModel) {\n super(model, 'muse', createOpenAIClient(withMuseDefaults(config)), config)\n }\n\n protected override modelReasoning(model: string) {\n return MUSE_MODEL_REASONING[model]\n }\n}\n\n/**\n * Creates a Muse text adapter with an explicit API key.\n *\n * @example\n * ```typescript\n * const adapter = createMuseText('muse-ember-1.0', 'muse_...');\n * ```\n */\nexport function createMuseText<\n TModel extends (typeof MUSE_CHAT_MODELS)[number],\n>(\n model: TModel,\n apiKey: string,\n config?: Omit<MuseTextConfig, 'apiKey'>,\n): MuseTextAdapter<TModel> {\n return new MuseTextAdapter({ apiKey, ...config }, model)\n}\n\n/**\n * Creates a Muse text adapter with the API key from `MUSE_API_KEY`.\n *\n * @example\n * ```typescript\n * const adapter = museText('muse-ember-1.0');\n * ```\n */\nexport function museText<TModel extends (typeof MUSE_CHAT_MODELS)[number]>(\n model: TModel,\n config?: Omit<MuseTextConfig, 'apiKey'>,\n): MuseTextAdapter<TModel> {\n const apiKey = getMuseApiKeyFromEnv()\n return createMuseText(model, apiKey, config)\n}\n"],"mappings":";;;;;;;;;;;;;AAoDA,IAAa,kBAAb,cAOU,qCAOR;CACA,OAAyB;CACzB,OAAyB;CACzB,kBAAoC,4BAA4B,KAAK;CAErE,YAAY,QAAwB,OAAe;EACjD,MAAM,OAAO,QAAQ,mBAAmB,iBAAiB,MAAM,CAAC,GAAG,MAAM;CAC3E;CAEA,eAAkC,OAAe;EAC/C,OAAO,qBAAqB;CAC9B;AACF;;;;;;;;;AAUA,SAAgB,eAGd,OACA,QACA,QACyB;CACzB,OAAO,IAAI,gBAAgB;EAAE;EAAQ,GAAG;CAAO,GAAG,KAAK;AACzD;;;;;;;;;AAUA,SAAgB,SACd,OACA,QACyB;CAEzB,OAAO,eAAe,OADP,qBACc,GAAQ,MAAM;AAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const museByok: import('@tanstack/ai/byok').ByokProvider<"muse">;
|
package/dist/esm/byok.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"byok.js","names":[],"sources":["../../src/byok.ts"],"sourcesContent":["import { defineByokProvider } from '@tanstack/ai/byok'\n\nexport const museByok = defineByokProvider({\n id: 'muse',\n label: 'Muse',\n env: 'MUSE_API_KEY',\n})\n"],"mappings":";;AAEA,IAAa,WAAW,mBAAmB;CACzC,IAAI;CACJ,OAAO;CACP,KAAK;AACP,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @tanstack/ai-muse
|
|
3
|
+
*
|
|
4
|
+
* Muse provider adapter for TanStack AI.
|
|
5
|
+
* Provides a tree-shakeable adapter for Muse's OpenAI-compatible Chat
|
|
6
|
+
* Completions endpoint, including the flagship `muse-ember-1.0` (Ember) model.
|
|
7
|
+
*/
|
|
8
|
+
export { MuseTextAdapter, createMuseText, museText, type MuseTextConfig, type MuseTextProviderOptions, } from './adapters/text.js';
|
|
9
|
+
export type { MuseChatModels, MuseChatModelProviderOptionsByName, MuseChatModelToolCapabilitiesByName, MuseModelInputModalitiesByName, MuseModelReasoningByName, ResolveProviderOptions, ResolveInputModalities, } from './model-meta.js';
|
|
10
|
+
export { MUSE_CHAT_MODELS } from './model-meta.js';
|
|
11
|
+
export type { MuseTextMetadata, MuseImageMetadata, MuseAudioMetadata, MuseVideoMetadata, MuseDocumentMetadata, MuseMessageMetadataByModality, } from './message-types.js';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Muse message metadata types.
|
|
3
|
+
*
|
|
4
|
+
* Muse uses the OpenAI Chat Completions wire format, so these hold the
|
|
5
|
+
* provider-specific metadata a caller can attach to each content part. Muse
|
|
6
|
+
* has no extra per-part options today, so text is empty and image mirrors the
|
|
7
|
+
* standard `detail` control.
|
|
8
|
+
*/
|
|
9
|
+
/** Metadata for Muse text content parts. */
|
|
10
|
+
export interface MuseTextMetadata {
|
|
11
|
+
}
|
|
12
|
+
/** Metadata for Muse image content parts. */
|
|
13
|
+
export interface MuseImageMetadata {
|
|
14
|
+
/**
|
|
15
|
+
* The detail level of the image.
|
|
16
|
+
* - 'auto': let the model decide based on image size and content
|
|
17
|
+
* - 'low': low resolution processing (faster, cheaper, less detail)
|
|
18
|
+
* - 'high': high resolution processing (slower, more expensive, more detail)
|
|
19
|
+
*
|
|
20
|
+
* @default 'auto'
|
|
21
|
+
*/
|
|
22
|
+
detail?: 'auto' | 'low' | 'high';
|
|
23
|
+
}
|
|
24
|
+
/** Metadata for Muse audio content parts. */
|
|
25
|
+
export interface MuseAudioMetadata {
|
|
26
|
+
}
|
|
27
|
+
/** Metadata for Muse video content parts. */
|
|
28
|
+
export interface MuseVideoMetadata {
|
|
29
|
+
}
|
|
30
|
+
/** Metadata for Muse document content parts. */
|
|
31
|
+
export interface MuseDocumentMetadata {
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Map of modality types to their Muse-specific metadata types.
|
|
35
|
+
* Used for type inference when constructing multimodal messages.
|
|
36
|
+
*/
|
|
37
|
+
export interface MuseMessageMetadataByModality {
|
|
38
|
+
text: MuseTextMetadata;
|
|
39
|
+
image: MuseImageMetadata;
|
|
40
|
+
audio: MuseAudioMetadata;
|
|
41
|
+
video: MuseVideoMetadata;
|
|
42
|
+
document: MuseDocumentMetadata;
|
|
43
|
+
}
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { Modality, ModelReasoning } from '@tanstack/ai';
|
|
2
|
+
import { ModelReasoningCapability } from '@tanstack/ai/adapter-internals';
|
|
3
|
+
import { MuseTextProviderOptions } from './text/text-provider-options.js';
|
|
4
|
+
declare const EMBER_1_0: {
|
|
5
|
+
readonly name: "muse-ember-1.0";
|
|
6
|
+
readonly context_window: 1048576;
|
|
7
|
+
readonly max_completion_tokens: 524288;
|
|
8
|
+
readonly pricing: {
|
|
9
|
+
readonly input: {
|
|
10
|
+
readonly normal: 0.1;
|
|
11
|
+
readonly cached: 0.004;
|
|
12
|
+
};
|
|
13
|
+
readonly output: {
|
|
14
|
+
readonly normal: 0.5;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
readonly supports: {
|
|
18
|
+
readonly input: ["text", "image"];
|
|
19
|
+
readonly output: ["text"];
|
|
20
|
+
readonly endpoints: ["chat"];
|
|
21
|
+
readonly features: ["streaming", "tools", "json_object", "json_schema", "reasoning", "vision"];
|
|
22
|
+
readonly tools: readonly [];
|
|
23
|
+
};
|
|
24
|
+
readonly reasoning: {
|
|
25
|
+
readonly levels: {
|
|
26
|
+
readonly minimal: "minimal";
|
|
27
|
+
readonly low: "low";
|
|
28
|
+
readonly medium: "medium";
|
|
29
|
+
readonly high: "high";
|
|
30
|
+
readonly xhigh: "xhigh";
|
|
31
|
+
readonly max: "max";
|
|
32
|
+
};
|
|
33
|
+
readonly budget: false;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
declare const WONDER_1_0: {
|
|
37
|
+
readonly name: "muse-wonder-1.0";
|
|
38
|
+
readonly context_window: 1048576;
|
|
39
|
+
readonly max_completion_tokens: 131072;
|
|
40
|
+
readonly pricing: {
|
|
41
|
+
readonly input: {
|
|
42
|
+
readonly normal: 4;
|
|
43
|
+
readonly cached: 0.2;
|
|
44
|
+
};
|
|
45
|
+
readonly output: {
|
|
46
|
+
readonly normal: 20;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
readonly supports: {
|
|
50
|
+
readonly input: ["text", "image"];
|
|
51
|
+
readonly output: ["text"];
|
|
52
|
+
readonly endpoints: ["chat"];
|
|
53
|
+
readonly features: ["streaming", "tools", "json_object", "json_schema", "reasoning", "vision"];
|
|
54
|
+
readonly tools: readonly [];
|
|
55
|
+
};
|
|
56
|
+
readonly reasoning: {
|
|
57
|
+
readonly levels: {
|
|
58
|
+
readonly minimal: "minimal";
|
|
59
|
+
readonly low: "low";
|
|
60
|
+
readonly medium: "medium";
|
|
61
|
+
readonly high: "high";
|
|
62
|
+
readonly xhigh: "xhigh";
|
|
63
|
+
readonly max: "max";
|
|
64
|
+
};
|
|
65
|
+
readonly budget: false;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
declare const SPARK_1_3: {
|
|
69
|
+
readonly name: "muse-spark-1.3";
|
|
70
|
+
readonly context_window: 1048576;
|
|
71
|
+
readonly max_completion_tokens: 131072;
|
|
72
|
+
readonly pricing: {
|
|
73
|
+
readonly input: {
|
|
74
|
+
readonly normal: 1.25;
|
|
75
|
+
readonly cached: 0.15;
|
|
76
|
+
};
|
|
77
|
+
readonly output: {
|
|
78
|
+
readonly normal: 4.25;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
readonly supports: {
|
|
82
|
+
readonly input: ["text", "image"];
|
|
83
|
+
readonly output: ["text"];
|
|
84
|
+
readonly endpoints: ["chat"];
|
|
85
|
+
readonly features: ["streaming", "tools", "json_object", "json_schema", "reasoning", "vision"];
|
|
86
|
+
readonly tools: readonly [];
|
|
87
|
+
};
|
|
88
|
+
readonly reasoning: {
|
|
89
|
+
readonly levels: {
|
|
90
|
+
readonly minimal: "minimal";
|
|
91
|
+
readonly low: "low";
|
|
92
|
+
readonly medium: "medium";
|
|
93
|
+
readonly high: "high";
|
|
94
|
+
readonly xhigh: "xhigh";
|
|
95
|
+
readonly max: "max";
|
|
96
|
+
};
|
|
97
|
+
readonly budget: false;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
declare const SPARK_1_3_CONTRIBUTOR: {
|
|
101
|
+
readonly name: "muse-spark-1.3-contributor";
|
|
102
|
+
readonly context_window: 1048576;
|
|
103
|
+
readonly max_completion_tokens: 131072;
|
|
104
|
+
readonly pricing: {
|
|
105
|
+
readonly input: {
|
|
106
|
+
readonly normal: 0.1;
|
|
107
|
+
readonly cached: 0.002;
|
|
108
|
+
};
|
|
109
|
+
readonly output: {
|
|
110
|
+
readonly normal: 0.2;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly supports: {
|
|
114
|
+
readonly input: ["text", "image"];
|
|
115
|
+
readonly output: ["text"];
|
|
116
|
+
readonly endpoints: ["chat"];
|
|
117
|
+
readonly features: ["streaming", "tools", "json_object", "json_schema", "reasoning", "vision"];
|
|
118
|
+
readonly tools: readonly [];
|
|
119
|
+
};
|
|
120
|
+
readonly reasoning: {
|
|
121
|
+
readonly levels: {
|
|
122
|
+
readonly minimal: "minimal";
|
|
123
|
+
readonly low: "low";
|
|
124
|
+
readonly medium: "medium";
|
|
125
|
+
readonly high: "high";
|
|
126
|
+
readonly xhigh: "xhigh";
|
|
127
|
+
};
|
|
128
|
+
readonly budget: false;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
declare const SPARK_1_2: {
|
|
132
|
+
readonly name: "muse-spark-1.2";
|
|
133
|
+
readonly context_window: 1048576;
|
|
134
|
+
readonly max_completion_tokens: 131072;
|
|
135
|
+
readonly pricing: {
|
|
136
|
+
readonly input: {
|
|
137
|
+
readonly normal: 1.25;
|
|
138
|
+
readonly cached: 0.15;
|
|
139
|
+
};
|
|
140
|
+
readonly output: {
|
|
141
|
+
readonly normal: 4.25;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
readonly supports: {
|
|
145
|
+
readonly input: ["text", "image"];
|
|
146
|
+
readonly output: ["text"];
|
|
147
|
+
readonly endpoints: ["chat"];
|
|
148
|
+
readonly features: ["streaming", "tools", "json_object", "json_schema", "reasoning", "vision"];
|
|
149
|
+
readonly tools: readonly [];
|
|
150
|
+
};
|
|
151
|
+
readonly reasoning: {
|
|
152
|
+
readonly levels: {
|
|
153
|
+
readonly minimal: "minimal";
|
|
154
|
+
readonly low: "low";
|
|
155
|
+
readonly medium: "medium";
|
|
156
|
+
readonly high: "high";
|
|
157
|
+
readonly xhigh: "xhigh";
|
|
158
|
+
};
|
|
159
|
+
readonly budget: false;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
declare const SPARK_1_2_CONTRIBUTOR: {
|
|
163
|
+
readonly name: "muse-spark-1.2-contributor";
|
|
164
|
+
readonly context_window: 1048576;
|
|
165
|
+
readonly max_completion_tokens: 131072;
|
|
166
|
+
readonly pricing: {
|
|
167
|
+
readonly input: {
|
|
168
|
+
readonly normal: 0.1;
|
|
169
|
+
readonly cached: 0.002;
|
|
170
|
+
};
|
|
171
|
+
readonly output: {
|
|
172
|
+
readonly normal: 0.2;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
readonly supports: {
|
|
176
|
+
readonly input: ["text", "image"];
|
|
177
|
+
readonly output: ["text"];
|
|
178
|
+
readonly endpoints: ["chat"];
|
|
179
|
+
readonly features: ["streaming", "tools", "json_object", "json_schema", "reasoning", "vision"];
|
|
180
|
+
readonly tools: readonly [];
|
|
181
|
+
};
|
|
182
|
+
readonly reasoning: {
|
|
183
|
+
readonly levels: {
|
|
184
|
+
readonly minimal: "minimal";
|
|
185
|
+
readonly low: "low";
|
|
186
|
+
readonly medium: "medium";
|
|
187
|
+
readonly high: "high";
|
|
188
|
+
readonly xhigh: "xhigh";
|
|
189
|
+
};
|
|
190
|
+
readonly budget: false;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
declare const SPARK_1_1: {
|
|
194
|
+
readonly name: "muse-spark-1.1";
|
|
195
|
+
readonly context_window: 1048576;
|
|
196
|
+
readonly max_completion_tokens: 32768;
|
|
197
|
+
readonly pricing: {
|
|
198
|
+
readonly input: {
|
|
199
|
+
readonly normal: 1.25;
|
|
200
|
+
readonly cached: 0.15;
|
|
201
|
+
};
|
|
202
|
+
readonly output: {
|
|
203
|
+
readonly normal: 4.25;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
readonly supports: {
|
|
207
|
+
readonly input: ["text", "image"];
|
|
208
|
+
readonly output: ["text"];
|
|
209
|
+
readonly endpoints: ["chat"];
|
|
210
|
+
readonly features: ["streaming", "tools", "json_object", "json_schema", "reasoning", "vision"];
|
|
211
|
+
readonly tools: readonly [];
|
|
212
|
+
};
|
|
213
|
+
readonly reasoning: {
|
|
214
|
+
readonly levels: {
|
|
215
|
+
readonly minimal: "minimal";
|
|
216
|
+
readonly low: "low";
|
|
217
|
+
readonly medium: "medium";
|
|
218
|
+
readonly high: "high";
|
|
219
|
+
readonly xhigh: "xhigh";
|
|
220
|
+
};
|
|
221
|
+
readonly budget: false;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* All supported Muse chat model identifiers.
|
|
226
|
+
*/
|
|
227
|
+
export declare const MUSE_CHAT_MODELS: readonly ["muse-ember-1.0", "muse-wonder-1.0", "muse-spark-1.3", "muse-spark-1.3-contributor", "muse-spark-1.2", "muse-spark-1.2-contributor", "muse-spark-1.1"];
|
|
228
|
+
/**
|
|
229
|
+
* Union type of all supported Muse chat model names.
|
|
230
|
+
*/
|
|
231
|
+
export type MuseChatModels = (typeof MUSE_CHAT_MODELS)[number];
|
|
232
|
+
/**
|
|
233
|
+
* Type-only map from Muse chat model name to its supported input modalities.
|
|
234
|
+
*/
|
|
235
|
+
export type MuseModelInputModalitiesByName = {
|
|
236
|
+
[EMBER_1_0.name]: typeof EMBER_1_0.supports.input;
|
|
237
|
+
[WONDER_1_0.name]: typeof WONDER_1_0.supports.input;
|
|
238
|
+
[SPARK_1_3.name]: typeof SPARK_1_3.supports.input;
|
|
239
|
+
[SPARK_1_3_CONTRIBUTOR.name]: typeof SPARK_1_3_CONTRIBUTOR.supports.input;
|
|
240
|
+
[SPARK_1_2.name]: typeof SPARK_1_2.supports.input;
|
|
241
|
+
[SPARK_1_2_CONTRIBUTOR.name]: typeof SPARK_1_2_CONTRIBUTOR.supports.input;
|
|
242
|
+
[SPARK_1_1.name]: typeof SPARK_1_1.supports.input;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Runtime map from chat model name to its supported input modalities, for the
|
|
246
|
+
* text adapter's `inputModalities`. `satisfies` keeps it equal to
|
|
247
|
+
* {@link MuseModelInputModalitiesByName}. An unknown name gives `undefined`.
|
|
248
|
+
*/
|
|
249
|
+
export declare const MUSE_MODEL_INPUT_MODALITIES: Readonly<Record<string, ReadonlyArray<Modality>>>;
|
|
250
|
+
/**
|
|
251
|
+
* Type-only map from Muse chat model name to its provider options type.
|
|
252
|
+
*/
|
|
253
|
+
export type MuseChatModelProviderOptionsByName = {
|
|
254
|
+
[K in (typeof MUSE_CHAT_MODELS)[number]]: MuseTextProviderOptions;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Type-only map from Muse chat model name to its supported provider tools.
|
|
258
|
+
* Muse exposes no provider-specific tool factories, so every model gets an
|
|
259
|
+
* empty tuple. This makes passing another provider's ProviderTool to a Muse
|
|
260
|
+
* adapter a compile-time type error.
|
|
261
|
+
*/
|
|
262
|
+
export type MuseChatModelToolCapabilitiesByName = {
|
|
263
|
+
[EMBER_1_0.name]: typeof EMBER_1_0.supports.tools;
|
|
264
|
+
[WONDER_1_0.name]: typeof WONDER_1_0.supports.tools;
|
|
265
|
+
[SPARK_1_3.name]: typeof SPARK_1_3.supports.tools;
|
|
266
|
+
[SPARK_1_3_CONTRIBUTOR.name]: typeof SPARK_1_3_CONTRIBUTOR.supports.tools;
|
|
267
|
+
[SPARK_1_2.name]: typeof SPARK_1_2.supports.tools;
|
|
268
|
+
[SPARK_1_2_CONTRIBUTOR.name]: typeof SPARK_1_2_CONTRIBUTOR.supports.tools;
|
|
269
|
+
[SPARK_1_1.name]: typeof SPARK_1_1.supports.tools;
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* Resolves the provider options type for a specific Muse model.
|
|
273
|
+
*/
|
|
274
|
+
export type ResolveProviderOptions<TModel extends string> = TModel extends keyof MuseChatModelProviderOptionsByName ? MuseChatModelProviderOptionsByName[TModel] : MuseTextProviderOptions;
|
|
275
|
+
/**
|
|
276
|
+
* Resolve input modalities for a specific model. If the model has explicit
|
|
277
|
+
* modalities in the map, use those; otherwise use text only.
|
|
278
|
+
*/
|
|
279
|
+
export type ResolveInputModalities<TModel extends string> = TModel extends keyof MuseModelInputModalitiesByName ? MuseModelInputModalitiesByName[TModel] : readonly ['text'];
|
|
280
|
+
declare const MUSE_REASONING: {
|
|
281
|
+
"muse-ember-1.0": {
|
|
282
|
+
readonly levels: {
|
|
283
|
+
readonly minimal: "minimal";
|
|
284
|
+
readonly low: "low";
|
|
285
|
+
readonly medium: "medium";
|
|
286
|
+
readonly high: "high";
|
|
287
|
+
readonly xhigh: "xhigh";
|
|
288
|
+
readonly max: "max";
|
|
289
|
+
};
|
|
290
|
+
readonly budget: false;
|
|
291
|
+
};
|
|
292
|
+
"muse-wonder-1.0": {
|
|
293
|
+
readonly levels: {
|
|
294
|
+
readonly minimal: "minimal";
|
|
295
|
+
readonly low: "low";
|
|
296
|
+
readonly medium: "medium";
|
|
297
|
+
readonly high: "high";
|
|
298
|
+
readonly xhigh: "xhigh";
|
|
299
|
+
readonly max: "max";
|
|
300
|
+
};
|
|
301
|
+
readonly budget: false;
|
|
302
|
+
};
|
|
303
|
+
"muse-spark-1.3": {
|
|
304
|
+
readonly levels: {
|
|
305
|
+
readonly minimal: "minimal";
|
|
306
|
+
readonly low: "low";
|
|
307
|
+
readonly medium: "medium";
|
|
308
|
+
readonly high: "high";
|
|
309
|
+
readonly xhigh: "xhigh";
|
|
310
|
+
readonly max: "max";
|
|
311
|
+
};
|
|
312
|
+
readonly budget: false;
|
|
313
|
+
};
|
|
314
|
+
"muse-spark-1.3-contributor": {
|
|
315
|
+
readonly levels: {
|
|
316
|
+
readonly minimal: "minimal";
|
|
317
|
+
readonly low: "low";
|
|
318
|
+
readonly medium: "medium";
|
|
319
|
+
readonly high: "high";
|
|
320
|
+
readonly xhigh: "xhigh";
|
|
321
|
+
};
|
|
322
|
+
readonly budget: false;
|
|
323
|
+
};
|
|
324
|
+
"muse-spark-1.2": {
|
|
325
|
+
readonly levels: {
|
|
326
|
+
readonly minimal: "minimal";
|
|
327
|
+
readonly low: "low";
|
|
328
|
+
readonly medium: "medium";
|
|
329
|
+
readonly high: "high";
|
|
330
|
+
readonly xhigh: "xhigh";
|
|
331
|
+
};
|
|
332
|
+
readonly budget: false;
|
|
333
|
+
};
|
|
334
|
+
"muse-spark-1.2-contributor": {
|
|
335
|
+
readonly levels: {
|
|
336
|
+
readonly minimal: "minimal";
|
|
337
|
+
readonly low: "low";
|
|
338
|
+
readonly medium: "medium";
|
|
339
|
+
readonly high: "high";
|
|
340
|
+
readonly xhigh: "xhigh";
|
|
341
|
+
};
|
|
342
|
+
readonly budget: false;
|
|
343
|
+
};
|
|
344
|
+
"muse-spark-1.1": {
|
|
345
|
+
readonly levels: {
|
|
346
|
+
readonly minimal: "minimal";
|
|
347
|
+
readonly low: "low";
|
|
348
|
+
readonly medium: "medium";
|
|
349
|
+
readonly high: "high";
|
|
350
|
+
readonly xhigh: "xhigh";
|
|
351
|
+
};
|
|
352
|
+
readonly budget: false;
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
/**
|
|
356
|
+
* Each chat model's reasoning levels, and whether it takes a token budget, for
|
|
357
|
+
* `chat({ reasoning })`. Derived from the `reasoning` field. A model that is
|
|
358
|
+
* not here does not reason.
|
|
359
|
+
*/
|
|
360
|
+
export type MuseModelReasoningByName = {
|
|
361
|
+
[K in keyof typeof MUSE_REASONING]: ModelReasoningCapability<(typeof MUSE_REASONING)[K]>;
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* Runtime map from chat model name to its reasoning data, for the text
|
|
365
|
+
* adapter. An unknown name gives `undefined`: the adapter sends no reasoning
|
|
366
|
+
* field.
|
|
367
|
+
*/
|
|
368
|
+
export declare const MUSE_MODEL_REASONING: Readonly<Record<string, ModelReasoning>>;
|
|
369
|
+
export {};
|