@mastra/core 0.2.0-alpha.83 → 0.2.0-alpha.86
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/README.md +1 -1
- package/dist/action/index.d.ts +3 -3
- package/dist/agent/index.d.ts +6 -6
- package/dist/agent/index.js +6 -6
- package/dist/base.d.ts +3 -3
- package/dist/base.js +2 -2
- package/dist/bundler/index.d.ts +21 -0
- package/dist/bundler/index.js +4 -0
- package/dist/chunk-2ISN3AA7.js +392 -0
- package/dist/chunk-2J5OHBUG.js +24 -0
- package/dist/{chunk-Y7TKCKRI.js → chunk-5NQ3MEZM.js} +8 -8
- package/dist/{chunk-K7KUCZT2.js → chunk-6WJREZ5F.js} +2 -2
- package/dist/{chunk-RPBNMIV7.js → chunk-73XDWPXJ.js} +84 -52
- package/dist/chunk-CQYUMNLZ.js +28 -0
- package/dist/{chunk-AO76Z4K3.js → chunk-D66E7L7R.js} +1 -1
- package/dist/{chunk-FCRDS4YS.js → chunk-EH2PG7Q6.js} +10 -4
- package/dist/{chunk-BWEOV64I.js → chunk-EVYBUFXB.js} +13 -9
- package/dist/{chunk-OJJ6QGX4.js → chunk-I3MJB67Z.js} +12 -12
- package/dist/{chunk-27EL4TRB.js → chunk-JCRGAEY6.js} +1 -1
- package/dist/{chunk-BQMCLBCR.js → chunk-OOZGW5CY.js} +1 -1
- package/dist/{chunk-LYNJHHQX.js → chunk-RCS7AVH6.js} +2 -2
- package/dist/chunk-RLPH6TDJ.js +30 -0
- package/dist/{chunk-FROFMREE.js → chunk-RZYBOMIG.js} +7 -0
- package/dist/{chunk-Q5JF3TKZ.js → chunk-SLWM3SEH.js} +1 -1
- package/dist/{chunk-NLQVQJOD.js → chunk-TJK6TGSR.js} +1 -0
- package/dist/{chunk-S45F6AHA.js → chunk-U25DBVJZ.js} +1 -1
- package/dist/chunk-XD5IQZRB.js +16 -0
- package/dist/deployer/index.d.ts +8 -25
- package/dist/deployer/index.js +4 -3
- package/dist/embeddings/index.d.ts +2 -2
- package/dist/embeddings/index.js +1 -1
- package/dist/engine/index.d.ts +2 -2
- package/dist/engine/index.js +3 -3
- package/dist/eval/index.d.ts +3 -3
- package/dist/filter/index.d.ts +7 -6
- package/dist/filter/index.js +1 -1
- package/dist/{index-B9i6dmc0.d.ts → index-B0-NXUYv.d.ts} +1 -0
- package/dist/{index-CA9EWqaj.d.ts → index-Duqv1Yom.d.ts} +50 -27
- package/dist/index.d.ts +15 -13
- package/dist/index.js +26 -25
- package/dist/integration/index.d.ts +4 -4
- package/dist/llm/index.d.ts +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/providers/anthropic-vertex.d.ts +31 -0
- package/dist/llm/model/providers/anthropic-vertex.js +23 -0
- package/dist/llm/model/providers/anthropic.d.ts +29 -0
- package/dist/llm/model/providers/anthropic.js +21 -0
- package/dist/llm/model/providers/azure.d.ts +48 -0
- package/dist/llm/model/providers/azure.js +50 -0
- package/dist/llm/model/providers/baseten.d.ts +33 -0
- package/dist/llm/model/providers/baseten.js +29 -0
- package/dist/llm/model/providers/bedrock.d.ts +32 -0
- package/dist/llm/model/providers/bedrock.js +24 -0
- package/dist/llm/model/providers/cerebras.d.ts +30 -0
- package/dist/llm/model/providers/cerebras.js +22 -0
- package/dist/llm/model/providers/cohere.d.ts +30 -0
- package/dist/llm/model/providers/cohere.js +22 -0
- package/dist/llm/model/providers/deepinfra.d.ts +30 -0
- package/dist/llm/model/providers/deepinfra.js +22 -0
- package/dist/llm/model/providers/deepseek.d.ts +30 -0
- package/dist/llm/model/providers/deepseek.js +22 -0
- package/dist/llm/model/providers/fireworks.d.ts +35 -0
- package/dist/llm/model/providers/fireworks.js +40 -0
- package/dist/llm/model/providers/google-vertex.d.ts +48 -0
- package/dist/llm/model/providers/google-vertex.js +22 -0
- package/dist/llm/model/providers/google.d.ts +54 -0
- package/dist/llm/model/providers/google.js +23 -0
- package/dist/llm/model/providers/grok.d.ts +32 -0
- package/dist/llm/model/providers/grok.js +22 -0
- package/dist/llm/model/providers/groq.d.ts +37 -0
- package/dist/llm/model/providers/groq.js +42 -0
- package/dist/llm/model/providers/lmstudio.d.ts +29 -0
- package/dist/llm/model/providers/lmstudio.js +22 -0
- package/dist/llm/model/providers/mistral.d.ts +30 -0
- package/dist/llm/model/providers/mistral.js +22 -0
- package/dist/llm/model/providers/mock.d.ts +30 -0
- package/dist/llm/model/providers/mock.js +83 -0
- package/dist/llm/model/providers/ollama.d.ts +31 -0
- package/dist/llm/model/providers/ollama.js +23 -0
- package/dist/llm/model/providers/openai-compat.d.ts +39 -0
- package/dist/llm/model/providers/openai-compat.js +6 -0
- package/dist/llm/model/providers/openai.d.ts +34 -0
- package/dist/llm/model/providers/openai.js +6 -0
- package/dist/llm/model/providers/openai.test.d.ts +2 -0
- package/dist/llm/model/providers/openai.test.js +220 -0
- package/dist/llm/model/providers/perplexity.d.ts +30 -0
- package/dist/llm/model/providers/perplexity.js +22 -0
- package/dist/llm/model/providers/portkey.d.ts +34 -0
- package/dist/llm/model/providers/portkey.js +22 -0
- package/dist/llm/model/providers/togetherai.d.ts +30 -0
- package/dist/llm/model/providers/togetherai.js +22 -0
- package/dist/logger/index.d.ts +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/mastra/index.d.ts +5 -4
- package/dist/mastra/index.js +5 -5
- package/dist/memory/index.d.ts +3 -3
- package/dist/memory/index.js +3 -3
- package/dist/model-QGWIMOSx.d.ts +31 -0
- package/dist/relevance/index.d.ts +3 -3
- package/dist/relevance/index.js +7 -7
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.js +3 -3
- package/dist/telemetry/index.d.ts +5 -103
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry-oCUM52DG.d.ts +104 -0
- package/dist/tools/index.d.ts +4 -4
- package/dist/tts/index.d.ts +2 -2
- package/dist/tts/index.js +4 -4
- package/dist/vector/index.d.ts +2 -2
- package/dist/vector/index.js +4 -4
- package/dist/{workflow-Dam5GtdA.d.ts → workflow-DQ8CtzzU.d.ts} +1 -1
- package/dist/workflows/index.d.ts +5 -5
- package/dist/workflows/index.js +3 -3
- package/package.json +30 -15
- package/dist/chunk-5R6DBXQM.js +0 -57
- /package/dist/{chunk-OZZS5Y3C.js → chunk-SDKEPBBH.js} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MastraLLM } from '../../../chunk-2ISN3AA7.js';
|
|
2
|
+
import '../../../chunk-LUULSM4U.js';
|
|
3
|
+
import '../../../chunk-JCRGAEY6.js';
|
|
4
|
+
import '../../../chunk-TJK6TGSR.js';
|
|
5
|
+
import { __name } from '../../../chunk-AJJZUHB4.js';
|
|
6
|
+
import { createGoogleGenerativeAI } from '@ai-sdk/google';
|
|
7
|
+
|
|
8
|
+
var _Gemini = class _Gemini extends MastraLLM {
|
|
9
|
+
constructor({ name = "gemini-1.5-pro-latest", apiKey = process.env.GOOGLE_GENERATIVE_AI_API_KEY || "", settings } = {}) {
|
|
10
|
+
const google = createGoogleGenerativeAI({
|
|
11
|
+
baseURL: "https://generativelanguage.googleapis.com/v1beta",
|
|
12
|
+
apiKey
|
|
13
|
+
});
|
|
14
|
+
const gemini = google(name, settings);
|
|
15
|
+
super({
|
|
16
|
+
model: gemini
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
__name(_Gemini, "Gemini");
|
|
21
|
+
var Gemini = _Gemini;
|
|
22
|
+
|
|
23
|
+
export { Gemini };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { OpenAIChatSettings } from '@ai-sdk/openai/internal';
|
|
2
|
+
import { M as MastraLLM } from '../../../model-QGWIMOSx.js';
|
|
3
|
+
import 'ai';
|
|
4
|
+
import 'json-schema';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import '../../../index-Duqv1Yom.js';
|
|
7
|
+
import '../../../base.js';
|
|
8
|
+
import '@opentelemetry/api';
|
|
9
|
+
import '../../../index-B0-NXUYv.js';
|
|
10
|
+
import 'pino';
|
|
11
|
+
import 'stream';
|
|
12
|
+
import '../../../telemetry-oCUM52DG.js';
|
|
13
|
+
import '@opentelemetry/sdk-node';
|
|
14
|
+
import '@opentelemetry/sdk-trace-base';
|
|
15
|
+
import '../../../metric-D2V4CR8D.js';
|
|
16
|
+
import 'sift';
|
|
17
|
+
import '../../../types-M16hSruO.js';
|
|
18
|
+
import '../../../vector/index.js';
|
|
19
|
+
import '../../../engine-EwEG-4Iv.js';
|
|
20
|
+
import '../../../tts/index.js';
|
|
21
|
+
|
|
22
|
+
type XGrokModel = 'grok-beta' | 'grok-vision-beta' | 'grok-2-1212' | 'grok-2-vision-1212' | (string & {});
|
|
23
|
+
declare class Grok extends MastraLLM {
|
|
24
|
+
constructor({ name, apiKey, baseURL, settings, }: {
|
|
25
|
+
settings?: OpenAIChatSettings;
|
|
26
|
+
name?: string;
|
|
27
|
+
apiKey?: string;
|
|
28
|
+
baseURL?: string;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { Grok, type XGrokModel };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MastraLLM } from '../../../chunk-2ISN3AA7.js';
|
|
2
|
+
import '../../../chunk-LUULSM4U.js';
|
|
3
|
+
import '../../../chunk-JCRGAEY6.js';
|
|
4
|
+
import '../../../chunk-TJK6TGSR.js';
|
|
5
|
+
import { __name } from '../../../chunk-AJJZUHB4.js';
|
|
6
|
+
import { createXai } from '@ai-sdk/xai';
|
|
7
|
+
|
|
8
|
+
var _Grok = class _Grok extends MastraLLM {
|
|
9
|
+
constructor({ name = "grok-beta", apiKey = process.env.XAI_API_KEY ?? "", baseURL = "https://api.x.ai/v1", settings }) {
|
|
10
|
+
const xAi = createXai({
|
|
11
|
+
baseURL,
|
|
12
|
+
apiKey
|
|
13
|
+
});
|
|
14
|
+
super({
|
|
15
|
+
model: xAi(name, settings)
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
__name(_Grok, "Grok");
|
|
20
|
+
var Grok = _Grok;
|
|
21
|
+
|
|
22
|
+
export { Grok };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { M as MastraLLM } from '../../../model-QGWIMOSx.js';
|
|
2
|
+
import 'ai';
|
|
3
|
+
import 'json-schema';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import '../../../index-Duqv1Yom.js';
|
|
6
|
+
import '../../../base.js';
|
|
7
|
+
import '@opentelemetry/api';
|
|
8
|
+
import '../../../index-B0-NXUYv.js';
|
|
9
|
+
import 'pino';
|
|
10
|
+
import 'stream';
|
|
11
|
+
import '../../../telemetry-oCUM52DG.js';
|
|
12
|
+
import '@opentelemetry/sdk-node';
|
|
13
|
+
import '@opentelemetry/sdk-trace-base';
|
|
14
|
+
import '../../../metric-D2V4CR8D.js';
|
|
15
|
+
import 'sift';
|
|
16
|
+
import '../../../types-M16hSruO.js';
|
|
17
|
+
import '../../../vector/index.js';
|
|
18
|
+
import '../../../engine-EwEG-4Iv.js';
|
|
19
|
+
import '../../../tts/index.js';
|
|
20
|
+
|
|
21
|
+
type GroqModel = 'llama3-groq-70b-8192-tool-use-preview' | 'llama3-groq-8b-8192-tool-use-preview' | 'gemma2-9b-it' | 'gemma-7b-it' | (string & {});
|
|
22
|
+
declare class Groq extends MastraLLM {
|
|
23
|
+
constructor({ name, apiKey, baseURL, }?: {
|
|
24
|
+
name?: GroqModel;
|
|
25
|
+
apiKey?: string;
|
|
26
|
+
baseURL?: string;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
declare class GroqReasoning extends MastraLLM {
|
|
30
|
+
constructor({ name, apiKey, baseURL, }?: {
|
|
31
|
+
name?: 'deepseek-r1-distill-llama-70b';
|
|
32
|
+
apiKey?: string;
|
|
33
|
+
baseURL?: string;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { Groq, type GroqModel, GroqReasoning };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { MastraLLM } from '../../../chunk-2ISN3AA7.js';
|
|
2
|
+
import '../../../chunk-LUULSM4U.js';
|
|
3
|
+
import '../../../chunk-JCRGAEY6.js';
|
|
4
|
+
import '../../../chunk-TJK6TGSR.js';
|
|
5
|
+
import { __name } from '../../../chunk-AJJZUHB4.js';
|
|
6
|
+
import { createGroq } from '@ai-sdk/groq';
|
|
7
|
+
import { wrapLanguageModel, extractReasoningMiddleware } from 'ai';
|
|
8
|
+
|
|
9
|
+
var _Groq = class _Groq extends MastraLLM {
|
|
10
|
+
constructor({ name = "gemma2-9b-it", apiKey = process.env.GROQ_API_KEY || "", baseURL = "https://api.groq.com/openai/v1" } = {}) {
|
|
11
|
+
const groqModel = createGroq({
|
|
12
|
+
baseURL,
|
|
13
|
+
apiKey
|
|
14
|
+
});
|
|
15
|
+
super({
|
|
16
|
+
model: groqModel(name)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
__name(_Groq, "Groq");
|
|
21
|
+
var Groq = _Groq;
|
|
22
|
+
var _GroqReasoning = class _GroqReasoning extends MastraLLM {
|
|
23
|
+
constructor({ name = "deepseek-r1-distill-llama-70b", apiKey = process.env.GROQ_API_KEY || "", baseURL = "https://api.groq.com/openai/v1" } = {}) {
|
|
24
|
+
const groqModel = createGroq({
|
|
25
|
+
baseURL,
|
|
26
|
+
apiKey
|
|
27
|
+
});
|
|
28
|
+
const enhancedModel = wrapLanguageModel({
|
|
29
|
+
model: groqModel(name),
|
|
30
|
+
middleware: extractReasoningMiddleware({
|
|
31
|
+
tagName: "think"
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
super({
|
|
35
|
+
model: enhancedModel
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
__name(_GroqReasoning, "GroqReasoning");
|
|
40
|
+
var GroqReasoning = _GroqReasoning;
|
|
41
|
+
|
|
42
|
+
export { Groq, GroqReasoning };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { M as MastraLLM } from '../../../model-QGWIMOSx.js';
|
|
2
|
+
import 'ai';
|
|
3
|
+
import 'json-schema';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import '../../../index-Duqv1Yom.js';
|
|
6
|
+
import '../../../base.js';
|
|
7
|
+
import '@opentelemetry/api';
|
|
8
|
+
import '../../../index-B0-NXUYv.js';
|
|
9
|
+
import 'pino';
|
|
10
|
+
import 'stream';
|
|
11
|
+
import '../../../telemetry-oCUM52DG.js';
|
|
12
|
+
import '@opentelemetry/sdk-node';
|
|
13
|
+
import '@opentelemetry/sdk-trace-base';
|
|
14
|
+
import '../../../metric-D2V4CR8D.js';
|
|
15
|
+
import 'sift';
|
|
16
|
+
import '../../../types-M16hSruO.js';
|
|
17
|
+
import '../../../vector/index.js';
|
|
18
|
+
import '../../../engine-EwEG-4Iv.js';
|
|
19
|
+
import '../../../tts/index.js';
|
|
20
|
+
|
|
21
|
+
type LMStudioModel = 'qwen2-7b-instruct-4bit' | 'qwen2-math-1.5b' | 'qwen2-0.5b' | 'aya-23-8b' | 'mistral-7b-v0.3' | 'stablecode' | 'cohere-command-r-v01-4bit' | 'command-r' | 'starcoder2-7b' | 'deepseek-math-7b' | 'qwen2.5-coder-14b' | 'qwen2.5-coder-32b' | 'qwen2.5-coder-3b' | 'llama-3.2-3b-instruct-4bit' | 'llama-3.2-1b' | 'llama-3.2-3b' | 'qwen2.5-coder-7b' | 'qwen2.5-14b' | 'yi-coder-9b' | 'hermes-3-llama-3.1-8b' | 'internlm-2.5-20b' | 'llava-v1.5' | 'llama-3.1-8b-instruct-4bit' | 'meta-llama-3.1-8b' | 'mistral-nemo-2407' | 'mistral-nemo-instruct-2407-4bit' | 'gemma-2-2b' | 'mathstral-7b' | 'gemma-2-9b' | 'deepseek-coder-v2-lite-instruct-4bit' | 'smollm-360m-v0.2' | 'phi-3-mini-4k-instruct-4bit' | 'gemma-2-27b' | 'codestral-22b' | 'phi-3.1-mini-128k' | 'deepseek-coder-v2-lite' | (string & {});
|
|
22
|
+
declare class LMStudio extends MastraLLM {
|
|
23
|
+
constructor({ name, baseURL }: {
|
|
24
|
+
name: LMStudioModel;
|
|
25
|
+
baseURL: string;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { LMStudio, type LMStudioModel };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { openaiCompat } from '../../../chunk-RLPH6TDJ.js';
|
|
2
|
+
import { MastraLLM } from '../../../chunk-2ISN3AA7.js';
|
|
3
|
+
import '../../../chunk-LUULSM4U.js';
|
|
4
|
+
import '../../../chunk-JCRGAEY6.js';
|
|
5
|
+
import '../../../chunk-TJK6TGSR.js';
|
|
6
|
+
import { __name } from '../../../chunk-AJJZUHB4.js';
|
|
7
|
+
|
|
8
|
+
// src/llm/model/providers/lmstudio.ts
|
|
9
|
+
var _LMStudio = class _LMStudio extends MastraLLM {
|
|
10
|
+
constructor({ name, baseURL }) {
|
|
11
|
+
super({
|
|
12
|
+
model: openaiCompat({
|
|
13
|
+
modelName: name,
|
|
14
|
+
baseURL
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
__name(_LMStudio, "LMStudio");
|
|
20
|
+
var LMStudio = _LMStudio;
|
|
21
|
+
|
|
22
|
+
export { LMStudio };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { M as MastraLLM } from '../../../model-QGWIMOSx.js';
|
|
2
|
+
import 'ai';
|
|
3
|
+
import 'json-schema';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import '../../../index-Duqv1Yom.js';
|
|
6
|
+
import '../../../base.js';
|
|
7
|
+
import '@opentelemetry/api';
|
|
8
|
+
import '../../../index-B0-NXUYv.js';
|
|
9
|
+
import 'pino';
|
|
10
|
+
import 'stream';
|
|
11
|
+
import '../../../telemetry-oCUM52DG.js';
|
|
12
|
+
import '@opentelemetry/sdk-node';
|
|
13
|
+
import '@opentelemetry/sdk-trace-base';
|
|
14
|
+
import '../../../metric-D2V4CR8D.js';
|
|
15
|
+
import 'sift';
|
|
16
|
+
import '../../../types-M16hSruO.js';
|
|
17
|
+
import '../../../vector/index.js';
|
|
18
|
+
import '../../../engine-EwEG-4Iv.js';
|
|
19
|
+
import '../../../tts/index.js';
|
|
20
|
+
|
|
21
|
+
type MistralModel = 'pixtral-large-latest' | 'mistral-large-latest' | 'mistral-small-latest' | 'ministral-3b-latest' | 'ministral-8b-latest' | 'pixtral-12b-2409' | (string & {});
|
|
22
|
+
declare class Mistral extends MastraLLM {
|
|
23
|
+
constructor({ name, apiKey, baseURL, }?: {
|
|
24
|
+
name?: MistralModel;
|
|
25
|
+
apiKey?: string;
|
|
26
|
+
baseURL?: string;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Mistral, type MistralModel };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MastraLLM } from '../../../chunk-2ISN3AA7.js';
|
|
2
|
+
import '../../../chunk-LUULSM4U.js';
|
|
3
|
+
import '../../../chunk-JCRGAEY6.js';
|
|
4
|
+
import '../../../chunk-TJK6TGSR.js';
|
|
5
|
+
import { __name } from '../../../chunk-AJJZUHB4.js';
|
|
6
|
+
import { createMistral } from '@ai-sdk/mistral';
|
|
7
|
+
|
|
8
|
+
var _Mistral = class _Mistral extends MastraLLM {
|
|
9
|
+
constructor({ name = "pixtral-large-latest", apiKey = process.env.MISTRAL_API_KEY || "", baseURL = "https://api.mistral.ai/v1" } = {}) {
|
|
10
|
+
const mistralModel = createMistral({
|
|
11
|
+
baseURL,
|
|
12
|
+
apiKey
|
|
13
|
+
});
|
|
14
|
+
super({
|
|
15
|
+
model: mistralModel(name)
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
__name(_Mistral, "Mistral");
|
|
20
|
+
var Mistral = _Mistral;
|
|
21
|
+
|
|
22
|
+
export { Mistral };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { M as MastraLLM } from '../../../model-QGWIMOSx.js';
|
|
2
|
+
import 'ai';
|
|
3
|
+
import 'json-schema';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import '../../../index-Duqv1Yom.js';
|
|
6
|
+
import '../../../base.js';
|
|
7
|
+
import '@opentelemetry/api';
|
|
8
|
+
import '../../../index-B0-NXUYv.js';
|
|
9
|
+
import 'pino';
|
|
10
|
+
import 'stream';
|
|
11
|
+
import '../../../telemetry-oCUM52DG.js';
|
|
12
|
+
import '@opentelemetry/sdk-node';
|
|
13
|
+
import '@opentelemetry/sdk-trace-base';
|
|
14
|
+
import '../../../metric-D2V4CR8D.js';
|
|
15
|
+
import 'sift';
|
|
16
|
+
import '../../../types-M16hSruO.js';
|
|
17
|
+
import '../../../vector/index.js';
|
|
18
|
+
import '../../../engine-EwEG-4Iv.js';
|
|
19
|
+
import '../../../tts/index.js';
|
|
20
|
+
|
|
21
|
+
declare class MockProvider extends MastraLLM {
|
|
22
|
+
constructor({ spyGenerate, spyStream, objectGenerationMode, mockText, }: {
|
|
23
|
+
spyGenerate?: (props: any) => void;
|
|
24
|
+
spyStream?: (props: any) => void;
|
|
25
|
+
objectGenerationMode?: 'json';
|
|
26
|
+
mockText?: string | Record<string, any>;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { MockProvider };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { MastraLLM } from '../../../chunk-2ISN3AA7.js';
|
|
2
|
+
import '../../../chunk-LUULSM4U.js';
|
|
3
|
+
import '../../../chunk-JCRGAEY6.js';
|
|
4
|
+
import '../../../chunk-TJK6TGSR.js';
|
|
5
|
+
import { __name } from '../../../chunk-AJJZUHB4.js';
|
|
6
|
+
import { simulateReadableStream } from 'ai';
|
|
7
|
+
import { MockLanguageModelV1 } from 'ai/test';
|
|
8
|
+
|
|
9
|
+
var _MockProvider = class _MockProvider extends MastraLLM {
|
|
10
|
+
constructor({ spyGenerate, spyStream, objectGenerationMode, mockText = "Hello, world!" }) {
|
|
11
|
+
const mockModel = new MockLanguageModelV1({
|
|
12
|
+
defaultObjectGenerationMode: objectGenerationMode,
|
|
13
|
+
doGenerate: /* @__PURE__ */ __name(async (props) => {
|
|
14
|
+
if (spyGenerate) {
|
|
15
|
+
spyGenerate(props);
|
|
16
|
+
}
|
|
17
|
+
if (objectGenerationMode === "json") {
|
|
18
|
+
return {
|
|
19
|
+
rawCall: {
|
|
20
|
+
rawPrompt: null,
|
|
21
|
+
rawSettings: {}
|
|
22
|
+
},
|
|
23
|
+
finishReason: "stop",
|
|
24
|
+
usage: {
|
|
25
|
+
promptTokens: 10,
|
|
26
|
+
completionTokens: 20
|
|
27
|
+
},
|
|
28
|
+
text: JSON.stringify(mockText)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
rawCall: {
|
|
33
|
+
rawPrompt: null,
|
|
34
|
+
rawSettings: {}
|
|
35
|
+
},
|
|
36
|
+
finishReason: "stop",
|
|
37
|
+
usage: {
|
|
38
|
+
promptTokens: 10,
|
|
39
|
+
completionTokens: 20
|
|
40
|
+
},
|
|
41
|
+
text: typeof mockText === "string" ? mockText : JSON.stringify(mockText)
|
|
42
|
+
};
|
|
43
|
+
}, "doGenerate"),
|
|
44
|
+
doStream: /* @__PURE__ */ __name(async (props) => {
|
|
45
|
+
if (spyStream) {
|
|
46
|
+
spyStream(props);
|
|
47
|
+
}
|
|
48
|
+
const text = typeof mockText === "string" ? mockText : JSON.stringify(mockText);
|
|
49
|
+
const chunks = text.split(" ").map((word) => ({
|
|
50
|
+
type: "text-delta",
|
|
51
|
+
textDelta: word + " "
|
|
52
|
+
}));
|
|
53
|
+
return {
|
|
54
|
+
stream: simulateReadableStream({
|
|
55
|
+
chunks: [
|
|
56
|
+
...chunks,
|
|
57
|
+
{
|
|
58
|
+
type: "finish",
|
|
59
|
+
finishReason: "stop",
|
|
60
|
+
logprobs: undefined,
|
|
61
|
+
usage: {
|
|
62
|
+
completionTokens: 10,
|
|
63
|
+
promptTokens: 3
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}),
|
|
68
|
+
rawCall: {
|
|
69
|
+
rawPrompt: null,
|
|
70
|
+
rawSettings: {}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}, "doStream")
|
|
74
|
+
});
|
|
75
|
+
super({
|
|
76
|
+
model: mockModel
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
__name(_MockProvider, "MockProvider");
|
|
81
|
+
var MockProvider = _MockProvider;
|
|
82
|
+
|
|
83
|
+
export { MockProvider };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { M as MastraLLM } from '../../../model-QGWIMOSx.js';
|
|
2
|
+
import 'ai';
|
|
3
|
+
import 'json-schema';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import '../../../index-Duqv1Yom.js';
|
|
6
|
+
import '../../../base.js';
|
|
7
|
+
import '@opentelemetry/api';
|
|
8
|
+
import '../../../index-B0-NXUYv.js';
|
|
9
|
+
import 'pino';
|
|
10
|
+
import 'stream';
|
|
11
|
+
import '../../../telemetry-oCUM52DG.js';
|
|
12
|
+
import '@opentelemetry/sdk-node';
|
|
13
|
+
import '@opentelemetry/sdk-trace-base';
|
|
14
|
+
import '../../../metric-D2V4CR8D.js';
|
|
15
|
+
import 'sift';
|
|
16
|
+
import '../../../types-M16hSruO.js';
|
|
17
|
+
import '../../../vector/index.js';
|
|
18
|
+
import '../../../engine-EwEG-4Iv.js';
|
|
19
|
+
import '../../../tts/index.js';
|
|
20
|
+
|
|
21
|
+
type OllamaModel = string & {};
|
|
22
|
+
declare class OllamaAI extends MastraLLM {
|
|
23
|
+
constructor({ name, baseURL, headers, fetch, }: {
|
|
24
|
+
name: OllamaModel;
|
|
25
|
+
baseURL: string;
|
|
26
|
+
headers?: Record<string, string>;
|
|
27
|
+
fetch?: typeof globalThis.fetch;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { OllamaAI, type OllamaModel };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MastraLLM } from '../../../chunk-2ISN3AA7.js';
|
|
2
|
+
import '../../../chunk-LUULSM4U.js';
|
|
3
|
+
import '../../../chunk-JCRGAEY6.js';
|
|
4
|
+
import '../../../chunk-TJK6TGSR.js';
|
|
5
|
+
import { __name } from '../../../chunk-AJJZUHB4.js';
|
|
6
|
+
import { createOllama } from 'ollama-ai-provider';
|
|
7
|
+
|
|
8
|
+
var _OllamaAI = class _OllamaAI extends MastraLLM {
|
|
9
|
+
constructor({ name, baseURL, headers, fetch }) {
|
|
10
|
+
const ollama = createOllama({
|
|
11
|
+
baseURL,
|
|
12
|
+
fetch,
|
|
13
|
+
headers
|
|
14
|
+
});
|
|
15
|
+
super({
|
|
16
|
+
model: ollama(name)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
__name(_OllamaAI, "OllamaAI");
|
|
21
|
+
var OllamaAI = _OllamaAI;
|
|
22
|
+
|
|
23
|
+
export { OllamaAI };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { OpenAIChatSettings } from '@ai-sdk/openai/internal';
|
|
3
|
+
import { M as MastraLLM } from '../../../model-QGWIMOSx.js';
|
|
4
|
+
import 'json-schema';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import '../../../index-Duqv1Yom.js';
|
|
7
|
+
import '../../../base.js';
|
|
8
|
+
import '@opentelemetry/api';
|
|
9
|
+
import '../../../index-B0-NXUYv.js';
|
|
10
|
+
import 'pino';
|
|
11
|
+
import 'stream';
|
|
12
|
+
import '../../../telemetry-oCUM52DG.js';
|
|
13
|
+
import '@opentelemetry/sdk-node';
|
|
14
|
+
import '@opentelemetry/sdk-trace-base';
|
|
15
|
+
import '../../../metric-D2V4CR8D.js';
|
|
16
|
+
import 'sift';
|
|
17
|
+
import '../../../types-M16hSruO.js';
|
|
18
|
+
import '../../../vector/index.js';
|
|
19
|
+
import '../../../engine-EwEG-4Iv.js';
|
|
20
|
+
import '../../../tts/index.js';
|
|
21
|
+
|
|
22
|
+
declare function openaiCompat({ baseURL, apiKey, modelName, fetch, settings, }: {
|
|
23
|
+
baseURL?: string;
|
|
24
|
+
apiKey?: string;
|
|
25
|
+
modelName: string;
|
|
26
|
+
fetch?: typeof globalThis.fetch;
|
|
27
|
+
settings?: OpenAIChatSettings;
|
|
28
|
+
}): ai.LanguageModelV1;
|
|
29
|
+
declare class OpenaiCompat extends MastraLLM {
|
|
30
|
+
constructor({ name, apiKey, baseURL, fetch, settings, }: {
|
|
31
|
+
name: string;
|
|
32
|
+
apiKey?: string;
|
|
33
|
+
baseURL?: string;
|
|
34
|
+
fetch?: typeof globalThis.fetch;
|
|
35
|
+
settings?: OpenAIChatSettings;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { OpenaiCompat, openaiCompat };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { OpenAIChatSettings } from '@ai-sdk/openai/internal';
|
|
2
|
+
import { M as MastraLLM } from '../../../model-QGWIMOSx.js';
|
|
3
|
+
import 'ai';
|
|
4
|
+
import 'json-schema';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import '../../../index-Duqv1Yom.js';
|
|
7
|
+
import '../../../base.js';
|
|
8
|
+
import '@opentelemetry/api';
|
|
9
|
+
import '../../../index-B0-NXUYv.js';
|
|
10
|
+
import 'pino';
|
|
11
|
+
import 'stream';
|
|
12
|
+
import '../../../telemetry-oCUM52DG.js';
|
|
13
|
+
import '@opentelemetry/sdk-node';
|
|
14
|
+
import '@opentelemetry/sdk-trace-base';
|
|
15
|
+
import '../../../metric-D2V4CR8D.js';
|
|
16
|
+
import 'sift';
|
|
17
|
+
import '../../../types-M16hSruO.js';
|
|
18
|
+
import '../../../vector/index.js';
|
|
19
|
+
import '../../../engine-EwEG-4Iv.js';
|
|
20
|
+
import '../../../tts/index.js';
|
|
21
|
+
|
|
22
|
+
type OpenAIModel = 'gpt-4' | 'gpt-4-turbo' | 'gpt-3.5-turbo' | 'gpt-4o' | 'gpt-4o-mini' | 'o1' | 'o1-mini' | 'o1-preview' | 'o1-preview-mini' | 'o3-mini' | (string & {});
|
|
23
|
+
declare class OpenAI extends MastraLLM {
|
|
24
|
+
constructor({ name, apiKey, headers, fetch, baseURL, settings, }: {
|
|
25
|
+
name?: OpenAIModel;
|
|
26
|
+
apiKey?: string;
|
|
27
|
+
baseURL?: string;
|
|
28
|
+
headers?: Record<string, string>;
|
|
29
|
+
fetch?: typeof globalThis.fetch;
|
|
30
|
+
settings?: OpenAIChatSettings;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { OpenAI, type OpenAIModel };
|