@mastra/rag 1.0.7-alpha.0 → 1.0.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +36 -0
- package/dist/document/document.d.ts +2 -2
- package/dist/document/extractors/base.d.ts +1 -1
- package/dist/document/extractors/index.d.ts +5 -5
- package/dist/document/extractors/keywords.d.ts +4 -4
- package/dist/document/extractors/questions.d.ts +4 -4
- package/dist/document/extractors/summary.d.ts +4 -4
- package/dist/document/extractors/title.d.ts +4 -4
- package/dist/document/extractors/types.d.ts +1 -1
- package/dist/document/index.d.ts +2 -2
- package/dist/document/prompts/base.d.ts +1 -1
- package/dist/document/prompts/index.d.ts +3 -3
- package/dist/document/prompts/prompt.d.ts +1 -1
- package/dist/document/schema/index.d.ts +3 -3
- package/dist/document/schema/node.d.ts +2 -2
- package/dist/document/transformers/character.d.ts +3 -3
- package/dist/document/transformers/html.d.ts +2 -2
- package/dist/document/transformers/json.d.ts +2 -2
- package/dist/document/transformers/latex.d.ts +2 -2
- package/dist/document/transformers/markdown.d.ts +3 -3
- package/dist/document/transformers/sentence.d.ts +2 -2
- package/dist/document/transformers/text.d.ts +3 -3
- package/dist/document/transformers/token.d.ts +2 -2
- package/dist/document/transformers/transformer.d.ts +1 -1
- package/dist/document/types.d.ts +1 -1
- package/dist/document/validation.d.ts +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/rerank/relevance/index.d.ts +3 -3
- package/dist/tools/document-chunker.d.ts +1 -1
- package/dist/tools/graph-rag.d.ts +2 -2
- package/dist/tools/index.d.ts +3 -3
- package/dist/tools/types.d.ts +1 -1
- package/dist/tools/vector-query.d.ts +2 -2
- package/dist/utils/convert-sources.d.ts +2 -2
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/vector-search.d.ts +1 -1
- package/package.json +6 -5
- package/tsup.config.ts +2 -7
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @mastra/rag
|
|
2
2
|
|
|
3
|
+
## 1.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 351b36e: update evals and rag ai sdk package versions
|
|
8
|
+
- ccd519c: Add sentence chunking strategy and strategy-specific parameter validation for all existing strategies.
|
|
9
|
+
- 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
|
|
10
|
+
- Updated dependencies [cb36de0]
|
|
11
|
+
- Updated dependencies [d0496e6]
|
|
12
|
+
- Updated dependencies [a82b851]
|
|
13
|
+
- Updated dependencies [ea0c5f2]
|
|
14
|
+
- Updated dependencies [41a0a0e]
|
|
15
|
+
- Updated dependencies [2871020]
|
|
16
|
+
- Updated dependencies [94f4812]
|
|
17
|
+
- Updated dependencies [e202b82]
|
|
18
|
+
- Updated dependencies [e00f6a0]
|
|
19
|
+
- Updated dependencies [4a406ec]
|
|
20
|
+
- Updated dependencies [b0e43c1]
|
|
21
|
+
- Updated dependencies [5d377e5]
|
|
22
|
+
- Updated dependencies [1fb812e]
|
|
23
|
+
- Updated dependencies [35c5798]
|
|
24
|
+
- @mastra/core@0.13.0
|
|
25
|
+
|
|
26
|
+
## 1.0.7-alpha.1
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
|
|
31
|
+
- Updated dependencies [cb36de0]
|
|
32
|
+
- Updated dependencies [a82b851]
|
|
33
|
+
- Updated dependencies [41a0a0e]
|
|
34
|
+
- Updated dependencies [2871020]
|
|
35
|
+
- Updated dependencies [4a406ec]
|
|
36
|
+
- Updated dependencies [5d377e5]
|
|
37
|
+
- @mastra/core@0.13.0-alpha.2
|
|
38
|
+
|
|
3
39
|
## 1.0.7-alpha.0
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Document as Chunk } from './schema';
|
|
2
|
-
import type { ChunkParams, ExtractParams, HTMLChunkOptions, RecursiveChunkOptions, CharacterChunkOptions, TokenChunkOptions, MarkdownChunkOptions, JsonChunkOptions, LatexChunkOptions, SentenceChunkOptions } from './types';
|
|
1
|
+
import { Document as Chunk } from './schema/index.js';
|
|
2
|
+
import type { ChunkParams, ExtractParams, HTMLChunkOptions, RecursiveChunkOptions, CharacterChunkOptions, TokenChunkOptions, MarkdownChunkOptions, JsonChunkOptions, LatexChunkOptions, SentenceChunkOptions } from './types.js';
|
|
3
3
|
export declare class MDocument {
|
|
4
4
|
private chunks;
|
|
5
5
|
private type;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { TitleExtractor } from './title';
|
|
2
|
-
export { SummaryExtractor } from './summary';
|
|
3
|
-
export { QuestionsAnsweredExtractor } from './questions';
|
|
4
|
-
export { KeywordExtractor } from './keywords';
|
|
5
|
-
export type { KeywordExtractArgs, QuestionAnswerExtractArgs, SummaryExtractArgs, TitleExtractorsArgs } from './types';
|
|
1
|
+
export { TitleExtractor } from './title.js';
|
|
2
|
+
export { SummaryExtractor } from './summary.js';
|
|
3
|
+
export { QuestionsAnsweredExtractor } from './questions.js';
|
|
4
|
+
export { KeywordExtractor } from './keywords.js';
|
|
5
|
+
export type { KeywordExtractArgs, QuestionAnswerExtractArgs, SummaryExtractArgs, TitleExtractorsArgs } from './types.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { MastraLanguageModel } from '@mastra/core/agent';
|
|
2
|
-
import type { KeywordExtractPrompt } from '../prompts';
|
|
3
|
-
import type { BaseNode } from '../schema';
|
|
4
|
-
import { BaseExtractor } from './base';
|
|
5
|
-
import type { KeywordExtractArgs } from './types';
|
|
2
|
+
import type { KeywordExtractPrompt } from '../prompts/index.js';
|
|
3
|
+
import type { BaseNode } from '../schema/index.js';
|
|
4
|
+
import { BaseExtractor } from './base.js';
|
|
5
|
+
import type { KeywordExtractArgs } from './types.js';
|
|
6
6
|
type ExtractKeyword = {
|
|
7
7
|
/**
|
|
8
8
|
* Comma-separated keywords extracted from the node. May be empty if extraction fails.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { MastraLanguageModel } from '@mastra/core/agent';
|
|
2
|
-
import type { QuestionExtractPrompt } from '../prompts';
|
|
3
|
-
import type { BaseNode } from '../schema';
|
|
4
|
-
import { BaseExtractor } from './base';
|
|
5
|
-
import type { QuestionAnswerExtractArgs } from './types';
|
|
2
|
+
import type { QuestionExtractPrompt } from '../prompts/index.js';
|
|
3
|
+
import type { BaseNode } from '../schema/index.js';
|
|
4
|
+
import { BaseExtractor } from './base.js';
|
|
5
|
+
import type { QuestionAnswerExtractArgs } from './types.js';
|
|
6
6
|
type ExtractQuestion = {
|
|
7
7
|
/**
|
|
8
8
|
* Questions extracted from the node as a string (may be empty if extraction fails).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { SummaryPrompt } from '../prompts';
|
|
2
|
-
import type { BaseNode } from '../schema';
|
|
3
|
-
import { BaseExtractor } from './base';
|
|
4
|
-
import type { SummaryExtractArgs } from './types';
|
|
1
|
+
import type { SummaryPrompt } from '../prompts/index.js';
|
|
2
|
+
import type { BaseNode } from '../schema/index.js';
|
|
3
|
+
import { BaseExtractor } from './base.js';
|
|
4
|
+
import type { SummaryExtractArgs } from './types.js';
|
|
5
5
|
type ExtractSummary = {
|
|
6
6
|
sectionSummary?: string;
|
|
7
7
|
prevSectionSummary?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { MastraLanguageModel } from '@mastra/core/agent';
|
|
2
|
-
import type { TitleCombinePrompt, TitleExtractorPrompt } from '../prompts';
|
|
3
|
-
import type { BaseNode } from '../schema';
|
|
4
|
-
import { BaseExtractor } from './base';
|
|
5
|
-
import type { TitleExtractorsArgs } from './types';
|
|
2
|
+
import type { TitleCombinePrompt, TitleExtractorPrompt } from '../prompts/index.js';
|
|
3
|
+
import type { BaseNode } from '../schema/index.js';
|
|
4
|
+
import { BaseExtractor } from './base.js';
|
|
5
|
+
import type { TitleExtractorsArgs } from './types.js';
|
|
6
6
|
type ExtractTitle = {
|
|
7
7
|
documentTitle: string;
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MastraLanguageModel } from '@mastra/core/agent';
|
|
2
|
-
import type { KeywordExtractPrompt, QuestionExtractPrompt, SummaryPrompt, TitleExtractorPrompt, TitleCombinePrompt } from '../prompts';
|
|
2
|
+
import type { KeywordExtractPrompt, QuestionExtractPrompt, SummaryPrompt, TitleExtractorPrompt, TitleCombinePrompt } from '../prompts/index.js';
|
|
3
3
|
export type KeywordExtractArgs = {
|
|
4
4
|
llm?: MastraLanguageModel;
|
|
5
5
|
keywords?: number;
|
package/dist/document/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './document';
|
|
2
|
-
export * from './types';
|
|
1
|
+
export * from './document.js';
|
|
2
|
+
export * from './types.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BasePromptTemplateOptions, ChatMessage, PromptTemplateOptions } from './types';
|
|
1
|
+
import type { BasePromptTemplateOptions, ChatMessage, PromptTemplateOptions } from './types.js';
|
|
2
2
|
export declare abstract class BasePromptTemplate<const TemplatesVar extends readonly string[] = string[]> {
|
|
3
3
|
templateVars: Set<string>;
|
|
4
4
|
options: Partial<Record<TemplatesVar[number] | (string & {}), string>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BasePromptTemplate, PromptTemplate } from './base';
|
|
2
|
-
export { defaultKeywordExtractPrompt, defaultQuestionExtractPrompt, defaultSummaryPrompt, defaultTitleCombinePromptTemplate, defaultTitleExtractorPromptTemplate, } from './prompt';
|
|
3
|
-
export type { KeywordExtractPrompt, QuestionExtractPrompt, SummaryPrompt, TitleCombinePrompt, TitleExtractorPrompt, } from './prompt';
|
|
1
|
+
export { BasePromptTemplate, PromptTemplate } from './base.js';
|
|
2
|
+
export { defaultKeywordExtractPrompt, defaultQuestionExtractPrompt, defaultSummaryPrompt, defaultTitleCombinePromptTemplate, defaultTitleExtractorPromptTemplate, } from './prompt.js';
|
|
3
|
+
export type { KeywordExtractPrompt, QuestionExtractPrompt, SummaryPrompt, TitleCombinePrompt, TitleExtractorPrompt, } from './prompt.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PromptTemplate } from './base';
|
|
1
|
+
import { PromptTemplate } from './base.js';
|
|
2
2
|
export type SummaryPrompt = PromptTemplate<['context']>;
|
|
3
3
|
export type KeywordExtractPrompt = PromptTemplate<['context', 'maxKeywords']>;
|
|
4
4
|
export type QuestionExtractPrompt = PromptTemplate<['context', 'numQuestions']>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BaseNode, Document, TextNode } from './node';
|
|
2
|
-
export { NodeRelationship, ObjectType } from './types';
|
|
3
|
-
export type { Metadata, RelatedNodeInfo, RelatedNodeType, BaseNodeParams, TextNodeParams } from './types';
|
|
1
|
+
export { BaseNode, Document, TextNode } from './node.js';
|
|
2
|
+
export { NodeRelationship, ObjectType } from './types.js';
|
|
3
|
+
export type { Metadata, RelatedNodeInfo, RelatedNodeType, BaseNodeParams, TextNodeParams } from './types.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NodeRelationship, ObjectType } from './types';
|
|
2
|
-
import type { Metadata, RelatedNodeInfo, RelatedNodeType, BaseNodeParams, TextNodeParams } from './types';
|
|
1
|
+
import { NodeRelationship, ObjectType } from './types.js';
|
|
2
|
+
import type { Metadata, RelatedNodeInfo, RelatedNodeType, BaseNodeParams, TextNodeParams } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Generic abstract class for retrievable nodes
|
|
5
5
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Language } from '../types';
|
|
2
|
-
import type { BaseChunkOptions, CharacterChunkOptions, RecursiveChunkOptions } from '../types';
|
|
3
|
-
import { TextTransformer } from './text';
|
|
1
|
+
import { Language } from '../types.js';
|
|
2
|
+
import type { BaseChunkOptions, CharacterChunkOptions, RecursiveChunkOptions } from '../types.js';
|
|
3
|
+
import { TextTransformer } from './text.js';
|
|
4
4
|
export declare class CharacterTransformer extends TextTransformer {
|
|
5
5
|
protected separator: string;
|
|
6
6
|
protected isSeparatorRegex: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Document } from '../schema';
|
|
2
|
-
import type { HTMLChunkOptions } from '../types';
|
|
1
|
+
import { Document } from '../schema/index.js';
|
|
2
|
+
import type { HTMLChunkOptions } from '../types.js';
|
|
3
3
|
export declare class HTMLHeaderTransformer {
|
|
4
4
|
private headersToSplitOn;
|
|
5
5
|
private returnEachElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Document } from '../schema';
|
|
2
|
-
import type { JsonChunkOptions } from '../types';
|
|
1
|
+
import { Document } from '../schema/index.js';
|
|
2
|
+
import type { JsonChunkOptions } from '../types.js';
|
|
3
3
|
export declare class RecursiveJsonTransformer {
|
|
4
4
|
private maxSize;
|
|
5
5
|
private minSize;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BaseChunkOptions } from '../types';
|
|
2
|
-
import { RecursiveCharacterTransformer } from './character';
|
|
1
|
+
import type { BaseChunkOptions } from '../types.js';
|
|
2
|
+
import { RecursiveCharacterTransformer } from './character.js';
|
|
3
3
|
export declare class LatexTransformer extends RecursiveCharacterTransformer {
|
|
4
4
|
constructor(options?: BaseChunkOptions);
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Document } from '../schema';
|
|
2
|
-
import type { BaseChunkOptions } from '../types';
|
|
3
|
-
import { RecursiveCharacterTransformer } from './character';
|
|
1
|
+
import { Document } from '../schema/index.js';
|
|
2
|
+
import type { BaseChunkOptions } from '../types.js';
|
|
3
|
+
import { RecursiveCharacterTransformer } from './character.js';
|
|
4
4
|
export declare class MarkdownTransformer extends RecursiveCharacterTransformer {
|
|
5
5
|
constructor(options?: BaseChunkOptions);
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SentenceChunkOptions } from '../types';
|
|
2
|
-
import { TextTransformer } from './text';
|
|
1
|
+
import type { SentenceChunkOptions } from '../types.js';
|
|
2
|
+
import { TextTransformer } from './text.js';
|
|
3
3
|
export declare class SentenceTransformer extends TextTransformer {
|
|
4
4
|
protected minSize: number;
|
|
5
5
|
protected maxSize: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Document } from '../schema';
|
|
2
|
-
import type { BaseChunkOptions } from '../types';
|
|
3
|
-
import type { Transformer } from './transformer';
|
|
1
|
+
import { Document } from '../schema/index.js';
|
|
2
|
+
import type { BaseChunkOptions } from '../types.js';
|
|
3
|
+
import type { Transformer } from './transformer.js';
|
|
4
4
|
export declare abstract class TextTransformer implements Transformer {
|
|
5
5
|
protected maxSize: number;
|
|
6
6
|
protected overlap: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TiktokenModel, TiktokenEncoding } from 'js-tiktoken';
|
|
2
|
-
import type { TokenChunkOptions } from '../types';
|
|
3
|
-
import { TextTransformer } from './text';
|
|
2
|
+
import type { TokenChunkOptions } from '../types.js';
|
|
3
|
+
import { TextTransformer } from './text.js';
|
|
4
4
|
interface Tokenizer {
|
|
5
5
|
overlap: number;
|
|
6
6
|
tokensPerChunk: number;
|
package/dist/document/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TiktokenEncoding, TiktokenModel } from 'js-tiktoken';
|
|
2
|
-
import type { TitleExtractorsArgs, SummaryExtractArgs, QuestionAnswerExtractArgs, KeywordExtractArgs } from './extractors';
|
|
2
|
+
import type { TitleExtractorsArgs, SummaryExtractArgs, QuestionAnswerExtractArgs, KeywordExtractArgs } from './extractors/index.js';
|
|
3
3
|
export declare enum Language {
|
|
4
4
|
CPP = "cpp",
|
|
5
5
|
GO = "go",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './document/document';
|
|
2
|
-
export * from './document/types';
|
|
3
|
-
export * from './rerank';
|
|
4
|
-
export * from './rerank/relevance';
|
|
5
|
-
export { GraphRAG } from './graph-rag';
|
|
6
|
-
export * from './tools';
|
|
7
|
-
export * from './utils/vector-prompts';
|
|
8
|
-
export * from './utils/default-settings';
|
|
1
|
+
export * from './document/document.js';
|
|
2
|
+
export * from './document/types.js';
|
|
3
|
+
export * from './rerank/index.js';
|
|
4
|
+
export * from './rerank/relevance/index.js';
|
|
5
|
+
export { GraphRAG } from './graph-rag/index.js';
|
|
6
|
+
export * from './tools/index.js';
|
|
7
|
+
export * from './utils/vector-prompts.js';
|
|
8
|
+
export * from './utils/default-settings.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './cohere';
|
|
2
|
-
export * from './mastra-agent';
|
|
3
|
-
export * from './zeroentropy';
|
|
1
|
+
export * from './cohere/index.js';
|
|
2
|
+
export * from './mastra-agent/index.js';
|
|
3
|
+
export * from './zeroentropy/index.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createTool } from '@mastra/core/tools';
|
|
2
|
-
import type { MDocument, ChunkParams } from '../document';
|
|
2
|
+
import type { MDocument, ChunkParams } from '../document/index.js';
|
|
3
3
|
export declare const createDocumentChunkerTool: ({ doc, params, }: {
|
|
4
4
|
doc: MDocument;
|
|
5
5
|
params?: ChunkParams;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { RagTool } from '../utils';
|
|
3
|
-
import type { GraphRagToolOptions } from './types';
|
|
2
|
+
import type { RagTool } from '../utils/index.js';
|
|
3
|
+
import type { GraphRagToolOptions } from './types.js';
|
|
4
4
|
export declare const createGraphRAGTool: (options: GraphRagToolOptions) => RagTool<z.ZodObject<{
|
|
5
5
|
filter: z.ZodString;
|
|
6
6
|
queryText: z.ZodString;
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './document-chunker';
|
|
2
|
-
export * from './graph-rag';
|
|
3
|
-
export * from './vector-query';
|
|
1
|
+
export * from './document-chunker.js';
|
|
2
|
+
export * from './graph-rag.js';
|
|
3
|
+
export * from './vector-query.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/tools/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MastraVector } from '@mastra/core/vector';
|
|
2
2
|
import type { EmbeddingModel } from 'ai';
|
|
3
|
-
import type { RerankConfig } from '../rerank';
|
|
3
|
+
import type { RerankConfig } from '../rerank/index.js';
|
|
4
4
|
export interface PineconeConfig {
|
|
5
5
|
namespace?: string;
|
|
6
6
|
sparseVector?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { RagTool } from '../utils';
|
|
3
|
-
import type { VectorQueryToolOptions } from './types';
|
|
2
|
+
import type { RagTool } from '../utils/index.js';
|
|
3
|
+
import type { VectorQueryToolOptions } from './types.js';
|
|
4
4
|
export declare const createVectorQueryTool: (options: VectorQueryToolOptions) => RagTool<z.ZodObject<{
|
|
5
5
|
filter: z.ZodString;
|
|
6
6
|
queryText: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { QueryResult } from '@mastra/core';
|
|
2
|
-
import type { RankedNode } from '../graph-rag';
|
|
3
|
-
import type { RerankResult } from '../rerank';
|
|
2
|
+
import type { RankedNode } from '../graph-rag/index.js';
|
|
3
|
+
import type { RerankResult } from '../rerank/index.js';
|
|
4
4
|
type SourceInput = QueryResult | RankedNode | RerankResult;
|
|
5
5
|
/**
|
|
6
6
|
* Convert an array of source inputs (QueryResult, RankedNode, or RerankResult) to an array of sources.
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './vector-search';
|
|
2
|
-
export * from './default-settings';
|
|
3
|
-
export * from './tool-schemas';
|
|
1
|
+
export * from './vector-search.js';
|
|
2
|
+
export * from './default-settings.js';
|
|
3
|
+
export * from './tool-schemas.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MastraVector, QueryResult } from '@mastra/core/vector';
|
|
2
2
|
import type { VectorFilter } from '@mastra/core/vector/filter';
|
|
3
3
|
import type { EmbeddingModel } from 'ai';
|
|
4
|
-
import type { DatabaseConfig } from '../tools/types';
|
|
4
|
+
import type { DatabaseConfig } from '../tools/types.js';
|
|
5
5
|
interface VectorQuerySearchParams {
|
|
6
6
|
indexName: string;
|
|
7
7
|
vectorStore: MastraVector;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/rag",
|
|
3
|
-
"version": "1.0.7
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
14
|
"require": {
|
|
15
|
-
"types": "./dist/index.d.
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
16
|
"default": "./dist/index.cjs"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"zod": "^3.25.67"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@mastra/core": ">=0.10.0-0 <0.
|
|
33
|
+
"@mastra/core": ">=0.10.0-0 <0.14.0-0",
|
|
34
34
|
"ai": "^4.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -45,8 +45,9 @@
|
|
|
45
45
|
"tsup": "^8.5.0",
|
|
46
46
|
"typescript": "^5.8.3",
|
|
47
47
|
"vitest": "^3.2.4",
|
|
48
|
-
"@internal/lint": "0.0.
|
|
49
|
-
"@
|
|
48
|
+
"@internal/lint": "0.0.27",
|
|
49
|
+
"@internal/types-builder": "0.0.2",
|
|
50
|
+
"@mastra/core": "0.13.0"
|
|
50
51
|
},
|
|
51
52
|
"keywords": [
|
|
52
53
|
"rag",
|
package/tsup.config.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { promisify } from 'util';
|
|
1
|
+
import { generateTypes } from '@internal/types-builder';
|
|
3
2
|
import { defineConfig } from 'tsup';
|
|
4
3
|
|
|
5
|
-
const exec = promisify(spawn);
|
|
6
|
-
|
|
7
4
|
export default defineConfig({
|
|
8
5
|
entry: ['src/index.ts'],
|
|
9
6
|
format: ['esm', 'cjs'],
|
|
@@ -15,8 +12,6 @@ export default defineConfig({
|
|
|
15
12
|
},
|
|
16
13
|
sourcemap: true,
|
|
17
14
|
onSuccess: async () => {
|
|
18
|
-
await
|
|
19
|
-
stdio: 'inherit',
|
|
20
|
-
});
|
|
15
|
+
await generateTypes(process.cwd());
|
|
21
16
|
},
|
|
22
17
|
});
|