chat-agent-toolkit 1.2.367 → 1.2.369
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/chat-agent-toolkit/src/tools/qwksearch-api-tools.d.ts +1 -1
- package/package.json +2 -2
- package/src/config/config-manager.d.ts +29 -0
- package/src/config/config-types.d.ts +58 -0
- package/src/config/environment-variables.d.ts +6 -0
- package/src/config/index.d.ts +18 -0
- package/src/config/language-models-database.d.ts +95 -0
- package/src/config/model-registry.d.ts +70 -0
- package/src/config/model-tester.d.ts +51 -0
- package/src/config/model-utils.d.ts +44 -0
- package/src/config/provider-ui-config.d.ts +13 -0
- package/src/connectors/index.d.ts +84 -0
- package/src/index.d.ts +27 -0
- package/src/mastra/agents.d.ts +78 -0
- package/src/mastra/evals.d.ts +63 -0
- package/src/mastra/index.d.ts +15 -0
- package/src/mastra/model-routing.d.ts +71 -0
- package/src/mastra/rag.d.ts +83 -0
- package/src/mastra/telemetry.d.ts +41 -0
- package/src/mastra/workflows.d.ts +85 -0
- package/src/memory/agent-memory-manager.d.ts +135 -0
- package/src/memory/index.d.ts +18 -0
- package/src/memory/mastra-integration.d.ts +161 -0
- package/src/memory/storage/drizzle-storage.d.ts +87 -0
- package/src/memory/storage/in-memory-storage.d.ts +86 -0
- package/src/memory/storage/storage-interface.d.ts +43 -0
- package/src/memory/types.d.ts +122 -0
- package/src/models/registry.d.ts +4 -0
- package/src/models/types.d.ts +4 -0
- package/src/prompts/index.d.ts +5 -0
- package/src/prompts/meta-search-types.d.ts +6 -0
- package/src/prompts/search-prompts.d.ts +25 -0
- package/src/tools/index.d.ts +13 -0
- package/src/tools/qwksearch-api-tools.d.ts +106 -0
- package/src/tools/qwksearch-mcp-tools.d.ts +26 -0
- package/src/tools/search/doc-utils.d.ts +49 -0
- package/src/tools/search/document.d.ts +14 -0
- package/src/tools/search/index.d.ts +13 -0
- package/src/tools/search/link-summarizer.d.ts +11 -0
- package/src/tools/search/meta-search-types.d.ts +56 -0
- package/src/tools/search/metaSearchAgent.d.ts +26 -0
- package/src/tools/search/search-handlers.d.ts +34 -0
- package/src/tools/search/suggestionGeneratorAgent.d.ts +19 -0
- package/src/tools/search/titleGeneratorAgent.d.ts +13 -0
- package/src/utils/chat-helpers.d.ts +10 -0
- package/src/utils/index.d.ts +5 -0
- package/src/utils/outputParser.d.ts +22 -0
- package/src/utils/provider-image-cropper.d.ts +127 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module research/search/index
|
|
3
|
+
* @description Research library module.
|
|
4
|
+
*
|
|
5
|
+
* Note: To use these search handlers, you need to provide search functions
|
|
6
|
+
* (searchSearxng, searchTavily, etc.) from search-web-api package.
|
|
7
|
+
*/
|
|
8
|
+
import MetaSearchAgent from "./metaSearchAgent";
|
|
9
|
+
import type { Config } from "./meta-search-types";
|
|
10
|
+
/**
|
|
11
|
+
* Creates search handler instances with provided search functions.
|
|
12
|
+
* Pass in search functions from extract-webpage to enable web search.
|
|
13
|
+
*/
|
|
14
|
+
export declare const createSearchHandlers: (searchFunctions?: Partial<Config>) => {
|
|
15
|
+
webSearch: MetaSearchAgent;
|
|
16
|
+
academicSearch: MetaSearchAgent;
|
|
17
|
+
writingAssistant: MetaSearchAgent;
|
|
18
|
+
wolframAlphaSearch: MetaSearchAgent;
|
|
19
|
+
youtubeSearch: MetaSearchAgent;
|
|
20
|
+
redditSearch: MetaSearchAgent;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Default search handlers without search functions.
|
|
24
|
+
* These will not perform actual web searches unless search functions are added to the Config.
|
|
25
|
+
* @deprecated Use createSearchHandlers() with search functions instead
|
|
26
|
+
*/
|
|
27
|
+
export declare const searchHandlers: {
|
|
28
|
+
webSearch: MetaSearchAgent;
|
|
29
|
+
academicSearch: MetaSearchAgent;
|
|
30
|
+
writingAssistant: MetaSearchAgent;
|
|
31
|
+
wolframAlphaSearch: MetaSearchAgent;
|
|
32
|
+
youtubeSearch: MetaSearchAgent;
|
|
33
|
+
redditSearch: MetaSearchAgent;
|
|
34
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module research/chains/suggestionGeneratorAgent
|
|
3
|
+
* @description Generates follow-up question suggestions from a conversation
|
|
4
|
+
* using the Vercel AI SDK.
|
|
5
|
+
*/
|
|
6
|
+
import { type LanguageModel } from "ai";
|
|
7
|
+
import type { ChatTurnMessage } from "./meta-search-types";
|
|
8
|
+
type SuggestionGeneratorInput = {
|
|
9
|
+
chat_history: ChatTurnMessage[];
|
|
10
|
+
maxQuestions?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Optional user-authored replacement for {@link followUpSuggestionsPrompt}
|
|
13
|
+
* (edited in Settings → Search Settings). Blank or whitespace-only values
|
|
14
|
+
* fall back to the built-in template.
|
|
15
|
+
*/
|
|
16
|
+
promptTemplate?: string;
|
|
17
|
+
};
|
|
18
|
+
declare const generateSuggestions: (input: SuggestionGeneratorInput, llm: LanguageModel) => Promise<string[]>;
|
|
19
|
+
export default generateSuggestions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module research/chains/titleGeneratorAgent
|
|
3
|
+
* @description Generates a short, human-friendly title summarising a chat
|
|
4
|
+
* conversation using the Vercel AI SDK. Used to give conversations with
|
|
5
|
+
* multiple turns a meaningful title instead of the truncated first message.
|
|
6
|
+
*/
|
|
7
|
+
import { type LanguageModel } from "ai";
|
|
8
|
+
import type { ChatTurnMessage } from "./meta-search-types";
|
|
9
|
+
type TitleGeneratorInput = {
|
|
10
|
+
chat_history: ChatTurnMessage[];
|
|
11
|
+
};
|
|
12
|
+
declare const generateTitle: (input: TitleGeneratorInput, llm: LanguageModel) => Promise<string>;
|
|
13
|
+
export default generateTitle;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module agent-toolkit/utils/outputParser
|
|
3
|
+
* @description Parsers that extract values from XML-tagged sections of LLM
|
|
4
|
+
* output (e.g. `<links>...</links>`, `<question>...</question>`).
|
|
5
|
+
*/
|
|
6
|
+
interface LineListOutputParserArgs {
|
|
7
|
+
key?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class LineListOutputParser {
|
|
10
|
+
private key;
|
|
11
|
+
constructor(args?: LineListOutputParserArgs);
|
|
12
|
+
parse(text: string): Promise<string[]>;
|
|
13
|
+
}
|
|
14
|
+
interface LineOutputParserArgs {
|
|
15
|
+
key?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class LineOutputParser {
|
|
18
|
+
private key;
|
|
19
|
+
constructor(args?: LineOutputParserArgs);
|
|
20
|
+
parse(text: string): Promise<string | undefined>;
|
|
21
|
+
}
|
|
22
|
+
export default LineOutputParser;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Crops a single provider's icon out of a shared sprite-sheet image.
|
|
3
|
+
*
|
|
4
|
+
* The sprite sheet is a 6-column by 4-row grid of provider logos; each provider's
|
|
5
|
+
* grid position is looked up in `PROVIDERS` and rendered onto a canvas, which can
|
|
6
|
+
* then be returned as a canvas, Blob, or data URL.
|
|
7
|
+
*/
|
|
8
|
+
declare const PROVIDERS: {
|
|
9
|
+
readonly openrouter: {
|
|
10
|
+
readonly row: 0;
|
|
11
|
+
readonly col: 0;
|
|
12
|
+
};
|
|
13
|
+
readonly tongyi: {
|
|
14
|
+
readonly row: 0;
|
|
15
|
+
readonly col: 1;
|
|
16
|
+
};
|
|
17
|
+
readonly ollama: {
|
|
18
|
+
readonly row: 0;
|
|
19
|
+
readonly col: 2;
|
|
20
|
+
};
|
|
21
|
+
readonly huggingface: {
|
|
22
|
+
readonly row: 0;
|
|
23
|
+
readonly col: 3;
|
|
24
|
+
};
|
|
25
|
+
readonly localai: {
|
|
26
|
+
readonly row: 0;
|
|
27
|
+
readonly col: 4;
|
|
28
|
+
};
|
|
29
|
+
readonly openllm: {
|
|
30
|
+
readonly row: 0;
|
|
31
|
+
readonly col: 5;
|
|
32
|
+
};
|
|
33
|
+
readonly zhipu: {
|
|
34
|
+
readonly row: 1;
|
|
35
|
+
readonly col: 0;
|
|
36
|
+
};
|
|
37
|
+
readonly replicate: {
|
|
38
|
+
readonly row: 1;
|
|
39
|
+
readonly col: 1;
|
|
40
|
+
};
|
|
41
|
+
readonly azure: {
|
|
42
|
+
readonly row: 1;
|
|
43
|
+
readonly col: 2;
|
|
44
|
+
};
|
|
45
|
+
readonly anthropic: {
|
|
46
|
+
readonly row: 1;
|
|
47
|
+
readonly col: 3;
|
|
48
|
+
};
|
|
49
|
+
readonly groq: {
|
|
50
|
+
readonly row: 1;
|
|
51
|
+
readonly col: 4;
|
|
52
|
+
};
|
|
53
|
+
readonly sagemaker: {
|
|
54
|
+
readonly row: 1;
|
|
55
|
+
readonly col: 5;
|
|
56
|
+
};
|
|
57
|
+
readonly "01ai": {
|
|
58
|
+
readonly row: 2;
|
|
59
|
+
readonly col: 0;
|
|
60
|
+
};
|
|
61
|
+
readonly bedrock: {
|
|
62
|
+
readonly row: 2;
|
|
63
|
+
readonly col: 1;
|
|
64
|
+
};
|
|
65
|
+
readonly openai: {
|
|
66
|
+
readonly row: 2;
|
|
67
|
+
readonly col: 2;
|
|
68
|
+
};
|
|
69
|
+
readonly cohere: {
|
|
70
|
+
readonly row: 2;
|
|
71
|
+
readonly col: 3;
|
|
72
|
+
};
|
|
73
|
+
readonly together: {
|
|
74
|
+
readonly row: 2;
|
|
75
|
+
readonly col: 4;
|
|
76
|
+
};
|
|
77
|
+
readonly xorbits: {
|
|
78
|
+
readonly row: 2;
|
|
79
|
+
readonly col: 5;
|
|
80
|
+
};
|
|
81
|
+
readonly wenxin: {
|
|
82
|
+
readonly row: 3;
|
|
83
|
+
readonly col: 0;
|
|
84
|
+
};
|
|
85
|
+
readonly moonshot: {
|
|
86
|
+
readonly row: 3;
|
|
87
|
+
readonly col: 1;
|
|
88
|
+
};
|
|
89
|
+
readonly gemini: {
|
|
90
|
+
readonly row: 3;
|
|
91
|
+
readonly col: 2;
|
|
92
|
+
};
|
|
93
|
+
readonly mistral: {
|
|
94
|
+
readonly row: 3;
|
|
95
|
+
readonly col: 3;
|
|
96
|
+
};
|
|
97
|
+
readonly jina: {
|
|
98
|
+
readonly row: 3;
|
|
99
|
+
readonly col: 4;
|
|
100
|
+
};
|
|
101
|
+
readonly chatglm: {
|
|
102
|
+
readonly row: 3;
|
|
103
|
+
readonly col: 5;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
export type Provider = keyof typeof PROVIDERS;
|
|
107
|
+
/**
|
|
108
|
+
* Returns a cropped canvas containing just the provider box.
|
|
109
|
+
*/
|
|
110
|
+
export declare function cropProvider(image: HTMLImageElement | ImageBitmap, provider: Provider): Promise<HTMLCanvasElement>;
|
|
111
|
+
/**
|
|
112
|
+
* Returns the provider image as a Blob.
|
|
113
|
+
*/
|
|
114
|
+
export declare function cropProviderAsBlob(image: HTMLImageElement | ImageBitmap, provider: Provider, type?: "image/png" | "image/jpeg" | "image/webp", quality?: number): Promise<Blob>;
|
|
115
|
+
/**
|
|
116
|
+
* Returns the provider image as a data URL.
|
|
117
|
+
*/
|
|
118
|
+
export declare function cropProviderAsDataURL(image: HTMLImageElement | ImageBitmap, provider: Provider, type?: "image/png" | "image/jpeg" | "image/webp", quality?: number): Promise<string>;
|
|
119
|
+
/**
|
|
120
|
+
* Helper to load and crop in one call.
|
|
121
|
+
*/
|
|
122
|
+
export declare function getProviderImage(spriteSheetUrl: string, provider: Provider): Promise<HTMLCanvasElement>;
|
|
123
|
+
/**
|
|
124
|
+
* Get all available provider names.
|
|
125
|
+
*/
|
|
126
|
+
export declare function getProviderNames(): Provider[];
|
|
127
|
+
export {};
|