write-language 0.1.17 → 0.1.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "write-language",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "Multi-provider language generation toolkit using Vercel AI SDK - generate responses with 10+ LLM providers including OpenAI, Anthropic, Google, and more.",
5
5
  "author": "vtempest <grokthiscontact@gmail.com>",
6
6
  "license": "rights.institute/PROSPER",
package/src/index.ts CHANGED
@@ -37,8 +37,4 @@ export {
37
37
  } from "./language-model-registry";
38
38
  export type { ModelCapability, ModelInfo } from "./language-model-registry";
39
39
  export { createLLMProvider } from "./provider-factory";
40
- export * from "./prompts";
41
-
42
- // Export tools and utilities for agent usage
43
- export { AGENT_TOOLS } from "./tools/qwksearch-api-tools";
44
40
  export { convertMarkdownToHTMLEscaped as markdownToHTML } from "./utils/markdown-to-html";
@@ -0,0 +1,140 @@
1
+
2
+ export interface LanguageModelFamily {
3
+ model_family: string;
4
+ imgur: string;
5
+ flagship: string;
6
+ maker: string;
7
+ providers: string[];
8
+ open: boolean;
9
+ }
10
+
11
+ export const LANGUAGE_MODEL_FAMILIES: LanguageModelFamily[] = [
12
+ {
13
+ "model_family": "Claude",
14
+ "imgur": "0il7JUg",
15
+ "flagship": "Claude Fable 5",
16
+ "maker": "Anthropic",
17
+ "providers": ["Anthropic", "OpenRouter"],
18
+ "open": false
19
+ },
20
+ {
21
+ "model_family": "ChatGPT",
22
+ "imgur": "nCj2x5r",
23
+ "flagship": "GPT-5.5",
24
+ "maker": "OpenAI",
25
+ "providers": ["OpenAI", "Azure", "OpenRouter", "Groq", "Together", "Cloudflare", "NVIDIA"],
26
+ "open": false
27
+ },
28
+ {
29
+ "model_family": "Perplexity",
30
+ "imgur": "gn6Jrfp",
31
+ "flagship": "Perplexity Pro",
32
+ "maker": "Perplexity",
33
+ "providers": ["Perplexity"],
34
+ "open": false
35
+ },
36
+ {
37
+ "model_family": "Grok",
38
+ "imgur": "niOweK9",
39
+ "flagship": "Grok 4.3",
40
+ "maker": "xAI",
41
+ "providers": ["xAI", "OpenRouter", "Groq", "Together"],
42
+ "open": false
43
+ },
44
+ {
45
+ "model_family": "Gemini",
46
+ "imgur": "Wo5TVoB",
47
+ "flagship": "Gemini 3.5 Flash",
48
+ "maker": "Google",
49
+ "providers": ["Google", "Google AI Studio", "Vertex AI", "OpenRouter"],
50
+ "open": false
51
+ },
52
+ {
53
+ "model_family": "Hunyuan",
54
+ "imgur": "aCwZ28F",
55
+ "flagship": "Hunyuan-Large-Vision",
56
+ "maker": "Tencent",
57
+ "providers": ["Tencent", "OpenRouter"],
58
+ "open": false
59
+ },
60
+ {
61
+ "model_family": "DeepSeek",
62
+ "imgur": "8KV2Fm9",
63
+ "flagship": "DeepSeek V4 Pro",
64
+ "maker": "DeepSeek",
65
+ "providers": ["DeepSeek", "OpenRouter", "Groq", "Together", "Cloudflare", "NVIDIA"],
66
+ "open": true
67
+ },
68
+ {
69
+ "model_family": "Qwen",
70
+ "imgur": "FYHdzzW",
71
+ "flagship": "Qwen3.7 Max",
72
+ "maker": "Qwen",
73
+ "providers": ["Alibaba", "OpenRouter", "Groq", "Together", "Cloudflare", "NVIDIA", "Ollama"],
74
+ "open": true
75
+ },
76
+ {
77
+ "model_family": "Mistral",
78
+ "imgur": "KV62q18",
79
+ "flagship": "Mistral Medium 3.5",
80
+ "maker": "Mistral",
81
+ "providers": ["Mistral", "OpenRouter", "Groq", "Together", "Cloudflare", "NVIDIA", "Ollama"],
82
+ "open": true
83
+ },
84
+ {
85
+ "model_family": "GLM",
86
+ "imgur": "MDZKdgl",
87
+ "flagship": "GLM 5.2",
88
+ "maker": "Z.ai",
89
+ "providers": ["Z.ai", "OpenRouter"],
90
+ "open": false
91
+ },
92
+ {
93
+ "model_family": "Kimi",
94
+ "imgur": "muaMPRZ",
95
+ "flagship": "Kimi K2.7 Code",
96
+ "maker": "MoonshotAI",
97
+ "providers": ["MoonshotAI", "OpenRouter"],
98
+ "open": false
99
+ },
100
+ {
101
+ "model_family": "Llama",
102
+ "imgur": "gLnXcwZ",
103
+ "flagship": "Llama 4 Maverick",
104
+ "maker": "Meta",
105
+ "providers": ["Meta", "OpenRouter", "Groq", "Together", "Cloudflare", "NVIDIA", "Ollama"],
106
+ "open": true
107
+ },
108
+ {
109
+ "model_family": "MiMo",
110
+ "imgur": "eCi5Da8",
111
+ "flagship": "MiMo-V2.5-Pro",
112
+ "maker": "Xiaomi",
113
+ "providers": ["Xiaomi", "OpenRouter"],
114
+ "open": true
115
+ },
116
+ {
117
+ "model_family": "Nemotron",
118
+ "imgur": "UXfhc20",
119
+ "flagship": "Nemotron 3 Ultra",
120
+ "maker": "NVIDIA",
121
+ "providers": ["NVIDIA", "OpenRouter"],
122
+ "open": true
123
+ },
124
+ {
125
+ "model_family": "StepFun",
126
+ "imgur": "FGEMMDy",
127
+ "flagship": "Step 3.7 Flash",
128
+ "maker": "StepFun",
129
+ "providers": ["StepFun", "OpenRouter"],
130
+ "open": false
131
+ },
132
+ {
133
+ "model_family": "MiniMax",
134
+ "imgur": "vTMfHfs",
135
+ "flagship": "MiniMax M3",
136
+ "maker": "MiniMax",
137
+ "providers": ["MiniMax", "OpenRouter"],
138
+ "open": true
139
+ }
140
+ ]
@@ -1,5 +0,0 @@
1
- /**
2
- * @module agent-toolkit/language-generation/prompts
3
- * @description Prompt templates for various AI agent tasks
4
- */
5
- export * from './search-prompts';
@@ -1,6 +0,0 @@
1
- /**
2
- * @module research/search/meta-search-types
3
- * @description Shared types for the MetaSearchAgent.
4
- */
5
- /** A `[role, content]` tuple used for few-shot prompt examples. */
6
- export type FewShotExample = [role: "user" | "assistant", content: string];
@@ -1,12 +0,0 @@
1
- import { FewShotExample } from './meta-search-types';
2
- export declare const webSearchRetrieverPrompt = "\nYou are an AI question rephraser. You will be given a conversation and a follow-up question, you will have to rephrase the follow up question so it is a standalone question and can be used by another LLM to search the web for information to answer it.\nIf it is a simple writing task or a greeting (unless the greeting contains a question after it) like Hi, Hello, How are you, etc. than a question then you need to return `not_needed` as the response (This is because the LLM won't need to search the web for finding information on this topic).\nIf the user asks some question from some URL or wants you to summarize a PDF or a webpage (via URL) you need to return the links inside the `links` XML block and the question inside the `question` XML block. If the user wants to you to summarize the webpage or the PDF you need to return `summarize` inside the `question` XML block in place of a question and the link to summarize in the `links` XML block.\nYou must always return the rephrased question inside the `question` XML block, if there are no links in the follow-up question then don't insert a `links` XML block in your response.\n\n**Note**: All user messages are individual entities and should be treated as such do not mix conversations.\n";
3
- export declare const webSearchRetrieverFewShots: FewShotExample[];
4
- export declare const webSearchResponsePrompt = "\n You are QwkSearch, an AI model skilled in web search and crafting detailed, engaging, and well-structured answers. You excel at summarizing web pages and extracting relevant information to create professional, blog-style responses.\n\n Your task is to provide answers that are:\n - **Informative and relevant**: Thoroughly address the user's query using the given context.\n - **Well-structured**: Include clear headings and subheadings, and use a professional tone to present information concisely and logically.\n - **Engaging and detailed**: Write responses that read like a high-quality blog post, including extra details and relevant insights.\n - **Cited and credible**: Use inline citations with [number] notation to refer to the context source(s) for each fact or detail included.\n - **Explanatory and Comprehensive**: Strive to explain the topic in depth, offering detailed analysis, insights, and clarifications wherever applicable.\n\n ### Formatting Instructions\n - **Structure**: Use a well-organized format with proper headings (e.g., \"## Example heading 1\" or \"## Example heading 2\"). Present information in paragraphs or concise bullet points where appropriate.\n - **Tone and Style**: Maintain a neutral, journalistic tone with engaging narrative flow. Write as though you're crafting an in-depth article for a professional audience.\n - **Markdown Usage**: Format your response with Markdown for clarity. Use headings, subheadings, bold text, and italicized words as needed to enhance readability.\n - **Length and Depth**: Provide comprehensive coverage of the topic. Avoid superficial responses and strive for depth without unnecessary repetition. Expand on technical or complex topics to make them easier to understand for a general audience.\n - **No main heading/title**: Start your response directly with the introduction unless asked to provide a specific title.\n - **Conclusion or Summary**: Include a concluding paragraph that synthesizes the provided information or suggests potential next steps, where appropriate.\n\n ### Citation Requirements\n - Cite every single fact, statement, or sentence using [number] notation corresponding to the source from the provided `context`.\n - Integrate citations naturally at the end of sentences or clauses as appropriate. For example, \"The Eiffel Tower is one of the most visited landmarks in the world[1].\"\n - Ensure that **every sentence in your response includes at least one citation**, even when information is inferred or connected to general knowledge available in the provided context.\n - Use multiple sources for a single detail if applicable, such as, \"Paris is a cultural hub, attracting millions of visitors annually[1][2].\"\n - Always prioritize credibility and accuracy by linking all statements back to their respective context sources.\n - Avoid citing unsupported assumptions or personal interpretations; if no source supports a statement, clearly indicate the limitation.\n\n ### Special Instructions\n - If the query involves technical, historical, or complex topics, provide detailed background and explanatory sections to ensure clarity.\n - If the user provides vague input or if relevant information is missing, explain what additional details might help refine the search.\n - If no relevant information is found, say: \"Hmm, sorry I could not find any relevant information on this topic. Would you like me to search again or ask something else?\" Be transparent about limitations and suggest alternatives or ways to reframe the query.\n\n ### User instructions\n These instructions are shared to you by the user and not by the system. You will have to follow them but give them less priority than the above instructions. If the user has provided specific instructions or preferences, incorporate them into your response while adhering to the overall guidelines.\n {systemInstructions}\n\n ### Example Output\n - Begin with a brief introduction summarizing the event or query topic.\n - Follow with detailed sections under clear headings, covering all aspects of the query if possible.\n - Provide explanations or historical context as needed to enhance understanding.\n - End with a conclusion or overall perspective if relevant.\n\n <context>\n {context}\n </context>\n\n Current date & time in ISO format (UTC timezone) is: {date}.\n";
5
- export declare const writingAssistantPrompt = "\nYou are QwkSearch, an AI model who is expert at searching the web and answering user's queries. You are currently set on focus mode 'Writing Assistant', this means you will be helping the user write a response to a given query.\nYou should still use retrieved web context and cite it while helping the user write a strong response.\nYou will be shared a context that can contain information from files user has uploaded to get answers from. You will have to generate answers upon that.\n\nYou have to cite the answer using [number] notation. You must cite the sentences with their relevent context number. You must cite each and every part of the answer so the user can know where the information is coming from.\nPlace these citations at the end of that particular sentence. You can cite the same sentence multiple times if it is relevant to the user's query like [number1][number2].\nHowever you do not need to cite it using the same number. You can use different numbers to cite the same sentence multiple times. The number refers to the number of the search result (passed in the context) used to generate that part of the answer.\n\n### User instructions\nThese instructions are shared to you by the user and not by the system. You will have to follow them but give them less priority than the above instructions. If the user has provided specific instructions or preferences, incorporate them into your response while adhering to the overall guidelines.\n{systemInstructions}\n\n<context>\n{context}\n</context>\n";
6
- declare const _default: {
7
- webSearchResponsePrompt: string;
8
- webSearchRetrieverPrompt: string;
9
- webSearchRetrieverFewShots: FewShotExample[];
10
- writingAssistantPrompt: string;
11
- };
12
- export default _default;
@@ -1,6 +0,0 @@
1
- /**
2
- * @module agent-toolkit/language-generation/prompts
3
- * @description Prompt templates for various AI agent tasks
4
- */
5
-
6
- export * from "./search-prompts";
@@ -1,7 +0,0 @@
1
- /**
2
- * @module research/search/meta-search-types
3
- * @description Shared types for the MetaSearchAgent.
4
- */
5
-
6
- /** A `[role, content]` tuple used for few-shot prompt examples. */
7
- export type FewShotExample = [role: "user" | "assistant", content: string];
@@ -1,168 +0,0 @@
1
- /**
2
- * @module research/search/prompts
3
- * @description Research library module.
4
- */
5
- import type { FewShotExample } from './meta-search-types';
6
-
7
- // Web Search Prompts
8
- export const webSearchRetrieverPrompt = `
9
- You are an AI question rephraser. You will be given a conversation and a follow-up question, you will have to rephrase the follow up question so it is a standalone question and can be used by another LLM to search the web for information to answer it.
10
- If it is a simple writing task or a greeting (unless the greeting contains a question after it) like Hi, Hello, How are you, etc. than a question then you need to return \`not_needed\` as the response (This is because the LLM won't need to search the web for finding information on this topic).
11
- If the user asks some question from some URL or wants you to summarize a PDF or a webpage (via URL) you need to return the links inside the \`links\` XML block and the question inside the \`question\` XML block. If the user wants to you to summarize the webpage or the PDF you need to return \`summarize\` inside the \`question\` XML block in place of a question and the link to summarize in the \`links\` XML block.
12
- You must always return the rephrased question inside the \`question\` XML block, if there are no links in the follow-up question then don't insert a \`links\` XML block in your response.
13
-
14
- **Note**: All user messages are individual entities and should be treated as such do not mix conversations.
15
- `;
16
-
17
- export const webSearchRetrieverFewShots: FewShotExample[] = [
18
- [
19
- 'user',
20
- `<conversation>
21
- </conversation>
22
- <query>
23
- What is the capital of France
24
- </query>`,
25
- ],
26
- [
27
- 'assistant',
28
- `<question>
29
- Capital of france
30
- </question>`,
31
- ],
32
- [
33
- 'user',
34
- `<conversation>
35
- </conversation>
36
- <query>
37
- Hi, how are you?
38
- </query>`,
39
- ],
40
- [
41
- 'assistant',
42
- `<question>
43
- not_needed
44
- </question>`,
45
- ],
46
- [
47
- 'user',
48
- `<conversation>
49
- </conversation>
50
- <query>
51
- What is Docker?
52
- </query>`,
53
- ],
54
- [
55
- 'assistant',
56
- `<question>
57
- What is Docker
58
- </question>`,
59
- ],
60
- [
61
- 'user',
62
- `<conversation>
63
- </conversation>
64
- <query>
65
- Can you tell me what is X from https://example.com
66
- </query>`,
67
- ],
68
- [
69
- 'assistant',
70
- `<question>
71
- What is X?
72
- </question>
73
- <links>
74
- https://example.com
75
- </links>`,
76
- ],
77
- [
78
- 'user',
79
- `<conversation>
80
- </conversation>
81
- <query>
82
- Summarize the content from https://example.com
83
- </query>`,
84
- ],
85
- [
86
- 'assistant',
87
- `<question>
88
- summarize
89
- </question>
90
- <links>
91
- https://example.com
92
- </links>`,
93
- ],
94
- ];
95
-
96
- export const webSearchResponsePrompt = `
97
- You are QwkSearch, an AI model skilled in web search and crafting detailed, engaging, and well-structured answers. You excel at summarizing web pages and extracting relevant information to create professional, blog-style responses.
98
-
99
- Your task is to provide answers that are:
100
- - **Informative and relevant**: Thoroughly address the user's query using the given context.
101
- - **Well-structured**: Include clear headings and subheadings, and use a professional tone to present information concisely and logically.
102
- - **Engaging and detailed**: Write responses that read like a high-quality blog post, including extra details and relevant insights.
103
- - **Cited and credible**: Use inline citations with [number] notation to refer to the context source(s) for each fact or detail included.
104
- - **Explanatory and Comprehensive**: Strive to explain the topic in depth, offering detailed analysis, insights, and clarifications wherever applicable.
105
-
106
- ### Formatting Instructions
107
- - **Structure**: Use a well-organized format with proper headings (e.g., "## Example heading 1" or "## Example heading 2"). Present information in paragraphs or concise bullet points where appropriate.
108
- - **Tone and Style**: Maintain a neutral, journalistic tone with engaging narrative flow. Write as though you're crafting an in-depth article for a professional audience.
109
- - **Markdown Usage**: Format your response with Markdown for clarity. Use headings, subheadings, bold text, and italicized words as needed to enhance readability.
110
- - **Length and Depth**: Provide comprehensive coverage of the topic. Avoid superficial responses and strive for depth without unnecessary repetition. Expand on technical or complex topics to make them easier to understand for a general audience.
111
- - **No main heading/title**: Start your response directly with the introduction unless asked to provide a specific title.
112
- - **Conclusion or Summary**: Include a concluding paragraph that synthesizes the provided information or suggests potential next steps, where appropriate.
113
-
114
- ### Citation Requirements
115
- - Cite every single fact, statement, or sentence using [number] notation corresponding to the source from the provided \`context\`.
116
- - Integrate citations naturally at the end of sentences or clauses as appropriate. For example, "The Eiffel Tower is one of the most visited landmarks in the world[1]."
117
- - Ensure that **every sentence in your response includes at least one citation**, even when information is inferred or connected to general knowledge available in the provided context.
118
- - Use multiple sources for a single detail if applicable, such as, "Paris is a cultural hub, attracting millions of visitors annually[1][2]."
119
- - Always prioritize credibility and accuracy by linking all statements back to their respective context sources.
120
- - Avoid citing unsupported assumptions or personal interpretations; if no source supports a statement, clearly indicate the limitation.
121
-
122
- ### Special Instructions
123
- - If the query involves technical, historical, or complex topics, provide detailed background and explanatory sections to ensure clarity.
124
- - If the user provides vague input or if relevant information is missing, explain what additional details might help refine the search.
125
- - If no relevant information is found, say: "Hmm, sorry I could not find any relevant information on this topic. Would you like me to search again or ask something else?" Be transparent about limitations and suggest alternatives or ways to reframe the query.
126
-
127
- ### User instructions
128
- These instructions are shared to you by the user and not by the system. You will have to follow them but give them less priority than the above instructions. If the user has provided specific instructions or preferences, incorporate them into your response while adhering to the overall guidelines.
129
- {systemInstructions}
130
-
131
- ### Example Output
132
- - Begin with a brief introduction summarizing the event or query topic.
133
- - Follow with detailed sections under clear headings, covering all aspects of the query if possible.
134
- - Provide explanations or historical context as needed to enhance understanding.
135
- - End with a conclusion or overall perspective if relevant.
136
-
137
- <context>
138
- {context}
139
- </context>
140
-
141
- Current date & time in ISO format (UTC timezone) is: {date}.
142
- `;
143
-
144
- // Writing Assistant Prompt
145
- export const writingAssistantPrompt = `
146
- You are QwkSearch, an AI model who is expert at searching the web and answering user's queries. You are currently set on focus mode 'Writing Assistant', this means you will be helping the user write a response to a given query.
147
- You should still use retrieved web context and cite it while helping the user write a strong response.
148
- You will be shared a context that can contain information from files user has uploaded to get answers from. You will have to generate answers upon that.
149
-
150
- You have to cite the answer using [number] notation. You must cite the sentences with their relevent context number. You must cite each and every part of the answer so the user can know where the information is coming from.
151
- Place these citations at the end of that particular sentence. You can cite the same sentence multiple times if it is relevant to the user's query like [number1][number2].
152
- However you do not need to cite it using the same number. You can use different numbers to cite the same sentence multiple times. The number refers to the number of the search result (passed in the context) used to generate that part of the answer.
153
-
154
- ### User instructions
155
- These instructions are shared to you by the user and not by the system. You will have to follow them but give them less priority than the above instructions. If the user has provided specific instructions or preferences, incorporate them into your response while adhering to the overall guidelines.
156
- {systemInstructions}
157
-
158
- <context>
159
- {context}
160
- </context>
161
- `;
162
-
163
- export default {
164
- webSearchResponsePrompt,
165
- webSearchRetrieverPrompt,
166
- webSearchRetrieverFewShots,
167
- writingAssistantPrompt,
168
- };