@ooneex/ai 0.0.13 → 0.0.15
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/index.js +26 -785
- package/dist/index.js.map +2 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,814 +1,55 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else
|
|
6
|
-
for (var i = decorators.length - 1;i >= 0; i--)
|
|
7
|
-
if (d = decorators[i])
|
|
8
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// src/AiException.ts
|
|
13
|
-
import { Exception } from "@ooneex/exception";
|
|
14
|
-
import { HttpStatus } from "@ooneex/http-status";
|
|
15
|
-
|
|
16
|
-
class AiException extends Exception {
|
|
17
|
-
constructor(message, data = {}) {
|
|
18
|
-
super(message, {
|
|
19
|
-
status: HttpStatus.Code.InternalServerError,
|
|
20
|
-
data
|
|
21
|
-
});
|
|
22
|
-
this.name = "AiException";
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
// src/AnthropicAi.ts
|
|
26
|
-
import { jsonSchemaToTypeString } from "@ooneex/validation";
|
|
27
|
-
import { chat } from "@tanstack/ai";
|
|
28
|
-
import { createAnthropicChat } from "@tanstack/ai-anthropic";
|
|
29
|
-
import { type } from "arktype";
|
|
30
|
-
|
|
31
|
-
// src/decorators.ts
|
|
32
|
-
import { container, EContainerScope } from "@ooneex/container";
|
|
33
|
-
var decorator = {
|
|
34
|
-
ai: (scope = EContainerScope.Singleton) => {
|
|
35
|
-
return (target) => {
|
|
36
|
-
container.add(target, scope);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// src/AnthropicAi.ts
|
|
42
|
-
class AnthropicAi {
|
|
43
|
-
getApiKey(config) {
|
|
44
|
-
const apiKey = config?.apiKey || Bun.env.ANTHROPIC_API_KEY || "";
|
|
45
|
-
if (!apiKey) {
|
|
46
|
-
throw new AiException("Anthropic API key is required. Provide an API key through config options or set the ANTHROPIC_API_KEY environment variable.");
|
|
47
|
-
}
|
|
48
|
-
return apiKey;
|
|
49
|
-
}
|
|
50
|
-
getAdapter(apiKey, model) {
|
|
51
|
-
return createAnthropicChat(model, apiKey);
|
|
52
|
-
}
|
|
53
|
-
buildPrompt(instruction, config) {
|
|
54
|
-
const parts = [config?.prompt || instruction];
|
|
55
|
-
if (config?.context) {
|
|
56
|
-
parts.push(`Context:
|
|
57
|
-
${config.context}`);
|
|
58
|
-
}
|
|
59
|
-
if (config?.wordCount) {
|
|
60
|
-
parts.push(`Target approximately ${config.wordCount} words.`);
|
|
61
|
-
}
|
|
62
|
-
if (config?.tone) {
|
|
63
|
-
parts.push(`Use a ${config.tone} tone.`);
|
|
64
|
-
}
|
|
65
|
-
if (config?.language) {
|
|
66
|
-
parts.push(`Respond in ${config.language} language.`);
|
|
67
|
-
}
|
|
68
|
-
parts.push(`${config?.context ? "Use the provided context to inform your response. " : ""}Respond with only the transformed text. Do not include explanations or additional commentary.`);
|
|
69
|
-
return parts.join(`
|
|
70
|
-
`);
|
|
71
|
-
}
|
|
72
|
-
toMessages(messages) {
|
|
73
|
-
return messages.map((msg) => ({ role: msg.role, content: msg.content }));
|
|
74
|
-
}
|
|
75
|
-
async executeChat(content, systemPrompt, config) {
|
|
76
|
-
const apiKey = this.getApiKey(config);
|
|
77
|
-
const model = config?.model ?? "claude-sonnet-4-5";
|
|
78
|
-
const adapter = this.getAdapter(apiKey, model);
|
|
79
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
80
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
1
|
+
var $=function(z,H,R,D){var B=arguments.length,F=B<3?H:D===null?D=Object.getOwnPropertyDescriptor(H,R):D,J;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")F=Reflect.decorate(z,H,R,D);else for(var N=z.length-1;N>=0;N--)if(J=z[N])F=(B<3?J(F):B>3?J(H,R,F):J(H,R))||F;return B>3&&F&&Object.defineProperty(H,R,F),F};import{Exception as T}from"@ooneex/exception";import{HttpStatus as v}from"@ooneex/http-status";class Y extends T{constructor(z,H={}){super(z,{status:v.Code.InternalServerError,data:H});this.name="AiException"}}import{jsonSchemaToTypeString as M}from"@ooneex/validation";import{chat as G}from"@tanstack/ai";import{createAnthropicChat as b}from"@tanstack/ai-anthropic";import{type as P}from"arktype";import{container as S,EContainerScope as K}from"@ooneex/container";var _={ai:(z=K.Singleton)=>{return(H)=>{S.add(H,z)}}};class I{getApiKey(z){let H=z?.apiKey||Bun.env.ANTHROPIC_API_KEY||"";if(!H)throw new Y("Anthropic API key is required. Provide an API key through config options or set the ANTHROPIC_API_KEY environment variable.");return H}getAdapter(z,H){return b(H,z)}buildPrompt(z,H){let R=[H?.prompt||z];if(H?.context)R.push(`Context:
|
|
2
|
+
${H.context}`);if(H?.wordCount)R.push(`Target approximately ${H.wordCount} words.`);if(H?.tone)R.push(`Use a ${H.tone} tone.`);if(H?.language)R.push(`Respond in ${H.language} language.`);return R.push(`${H?.context?"Use the provided context to inform your response. ":""}Respond with only the transformed text. Do not include explanations or additional commentary.`),R.join(`
|
|
3
|
+
`)}toMessages(z){return z.map((H)=>({role:H.role,content:H.content}))}async executeChat(z,H,R){let D=this.getApiKey(R),B=R?.model??"claude-sonnet-4-5",F=this.getAdapter(D,B),J=R?.messages?this.toMessages(R.messages):[],N={role:"user",content:`${H}
|
|
81
4
|
|
|
82
5
|
Text to process:
|
|
83
|
-
${
|
|
84
|
-
const messages = [...baseMessages, userMessage];
|
|
85
|
-
const result = await chat({
|
|
86
|
-
adapter,
|
|
87
|
-
messages,
|
|
88
|
-
stream: false
|
|
89
|
-
});
|
|
90
|
-
return result.trim();
|
|
91
|
-
}
|
|
92
|
-
async makeShorter(content, config) {
|
|
93
|
-
const prompt = this.buildPrompt("Condense the following text while preserving its core meaning and key information. Remove redundancies and unnecessary details.", config);
|
|
94
|
-
return this.executeChat(content, prompt, config);
|
|
95
|
-
}
|
|
96
|
-
async makeLonger(content, config) {
|
|
97
|
-
const prompt = this.buildPrompt("Expand the following text by adding relevant details, examples, and explanations while maintaining coherence and the original message.", config);
|
|
98
|
-
return this.executeChat(content, prompt, config);
|
|
99
|
-
}
|
|
100
|
-
async summarize(content, config) {
|
|
101
|
-
const prompt = this.buildPrompt("Provide a clear and comprehensive summary of the following text, capturing all essential points and main ideas.", config);
|
|
102
|
-
return this.executeChat(content, prompt, config);
|
|
103
|
-
}
|
|
104
|
-
async concise(content, config) {
|
|
105
|
-
const prompt = this.buildPrompt("Rewrite the following text in the most concise form possible without losing essential meaning.", config);
|
|
106
|
-
return this.executeChat(content, prompt, config);
|
|
107
|
-
}
|
|
108
|
-
async paragraph(content, config) {
|
|
109
|
-
const prompt = this.buildPrompt("Transform the following text into well-structured paragraph format with clear topic sentences and logical flow.", config);
|
|
110
|
-
return this.executeChat(content, prompt, config);
|
|
111
|
-
}
|
|
112
|
-
async bulletPoints(content, config) {
|
|
113
|
-
const prompt = this.buildPrompt("Convert the following text into a clear, organized list of bullet points highlighting the key information.", config);
|
|
114
|
-
return this.executeChat(content, prompt, config);
|
|
115
|
-
}
|
|
116
|
-
async rephrase(content, config) {
|
|
117
|
-
const prompt = this.buildPrompt("Rephrase the following text using different words and sentence structures while preserving the original meaning.", config);
|
|
118
|
-
return this.executeChat(content, prompt, config);
|
|
119
|
-
}
|
|
120
|
-
async simplify(content, config) {
|
|
121
|
-
const prompt = this.buildPrompt("Simplify the following text by using plain language, shorter sentences, and avoiding jargon. Make it accessible to a general audience.", config);
|
|
122
|
-
return this.executeChat(content, prompt, config);
|
|
123
|
-
}
|
|
124
|
-
async changeTone(content, tone, config) {
|
|
125
|
-
const prompt = this.buildPrompt(`Rewrite the following text in a ${tone} tone while maintaining clarity.`, config);
|
|
126
|
-
return this.executeChat(content, prompt, config);
|
|
127
|
-
}
|
|
128
|
-
async proofread(content, config) {
|
|
129
|
-
const prompt = this.buildPrompt("Proofread and correct the following text for grammar, spelling, punctuation, and clarity issues. Return the corrected version.", config);
|
|
130
|
-
return this.executeChat(content, prompt, config);
|
|
131
|
-
}
|
|
132
|
-
async translate(content, config) {
|
|
133
|
-
const targetLanguage = config?.language ?? "en";
|
|
134
|
-
const prompt = this.buildPrompt(`Translate the following text accurately into ${targetLanguage}, preserving the original meaning, tone, and nuance.`, config);
|
|
135
|
-
return this.executeChat(content, prompt, config);
|
|
136
|
-
}
|
|
137
|
-
async explain(content, config) {
|
|
138
|
-
const prompt = this.buildPrompt("Provide a clear explanation of the following text, breaking down complex concepts and clarifying the meaning.", config);
|
|
139
|
-
return this.executeChat(content, prompt, config);
|
|
140
|
-
}
|
|
141
|
-
async expandIdeas(content, config) {
|
|
142
|
-
const prompt = this.buildPrompt("Expand on the ideas presented in the following text by exploring related concepts, implications, and additional perspectives.", config);
|
|
143
|
-
return this.executeChat(content, prompt, config);
|
|
144
|
-
}
|
|
145
|
-
async fixGrammar(content, config) {
|
|
146
|
-
const prompt = this.buildPrompt("Fix all grammatical errors in the following text, including subject-verb agreement, tense consistency, and sentence structure.", config);
|
|
147
|
-
return this.executeChat(content, prompt, config);
|
|
148
|
-
}
|
|
149
|
-
async generateTitle(content, config) {
|
|
150
|
-
const prompt = this.buildPrompt("Generate a compelling, descriptive title for the following text that captures its main theme and engages readers.", config);
|
|
151
|
-
return this.executeChat(content, prompt, config);
|
|
152
|
-
}
|
|
153
|
-
async extractKeywords(content, config) {
|
|
154
|
-
const prompt = this.buildPrompt("Extract the most important keywords and key phrases from the following text. Return only the keywords as a comma-separated list without numbering, brackets, or additional formatting.", config);
|
|
155
|
-
const result = await this.executeChat(content, prompt, config);
|
|
156
|
-
return result.split(",").map((keyword) => keyword.trim()).filter((keyword) => keyword.length > 0);
|
|
157
|
-
}
|
|
158
|
-
async extractCategories(content, config) {
|
|
159
|
-
const prompt = this.buildPrompt("Identify the most relevant categories or topics that best describe the following text. Return only the categories as a comma-separated list without numbering, brackets, or additional formatting.", config);
|
|
160
|
-
const result = await this.executeChat(content, prompt, config);
|
|
161
|
-
return result.split(",").map((category) => category.trim()).filter((category) => category.length > 0);
|
|
162
|
-
}
|
|
163
|
-
async run(prompt, config) {
|
|
164
|
-
const apiKey = this.getApiKey(config);
|
|
165
|
-
const model = config?.model ?? "claude-sonnet-4-5";
|
|
166
|
-
const adapter = this.getAdapter(apiKey, model);
|
|
167
|
-
let defaultPrompt = "Process the following request and respond appropriately. If the request asks for structured data, return valid JSON.";
|
|
168
|
-
if (config?.output) {
|
|
169
|
-
const schema = config.output.toJsonSchema();
|
|
170
|
-
const outputType = jsonSchemaToTypeString(schema);
|
|
171
|
-
defaultPrompt += `
|
|
6
|
+
${z}`},U=[...J,N];return(await G({adapter:F,messages:U,stream:!1})).trim()}async makeShorter(z,H){let R=this.buildPrompt("Condense the following text while preserving its core meaning and key information. Remove redundancies and unnecessary details.",H);return this.executeChat(z,R,H)}async makeLonger(z,H){let R=this.buildPrompt("Expand the following text by adding relevant details, examples, and explanations while maintaining coherence and the original message.",H);return this.executeChat(z,R,H)}async summarize(z,H){let R=this.buildPrompt("Provide a clear and comprehensive summary of the following text, capturing all essential points and main ideas.",H);return this.executeChat(z,R,H)}async concise(z,H){let R=this.buildPrompt("Rewrite the following text in the most concise form possible without losing essential meaning.",H);return this.executeChat(z,R,H)}async paragraph(z,H){let R=this.buildPrompt("Transform the following text into well-structured paragraph format with clear topic sentences and logical flow.",H);return this.executeChat(z,R,H)}async bulletPoints(z,H){let R=this.buildPrompt("Convert the following text into a clear, organized list of bullet points highlighting the key information.",H);return this.executeChat(z,R,H)}async rephrase(z,H){let R=this.buildPrompt("Rephrase the following text using different words and sentence structures while preserving the original meaning.",H);return this.executeChat(z,R,H)}async simplify(z,H){let R=this.buildPrompt("Simplify the following text by using plain language, shorter sentences, and avoiding jargon. Make it accessible to a general audience.",H);return this.executeChat(z,R,H)}async changeTone(z,H,R){let D=this.buildPrompt(`Rewrite the following text in a ${H} tone while maintaining clarity.`,R);return this.executeChat(z,D,R)}async proofread(z,H){let R=this.buildPrompt("Proofread and correct the following text for grammar, spelling, punctuation, and clarity issues. Return the corrected version.",H);return this.executeChat(z,R,H)}async translate(z,H){let R=H?.language??"en",D=this.buildPrompt(`Translate the following text accurately into ${R}, preserving the original meaning, tone, and nuance.`,H);return this.executeChat(z,D,H)}async explain(z,H){let R=this.buildPrompt("Provide a clear explanation of the following text, breaking down complex concepts and clarifying the meaning.",H);return this.executeChat(z,R,H)}async expandIdeas(z,H){let R=this.buildPrompt("Expand on the ideas presented in the following text by exploring related concepts, implications, and additional perspectives.",H);return this.executeChat(z,R,H)}async fixGrammar(z,H){let R=this.buildPrompt("Fix all grammatical errors in the following text, including subject-verb agreement, tense consistency, and sentence structure.",H);return this.executeChat(z,R,H)}async generateTitle(z,H){let R=this.buildPrompt("Generate a compelling, descriptive title for the following text that captures its main theme and engages readers.",H);return this.executeChat(z,R,H)}async extractKeywords(z,H){let R=this.buildPrompt("Extract the most important keywords and key phrases from the following text. Return only the keywords as a comma-separated list without numbering, brackets, or additional formatting.",H);return(await this.executeChat(z,R,H)).split(",").map((B)=>B.trim()).filter((B)=>B.length>0)}async extractCategories(z,H){let R=this.buildPrompt("Identify the most relevant categories or topics that best describe the following text. Return only the categories as a comma-separated list without numbering, brackets, or additional formatting.",H);return(await this.executeChat(z,R,H)).split(",").map((B)=>B.trim()).filter((B)=>B.length>0)}async run(z,H){let R=this.getApiKey(H),D=H?.model??"claude-sonnet-4-5",B=this.getAdapter(R,D),F="Process the following request and respond appropriately. If the request asks for structured data, return valid JSON.";if(H?.output){let Q=H.output.toJsonSchema(),C=M(Q);F+=`
|
|
172
7
|
|
|
173
|
-
Output Type: ${
|
|
174
|
-
}
|
|
175
|
-
const systemPrompt = this.buildPrompt(defaultPrompt, config);
|
|
176
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
177
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
8
|
+
Output Type: ${C}`}let J=this.buildPrompt(F,H),N=H?.messages?this.toMessages(H.messages):[],U={role:"user",content:`${J}
|
|
178
9
|
|
|
179
10
|
Request:
|
|
180
|
-
${
|
|
181
|
-
const messages = [...baseMessages, userMessage];
|
|
182
|
-
const result = await chat({
|
|
183
|
-
adapter,
|
|
184
|
-
messages,
|
|
185
|
-
stream: false
|
|
186
|
-
});
|
|
187
|
-
const trimmed = result.trim();
|
|
188
|
-
let parsed;
|
|
189
|
-
try {
|
|
190
|
-
const cleaned = trimmed.replace(/```json\n?|\n?```/g, "").trim();
|
|
191
|
-
parsed = JSON.parse(cleaned);
|
|
192
|
-
} catch {
|
|
193
|
-
parsed = trimmed;
|
|
194
|
-
}
|
|
195
|
-
if (config?.output) {
|
|
196
|
-
const validation = config.output(parsed);
|
|
197
|
-
if (validation instanceof type.errors) {
|
|
198
|
-
throw new AiException(`Output validation failed: ${validation.summary}`);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return parsed;
|
|
202
|
-
}
|
|
203
|
-
async* runStream(prompt, config) {
|
|
204
|
-
const apiKey = this.getApiKey(config);
|
|
205
|
-
const model = config?.model ?? "claude-sonnet-4-5";
|
|
206
|
-
const adapter = this.getAdapter(apiKey, model);
|
|
207
|
-
const defaultPrompt = "Process the following request and respond appropriately.";
|
|
208
|
-
const systemPrompt = this.buildPrompt(defaultPrompt, config);
|
|
209
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
210
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
11
|
+
${z}`},W=[...N,U],V=(await G({adapter:B,messages:W,stream:!1})).trim(),X;try{let Q=V.replace(/```json\n?|\n?```/g,"").trim();X=JSON.parse(Q)}catch{X=V}if(H?.output){let Q=H.output(X);if(Q instanceof P.errors)throw new Y(`Output validation failed: ${Q.summary}`)}return X}async*runStream(z,H){let R=this.getApiKey(H),D=H?.model??"claude-sonnet-4-5",B=this.getAdapter(R,D),F="Process the following request and respond appropriately.",J=this.buildPrompt("Process the following request and respond appropriately.",H),N=H?.messages?this.toMessages(H.messages):[],U={role:"user",content:`${J}
|
|
211
12
|
|
|
212
13
|
Request:
|
|
213
|
-
${
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
adapter,
|
|
217
|
-
messages,
|
|
218
|
-
stream: true
|
|
219
|
-
});
|
|
220
|
-
for await (const chunk of stream) {
|
|
221
|
-
if (chunk.type === "content") {
|
|
222
|
-
yield chunk.content;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
AnthropicAi = __legacyDecorateClassTS([
|
|
228
|
-
decorator.ai()
|
|
229
|
-
], AnthropicAi);
|
|
230
|
-
// src/GeminiAi.ts
|
|
231
|
-
import { jsonSchemaToTypeString as jsonSchemaToTypeString2 } from "@ooneex/validation";
|
|
232
|
-
import { chat as chat2 } from "@tanstack/ai";
|
|
233
|
-
import { createGeminiChat } from "@tanstack/ai-gemini";
|
|
234
|
-
import { type as type2 } from "arktype";
|
|
235
|
-
class GeminiAi {
|
|
236
|
-
getApiKey(config) {
|
|
237
|
-
const apiKey = config?.apiKey || Bun.env.GEMINI_API_KEY || "";
|
|
238
|
-
if (!apiKey) {
|
|
239
|
-
throw new AiException("Gemini API key is required. Provide an API key through config options or set the GEMINI_API_KEY environment variable.");
|
|
240
|
-
}
|
|
241
|
-
return apiKey;
|
|
242
|
-
}
|
|
243
|
-
getAdapter(apiKey, model = "gemini-2.0-flash") {
|
|
244
|
-
return createGeminiChat(model, apiKey);
|
|
245
|
-
}
|
|
246
|
-
buildPrompt(instruction, config) {
|
|
247
|
-
const parts = [config?.prompt || instruction];
|
|
248
|
-
if (config?.context) {
|
|
249
|
-
parts.push(`Context:
|
|
250
|
-
${config.context}`);
|
|
251
|
-
}
|
|
252
|
-
if (config?.wordCount) {
|
|
253
|
-
parts.push(`Target approximately ${config.wordCount} words.`);
|
|
254
|
-
}
|
|
255
|
-
if (config?.tone) {
|
|
256
|
-
parts.push(`Use a ${config.tone} tone.`);
|
|
257
|
-
}
|
|
258
|
-
if (config?.language) {
|
|
259
|
-
parts.push(`Respond in ${config.language} language.`);
|
|
260
|
-
}
|
|
261
|
-
parts.push(`${config?.context ? "Use the provided context to inform your response. " : ""}Respond with only the transformed text. Do not include explanations or additional commentary.`);
|
|
262
|
-
return parts.join(`
|
|
263
|
-
`);
|
|
264
|
-
}
|
|
265
|
-
toMessages(messages) {
|
|
266
|
-
return messages.map((msg) => ({ role: msg.role, content: msg.content }));
|
|
267
|
-
}
|
|
268
|
-
async executeChat(content, systemPrompt, config) {
|
|
269
|
-
const apiKey = this.getApiKey(config);
|
|
270
|
-
const model = config?.model ?? "gemini-2.0-flash";
|
|
271
|
-
const adapter = this.getAdapter(apiKey, model);
|
|
272
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
273
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
14
|
+
${z}`},W=[...N,U],Z=G({adapter:B,messages:W,stream:!0});for await(let V of Z)if(V.type==="content")yield V.content}}I=$([_.ai()],I);import{jsonSchemaToTypeString as w}from"@ooneex/validation";import{chat as E}from"@tanstack/ai";import{createGeminiChat as A}from"@tanstack/ai-gemini";import{type as l}from"arktype";class j{getApiKey(z){let H=z?.apiKey||Bun.env.GEMINI_API_KEY||"";if(!H)throw new Y("Gemini API key is required. Provide an API key through config options or set the GEMINI_API_KEY environment variable.");return H}getAdapter(z,H="gemini-2.0-flash"){return A(H,z)}buildPrompt(z,H){let R=[H?.prompt||z];if(H?.context)R.push(`Context:
|
|
15
|
+
${H.context}`);if(H?.wordCount)R.push(`Target approximately ${H.wordCount} words.`);if(H?.tone)R.push(`Use a ${H.tone} tone.`);if(H?.language)R.push(`Respond in ${H.language} language.`);return R.push(`${H?.context?"Use the provided context to inform your response. ":""}Respond with only the transformed text. Do not include explanations or additional commentary.`),R.join(`
|
|
16
|
+
`)}toMessages(z){return z.map((H)=>({role:H.role,content:H.content}))}async executeChat(z,H,R){let D=this.getApiKey(R),B=R?.model??"gemini-2.0-flash",F=this.getAdapter(D,B),J=R?.messages?this.toMessages(R.messages):[],N={role:"user",content:`${H}
|
|
274
17
|
|
|
275
18
|
Text to process:
|
|
276
|
-
${
|
|
277
|
-
const messages = [...baseMessages, userMessage];
|
|
278
|
-
const result = await chat2({
|
|
279
|
-
adapter,
|
|
280
|
-
messages,
|
|
281
|
-
stream: false
|
|
282
|
-
});
|
|
283
|
-
return result.trim();
|
|
284
|
-
}
|
|
285
|
-
async makeShorter(content, config) {
|
|
286
|
-
const prompt = this.buildPrompt("Condense the following text while preserving its core meaning and key information. Remove redundancies and unnecessary details.", config);
|
|
287
|
-
return this.executeChat(content, prompt, config);
|
|
288
|
-
}
|
|
289
|
-
async makeLonger(content, config) {
|
|
290
|
-
const prompt = this.buildPrompt("Expand the following text by adding relevant details, examples, and explanations while maintaining coherence and the original message.", config);
|
|
291
|
-
return this.executeChat(content, prompt, config);
|
|
292
|
-
}
|
|
293
|
-
async summarize(content, config) {
|
|
294
|
-
const prompt = this.buildPrompt("Provide a clear and comprehensive summary of the following text, capturing all essential points and main ideas.", config);
|
|
295
|
-
return this.executeChat(content, prompt, config);
|
|
296
|
-
}
|
|
297
|
-
async concise(content, config) {
|
|
298
|
-
const prompt = this.buildPrompt("Rewrite the following text in the most concise form possible without losing essential meaning.", config);
|
|
299
|
-
return this.executeChat(content, prompt, config);
|
|
300
|
-
}
|
|
301
|
-
async paragraph(content, config) {
|
|
302
|
-
const prompt = this.buildPrompt("Transform the following text into well-structured paragraph format with clear topic sentences and logical flow.", config);
|
|
303
|
-
return this.executeChat(content, prompt, config);
|
|
304
|
-
}
|
|
305
|
-
async bulletPoints(content, config) {
|
|
306
|
-
const prompt = this.buildPrompt("Convert the following text into a clear, organized list of bullet points highlighting the key information.", config);
|
|
307
|
-
return this.executeChat(content, prompt, config);
|
|
308
|
-
}
|
|
309
|
-
async rephrase(content, config) {
|
|
310
|
-
const prompt = this.buildPrompt("Rephrase the following text using different words and sentence structures while preserving the original meaning.", config);
|
|
311
|
-
return this.executeChat(content, prompt, config);
|
|
312
|
-
}
|
|
313
|
-
async simplify(content, config) {
|
|
314
|
-
const prompt = this.buildPrompt("Simplify the following text by using plain language, shorter sentences, and avoiding jargon. Make it accessible to a general audience.", config);
|
|
315
|
-
return this.executeChat(content, prompt, config);
|
|
316
|
-
}
|
|
317
|
-
async changeTone(content, tone, config) {
|
|
318
|
-
const prompt = this.buildPrompt(`Rewrite the following text in a ${tone} tone while maintaining clarity.`, config);
|
|
319
|
-
return this.executeChat(content, prompt, config);
|
|
320
|
-
}
|
|
321
|
-
async proofread(content, config) {
|
|
322
|
-
const prompt = this.buildPrompt("Proofread and correct the following text for grammar, spelling, punctuation, and clarity issues. Return the corrected version.", config);
|
|
323
|
-
return this.executeChat(content, prompt, config);
|
|
324
|
-
}
|
|
325
|
-
async translate(content, config) {
|
|
326
|
-
const targetLanguage = config?.language ?? "en";
|
|
327
|
-
const prompt = this.buildPrompt(`Translate the following text accurately into ${targetLanguage}, preserving the original meaning, tone, and nuance.`, config);
|
|
328
|
-
return this.executeChat(content, prompt, config);
|
|
329
|
-
}
|
|
330
|
-
async explain(content, config) {
|
|
331
|
-
const prompt = this.buildPrompt("Provide a clear explanation of the following text, breaking down complex concepts and clarifying the meaning.", config);
|
|
332
|
-
return this.executeChat(content, prompt, config);
|
|
333
|
-
}
|
|
334
|
-
async expandIdeas(content, config) {
|
|
335
|
-
const prompt = this.buildPrompt("Expand on the ideas presented in the following text by exploring related concepts, implications, and additional perspectives.", config);
|
|
336
|
-
return this.executeChat(content, prompt, config);
|
|
337
|
-
}
|
|
338
|
-
async fixGrammar(content, config) {
|
|
339
|
-
const prompt = this.buildPrompt("Fix all grammatical errors in the following text, including subject-verb agreement, tense consistency, and sentence structure.", config);
|
|
340
|
-
return this.executeChat(content, prompt, config);
|
|
341
|
-
}
|
|
342
|
-
async generateTitle(content, config) {
|
|
343
|
-
const prompt = this.buildPrompt("Generate a compelling, descriptive title for the following text that captures its main theme and engages readers.", config);
|
|
344
|
-
return this.executeChat(content, prompt, config);
|
|
345
|
-
}
|
|
346
|
-
async extractKeywords(content, config) {
|
|
347
|
-
const prompt = this.buildPrompt("Extract the most important keywords and key phrases from the following text. Return only the keywords as a comma-separated list without numbering, brackets, or additional formatting.", config);
|
|
348
|
-
const result = await this.executeChat(content, prompt, config);
|
|
349
|
-
return result.split(",").map((keyword) => keyword.trim()).filter((keyword) => keyword.length > 0);
|
|
350
|
-
}
|
|
351
|
-
async extractCategories(content, config) {
|
|
352
|
-
const prompt = this.buildPrompt("Identify the most relevant categories or topics that best describe the following text. Return only the categories as a comma-separated list without numbering, brackets, or additional formatting.", config);
|
|
353
|
-
const result = await this.executeChat(content, prompt, config);
|
|
354
|
-
return result.split(",").map((category) => category.trim()).filter((category) => category.length > 0);
|
|
355
|
-
}
|
|
356
|
-
async run(prompt, config) {
|
|
357
|
-
const apiKey = this.getApiKey(config);
|
|
358
|
-
const model = config?.model ?? "gemini-2.5-pro";
|
|
359
|
-
const adapter = this.getAdapter(apiKey, model);
|
|
360
|
-
let defaultPrompt = "Process the following request and respond appropriately. If the request asks for structured data, return valid JSON.";
|
|
361
|
-
if (config?.output) {
|
|
362
|
-
const schema = config.output.toJsonSchema();
|
|
363
|
-
const outputType = jsonSchemaToTypeString2(schema);
|
|
364
|
-
defaultPrompt += `
|
|
19
|
+
${z}`},U=[...J,N];return(await E({adapter:F,messages:U,stream:!1})).trim()}async makeShorter(z,H){let R=this.buildPrompt("Condense the following text while preserving its core meaning and key information. Remove redundancies and unnecessary details.",H);return this.executeChat(z,R,H)}async makeLonger(z,H){let R=this.buildPrompt("Expand the following text by adding relevant details, examples, and explanations while maintaining coherence and the original message.",H);return this.executeChat(z,R,H)}async summarize(z,H){let R=this.buildPrompt("Provide a clear and comprehensive summary of the following text, capturing all essential points and main ideas.",H);return this.executeChat(z,R,H)}async concise(z,H){let R=this.buildPrompt("Rewrite the following text in the most concise form possible without losing essential meaning.",H);return this.executeChat(z,R,H)}async paragraph(z,H){let R=this.buildPrompt("Transform the following text into well-structured paragraph format with clear topic sentences and logical flow.",H);return this.executeChat(z,R,H)}async bulletPoints(z,H){let R=this.buildPrompt("Convert the following text into a clear, organized list of bullet points highlighting the key information.",H);return this.executeChat(z,R,H)}async rephrase(z,H){let R=this.buildPrompt("Rephrase the following text using different words and sentence structures while preserving the original meaning.",H);return this.executeChat(z,R,H)}async simplify(z,H){let R=this.buildPrompt("Simplify the following text by using plain language, shorter sentences, and avoiding jargon. Make it accessible to a general audience.",H);return this.executeChat(z,R,H)}async changeTone(z,H,R){let D=this.buildPrompt(`Rewrite the following text in a ${H} tone while maintaining clarity.`,R);return this.executeChat(z,D,R)}async proofread(z,H){let R=this.buildPrompt("Proofread and correct the following text for grammar, spelling, punctuation, and clarity issues. Return the corrected version.",H);return this.executeChat(z,R,H)}async translate(z,H){let R=H?.language??"en",D=this.buildPrompt(`Translate the following text accurately into ${R}, preserving the original meaning, tone, and nuance.`,H);return this.executeChat(z,D,H)}async explain(z,H){let R=this.buildPrompt("Provide a clear explanation of the following text, breaking down complex concepts and clarifying the meaning.",H);return this.executeChat(z,R,H)}async expandIdeas(z,H){let R=this.buildPrompt("Expand on the ideas presented in the following text by exploring related concepts, implications, and additional perspectives.",H);return this.executeChat(z,R,H)}async fixGrammar(z,H){let R=this.buildPrompt("Fix all grammatical errors in the following text, including subject-verb agreement, tense consistency, and sentence structure.",H);return this.executeChat(z,R,H)}async generateTitle(z,H){let R=this.buildPrompt("Generate a compelling, descriptive title for the following text that captures its main theme and engages readers.",H);return this.executeChat(z,R,H)}async extractKeywords(z,H){let R=this.buildPrompt("Extract the most important keywords and key phrases from the following text. Return only the keywords as a comma-separated list without numbering, brackets, or additional formatting.",H);return(await this.executeChat(z,R,H)).split(",").map((B)=>B.trim()).filter((B)=>B.length>0)}async extractCategories(z,H){let R=this.buildPrompt("Identify the most relevant categories or topics that best describe the following text. Return only the categories as a comma-separated list without numbering, brackets, or additional formatting.",H);return(await this.executeChat(z,R,H)).split(",").map((B)=>B.trim()).filter((B)=>B.length>0)}async run(z,H){let R=this.getApiKey(H),D=H?.model??"gemini-2.5-pro",B=this.getAdapter(R,D),F="Process the following request and respond appropriately. If the request asks for structured data, return valid JSON.";if(H?.output){let Q=H.output.toJsonSchema(),C=w(Q);F+=`
|
|
365
20
|
|
|
366
|
-
Output Type: ${
|
|
367
|
-
}
|
|
368
|
-
const systemPrompt = this.buildPrompt(defaultPrompt, config);
|
|
369
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
370
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
21
|
+
Output Type: ${C}`}let J=this.buildPrompt(F,H),N=H?.messages?this.toMessages(H.messages):[],U={role:"user",content:`${J}
|
|
371
22
|
|
|
372
23
|
Request:
|
|
373
|
-
${
|
|
374
|
-
const messages = [...baseMessages, userMessage];
|
|
375
|
-
const result = await chat2({
|
|
376
|
-
adapter,
|
|
377
|
-
messages,
|
|
378
|
-
stream: false
|
|
379
|
-
});
|
|
380
|
-
const trimmed = result.trim();
|
|
381
|
-
let parsed;
|
|
382
|
-
try {
|
|
383
|
-
const cleaned = trimmed.replace(/```json\n?|\n?```/g, "").trim();
|
|
384
|
-
parsed = JSON.parse(cleaned);
|
|
385
|
-
} catch {
|
|
386
|
-
parsed = trimmed;
|
|
387
|
-
}
|
|
388
|
-
if (config?.output) {
|
|
389
|
-
const validation = config.output(parsed);
|
|
390
|
-
if (validation instanceof type2.errors) {
|
|
391
|
-
throw new AiException(`Output validation failed: ${validation.summary}`);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
return parsed;
|
|
395
|
-
}
|
|
396
|
-
async* runStream(prompt, config) {
|
|
397
|
-
const apiKey = this.getApiKey(config);
|
|
398
|
-
const model = config?.model ?? "gemini-2.5-pro";
|
|
399
|
-
const adapter = this.getAdapter(apiKey, model);
|
|
400
|
-
const defaultPrompt = "Process the following request and respond appropriately.";
|
|
401
|
-
const systemPrompt = this.buildPrompt(defaultPrompt, config);
|
|
402
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
403
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
24
|
+
${z}`},W=[...N,U],V=(await E({adapter:B,messages:W,stream:!1})).trim(),X;try{let Q=V.replace(/```json\n?|\n?```/g,"").trim();X=JSON.parse(Q)}catch{X=V}if(H?.output){let Q=H.output(X);if(Q instanceof l.errors)throw new Y(`Output validation failed: ${Q.summary}`)}return X}async*runStream(z,H){let R=this.getApiKey(H),D=H?.model??"gemini-2.5-pro",B=this.getAdapter(R,D),F="Process the following request and respond appropriately.",J=this.buildPrompt("Process the following request and respond appropriately.",H),N=H?.messages?this.toMessages(H.messages):[],U={role:"user",content:`${J}
|
|
404
25
|
|
|
405
26
|
Request:
|
|
406
|
-
${
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
adapter,
|
|
410
|
-
messages,
|
|
411
|
-
stream: true
|
|
412
|
-
});
|
|
413
|
-
for await (const chunk of stream) {
|
|
414
|
-
if (chunk.type === "content") {
|
|
415
|
-
yield chunk.content;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
GeminiAi = __legacyDecorateClassTS([
|
|
421
|
-
decorator.ai()
|
|
422
|
-
], GeminiAi);
|
|
423
|
-
// src/OllamaAi.ts
|
|
424
|
-
import { jsonSchemaToTypeString as jsonSchemaToTypeString3 } from "@ooneex/validation";
|
|
425
|
-
import { chat as chat3 } from "@tanstack/ai";
|
|
426
|
-
import { createOllamaChat } from "@tanstack/ai-ollama";
|
|
427
|
-
import { type as type3 } from "arktype";
|
|
428
|
-
class OllamaAi {
|
|
429
|
-
getHost(config) {
|
|
430
|
-
return config?.host || Bun.env.OLLAMA_HOST || "http://localhost:11434";
|
|
431
|
-
}
|
|
432
|
-
getAdapter(model = "llama3", host) {
|
|
433
|
-
return createOllamaChat(model, host);
|
|
434
|
-
}
|
|
435
|
-
buildPrompt(instruction, config) {
|
|
436
|
-
const parts = [config?.prompt || instruction];
|
|
437
|
-
if (config?.context) {
|
|
438
|
-
parts.push(`Context:
|
|
439
|
-
${config.context}`);
|
|
440
|
-
}
|
|
441
|
-
if (config?.wordCount) {
|
|
442
|
-
parts.push(`Target approximately ${config.wordCount} words.`);
|
|
443
|
-
}
|
|
444
|
-
if (config?.tone) {
|
|
445
|
-
parts.push(`Use a ${config.tone} tone.`);
|
|
446
|
-
}
|
|
447
|
-
if (config?.language) {
|
|
448
|
-
parts.push(`Respond in ${config.language} language.`);
|
|
449
|
-
}
|
|
450
|
-
parts.push(`${config?.context ? "Use the provided context to inform your response. " : ""}Respond with only the transformed text. Do not include explanations or additional commentary.`);
|
|
451
|
-
return parts.join(`
|
|
452
|
-
`);
|
|
453
|
-
}
|
|
454
|
-
toMessages(messages) {
|
|
455
|
-
return messages.map((msg) => ({ role: msg.role, content: msg.content }));
|
|
456
|
-
}
|
|
457
|
-
async executeChat(content, systemPrompt, config) {
|
|
458
|
-
const host = this.getHost(config);
|
|
459
|
-
const model = config?.model ?? "llama3";
|
|
460
|
-
const adapter = this.getAdapter(model, host);
|
|
461
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
462
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
27
|
+
${z}`},W=[...N,U],Z=E({adapter:B,messages:W,stream:!0});for await(let V of Z)if(V.type==="content")yield V.content}}j=$([_.ai()],j);import{jsonSchemaToTypeString as k}from"@ooneex/validation";import{chat as x}from"@tanstack/ai";import{createOllamaChat as h}from"@tanstack/ai-ollama";import{type as y}from"arktype";class q{getHost(z){return z?.host||Bun.env.OLLAMA_HOST||"http://localhost:11434"}getAdapter(z="llama3",H){return h(z,H)}buildPrompt(z,H){let R=[H?.prompt||z];if(H?.context)R.push(`Context:
|
|
28
|
+
${H.context}`);if(H?.wordCount)R.push(`Target approximately ${H.wordCount} words.`);if(H?.tone)R.push(`Use a ${H.tone} tone.`);if(H?.language)R.push(`Respond in ${H.language} language.`);return R.push(`${H?.context?"Use the provided context to inform your response. ":""}Respond with only the transformed text. Do not include explanations or additional commentary.`),R.join(`
|
|
29
|
+
`)}toMessages(z){return z.map((H)=>({role:H.role,content:H.content}))}async executeChat(z,H,R){let D=this.getHost(R),B=R?.model??"llama3",F=this.getAdapter(B,D),J=R?.messages?this.toMessages(R.messages):[],N={role:"user",content:`${H}
|
|
463
30
|
|
|
464
31
|
Text to process:
|
|
465
|
-
${
|
|
466
|
-
const messages = [...baseMessages, userMessage];
|
|
467
|
-
const result = await chat3({
|
|
468
|
-
adapter,
|
|
469
|
-
messages,
|
|
470
|
-
stream: false
|
|
471
|
-
});
|
|
472
|
-
return result.trim();
|
|
473
|
-
}
|
|
474
|
-
async makeShorter(content, config) {
|
|
475
|
-
const prompt = this.buildPrompt("Condense the following text while preserving its core meaning and key information. Remove redundancies and unnecessary details.", config);
|
|
476
|
-
return this.executeChat(content, prompt, config);
|
|
477
|
-
}
|
|
478
|
-
async makeLonger(content, config) {
|
|
479
|
-
const prompt = this.buildPrompt("Expand the following text by adding relevant details, examples, and explanations while maintaining coherence and the original message.", config);
|
|
480
|
-
return this.executeChat(content, prompt, config);
|
|
481
|
-
}
|
|
482
|
-
async summarize(content, config) {
|
|
483
|
-
const prompt = this.buildPrompt("Provide a clear and comprehensive summary of the following text, capturing all essential points and main ideas.", config);
|
|
484
|
-
return this.executeChat(content, prompt, config);
|
|
485
|
-
}
|
|
486
|
-
async concise(content, config) {
|
|
487
|
-
const prompt = this.buildPrompt("Rewrite the following text in the most concise form possible without losing essential meaning.", config);
|
|
488
|
-
return this.executeChat(content, prompt, config);
|
|
489
|
-
}
|
|
490
|
-
async paragraph(content, config) {
|
|
491
|
-
const prompt = this.buildPrompt("Transform the following text into well-structured paragraph format with clear topic sentences and logical flow.", config);
|
|
492
|
-
return this.executeChat(content, prompt, config);
|
|
493
|
-
}
|
|
494
|
-
async bulletPoints(content, config) {
|
|
495
|
-
const prompt = this.buildPrompt("Convert the following text into a clear, organized list of bullet points highlighting the key information.", config);
|
|
496
|
-
return this.executeChat(content, prompt, config);
|
|
497
|
-
}
|
|
498
|
-
async rephrase(content, config) {
|
|
499
|
-
const prompt = this.buildPrompt("Rephrase the following text using different words and sentence structures while preserving the original meaning.", config);
|
|
500
|
-
return this.executeChat(content, prompt, config);
|
|
501
|
-
}
|
|
502
|
-
async simplify(content, config) {
|
|
503
|
-
const prompt = this.buildPrompt("Simplify the following text by using plain language, shorter sentences, and avoiding jargon. Make it accessible to a general audience.", config);
|
|
504
|
-
return this.executeChat(content, prompt, config);
|
|
505
|
-
}
|
|
506
|
-
async changeTone(content, tone, config) {
|
|
507
|
-
const prompt = this.buildPrompt(`Rewrite the following text in a ${tone} tone while maintaining clarity.`, config);
|
|
508
|
-
return this.executeChat(content, prompt, config);
|
|
509
|
-
}
|
|
510
|
-
async proofread(content, config) {
|
|
511
|
-
const prompt = this.buildPrompt("Proofread and correct the following text for grammar, spelling, punctuation, and clarity issues. Return the corrected version.", config);
|
|
512
|
-
return this.executeChat(content, prompt, config);
|
|
513
|
-
}
|
|
514
|
-
async translate(content, config) {
|
|
515
|
-
const targetLanguage = config?.language ?? "en";
|
|
516
|
-
const prompt = this.buildPrompt(`Translate the following text accurately into ${targetLanguage}, preserving the original meaning, tone, and nuance.`, config);
|
|
517
|
-
return this.executeChat(content, prompt, config);
|
|
518
|
-
}
|
|
519
|
-
async explain(content, config) {
|
|
520
|
-
const prompt = this.buildPrompt("Provide a clear explanation of the following text, breaking down complex concepts and clarifying the meaning.", config);
|
|
521
|
-
return this.executeChat(content, prompt, config);
|
|
522
|
-
}
|
|
523
|
-
async expandIdeas(content, config) {
|
|
524
|
-
const prompt = this.buildPrompt("Expand on the ideas presented in the following text by exploring related concepts, implications, and additional perspectives.", config);
|
|
525
|
-
return this.executeChat(content, prompt, config);
|
|
526
|
-
}
|
|
527
|
-
async fixGrammar(content, config) {
|
|
528
|
-
const prompt = this.buildPrompt("Fix all grammatical errors in the following text, including subject-verb agreement, tense consistency, and sentence structure.", config);
|
|
529
|
-
return this.executeChat(content, prompt, config);
|
|
530
|
-
}
|
|
531
|
-
async generateTitle(content, config) {
|
|
532
|
-
const prompt = this.buildPrompt("Generate a compelling, descriptive title for the following text that captures its main theme and engages readers.", config);
|
|
533
|
-
return this.executeChat(content, prompt, config);
|
|
534
|
-
}
|
|
535
|
-
async extractKeywords(content, config) {
|
|
536
|
-
const prompt = this.buildPrompt("Extract the most important keywords and key phrases from the following text. Return only the keywords as a comma-separated list without numbering, brackets, or additional formatting.", config);
|
|
537
|
-
const result = await this.executeChat(content, prompt, config);
|
|
538
|
-
return result.split(",").map((keyword) => keyword.trim()).filter((keyword) => keyword.length > 0);
|
|
539
|
-
}
|
|
540
|
-
async extractCategories(content, config) {
|
|
541
|
-
const prompt = this.buildPrompt("Identify the most relevant categories or topics that best describe the following text. Return only the categories as a comma-separated list without numbering, brackets, or additional formatting.", config);
|
|
542
|
-
const result = await this.executeChat(content, prompt, config);
|
|
543
|
-
return result.split(",").map((category) => category.trim()).filter((category) => category.length > 0);
|
|
544
|
-
}
|
|
545
|
-
async run(prompt, config) {
|
|
546
|
-
const host = this.getHost(config);
|
|
547
|
-
const model = config?.model ?? "llama3";
|
|
548
|
-
const adapter = this.getAdapter(model, host);
|
|
549
|
-
let defaultPrompt = "Process the following request and respond appropriately. If the request asks for structured data, return valid JSON.";
|
|
550
|
-
if (config?.output) {
|
|
551
|
-
const schema = config.output.toJsonSchema();
|
|
552
|
-
const outputType = jsonSchemaToTypeString3(schema);
|
|
553
|
-
defaultPrompt += `
|
|
32
|
+
${z}`},U=[...J,N];return(await x({adapter:F,messages:U,stream:!1})).trim()}async makeShorter(z,H){let R=this.buildPrompt("Condense the following text while preserving its core meaning and key information. Remove redundancies and unnecessary details.",H);return this.executeChat(z,R,H)}async makeLonger(z,H){let R=this.buildPrompt("Expand the following text by adding relevant details, examples, and explanations while maintaining coherence and the original message.",H);return this.executeChat(z,R,H)}async summarize(z,H){let R=this.buildPrompt("Provide a clear and comprehensive summary of the following text, capturing all essential points and main ideas.",H);return this.executeChat(z,R,H)}async concise(z,H){let R=this.buildPrompt("Rewrite the following text in the most concise form possible without losing essential meaning.",H);return this.executeChat(z,R,H)}async paragraph(z,H){let R=this.buildPrompt("Transform the following text into well-structured paragraph format with clear topic sentences and logical flow.",H);return this.executeChat(z,R,H)}async bulletPoints(z,H){let R=this.buildPrompt("Convert the following text into a clear, organized list of bullet points highlighting the key information.",H);return this.executeChat(z,R,H)}async rephrase(z,H){let R=this.buildPrompt("Rephrase the following text using different words and sentence structures while preserving the original meaning.",H);return this.executeChat(z,R,H)}async simplify(z,H){let R=this.buildPrompt("Simplify the following text by using plain language, shorter sentences, and avoiding jargon. Make it accessible to a general audience.",H);return this.executeChat(z,R,H)}async changeTone(z,H,R){let D=this.buildPrompt(`Rewrite the following text in a ${H} tone while maintaining clarity.`,R);return this.executeChat(z,D,R)}async proofread(z,H){let R=this.buildPrompt("Proofread and correct the following text for grammar, spelling, punctuation, and clarity issues. Return the corrected version.",H);return this.executeChat(z,R,H)}async translate(z,H){let R=H?.language??"en",D=this.buildPrompt(`Translate the following text accurately into ${R}, preserving the original meaning, tone, and nuance.`,H);return this.executeChat(z,D,H)}async explain(z,H){let R=this.buildPrompt("Provide a clear explanation of the following text, breaking down complex concepts and clarifying the meaning.",H);return this.executeChat(z,R,H)}async expandIdeas(z,H){let R=this.buildPrompt("Expand on the ideas presented in the following text by exploring related concepts, implications, and additional perspectives.",H);return this.executeChat(z,R,H)}async fixGrammar(z,H){let R=this.buildPrompt("Fix all grammatical errors in the following text, including subject-verb agreement, tense consistency, and sentence structure.",H);return this.executeChat(z,R,H)}async generateTitle(z,H){let R=this.buildPrompt("Generate a compelling, descriptive title for the following text that captures its main theme and engages readers.",H);return this.executeChat(z,R,H)}async extractKeywords(z,H){let R=this.buildPrompt("Extract the most important keywords and key phrases from the following text. Return only the keywords as a comma-separated list without numbering, brackets, or additional formatting.",H);return(await this.executeChat(z,R,H)).split(",").map((B)=>B.trim()).filter((B)=>B.length>0)}async extractCategories(z,H){let R=this.buildPrompt("Identify the most relevant categories or topics that best describe the following text. Return only the categories as a comma-separated list without numbering, brackets, or additional formatting.",H);return(await this.executeChat(z,R,H)).split(",").map((B)=>B.trim()).filter((B)=>B.length>0)}async run(z,H){let R=this.getHost(H),D=H?.model??"llama3",B=this.getAdapter(D,R),F="Process the following request and respond appropriately. If the request asks for structured data, return valid JSON.";if(H?.output){let Q=H.output.toJsonSchema(),C=k(Q);F+=`
|
|
554
33
|
|
|
555
|
-
Output Type: ${
|
|
556
|
-
}
|
|
557
|
-
const systemPrompt = this.buildPrompt(defaultPrompt, config);
|
|
558
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
559
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
34
|
+
Output Type: ${C}`}let J=this.buildPrompt(F,H),N=H?.messages?this.toMessages(H.messages):[],U={role:"user",content:`${J}
|
|
560
35
|
|
|
561
36
|
Request:
|
|
562
|
-
${
|
|
563
|
-
const messages = [...baseMessages, userMessage];
|
|
564
|
-
const result = await chat3({
|
|
565
|
-
adapter,
|
|
566
|
-
messages,
|
|
567
|
-
stream: false
|
|
568
|
-
});
|
|
569
|
-
const trimmed = result.trim();
|
|
570
|
-
let parsed;
|
|
571
|
-
try {
|
|
572
|
-
const cleaned = trimmed.replace(/```json\n?|\n?```/g, "").trim();
|
|
573
|
-
parsed = JSON.parse(cleaned);
|
|
574
|
-
} catch {
|
|
575
|
-
parsed = trimmed;
|
|
576
|
-
}
|
|
577
|
-
if (config?.output) {
|
|
578
|
-
const validation = config.output(parsed);
|
|
579
|
-
if (validation instanceof type3.errors) {
|
|
580
|
-
throw new AiException(`Output validation failed: ${validation.summary}`);
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
return parsed;
|
|
584
|
-
}
|
|
585
|
-
async* runStream(prompt, config) {
|
|
586
|
-
const host = this.getHost(config);
|
|
587
|
-
const model = config?.model ?? "llama3";
|
|
588
|
-
const adapter = this.getAdapter(model, host);
|
|
589
|
-
const defaultPrompt = "Process the following request and respond appropriately.";
|
|
590
|
-
const systemPrompt = this.buildPrompt(defaultPrompt, config);
|
|
591
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
592
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
37
|
+
${z}`},W=[...N,U],V=(await x({adapter:B,messages:W,stream:!1})).trim(),X;try{let Q=V.replace(/```json\n?|\n?```/g,"").trim();X=JSON.parse(Q)}catch{X=V}if(H?.output){let Q=H.output(X);if(Q instanceof y.errors)throw new Y(`Output validation failed: ${Q.summary}`)}return X}async*runStream(z,H){let R=this.getHost(H),D=H?.model??"llama3",B=this.getAdapter(D,R),F="Process the following request and respond appropriately.",J=this.buildPrompt("Process the following request and respond appropriately.",H),N=H?.messages?this.toMessages(H.messages):[],U={role:"user",content:`${J}
|
|
593
38
|
|
|
594
39
|
Request:
|
|
595
|
-
${
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
adapter,
|
|
599
|
-
messages,
|
|
600
|
-
stream: true
|
|
601
|
-
});
|
|
602
|
-
for await (const chunk of stream) {
|
|
603
|
-
if (chunk.type === "content") {
|
|
604
|
-
yield chunk.content;
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
OllamaAi = __legacyDecorateClassTS([
|
|
610
|
-
decorator.ai()
|
|
611
|
-
], OllamaAi);
|
|
612
|
-
// src/OpenAi.ts
|
|
613
|
-
import { jsonSchemaToTypeString as jsonSchemaToTypeString4 } from "@ooneex/validation";
|
|
614
|
-
import { chat as chat4 } from "@tanstack/ai";
|
|
615
|
-
import { createOpenaiChat } from "@tanstack/ai-openai";
|
|
616
|
-
import { type as type4 } from "arktype";
|
|
617
|
-
class OpenAi {
|
|
618
|
-
getApiKey(config) {
|
|
619
|
-
const apiKey = config?.apiKey || Bun.env.OPENAI_API_KEY || "";
|
|
620
|
-
if (!apiKey) {
|
|
621
|
-
throw new AiException("OpenAI API key is required. Provide an API key through config options or set the OPENAI_API_KEY environment variable.");
|
|
622
|
-
}
|
|
623
|
-
return apiKey;
|
|
624
|
-
}
|
|
625
|
-
getAdapter(apiKey, model = "gpt-4o-mini") {
|
|
626
|
-
return createOpenaiChat(model, apiKey);
|
|
627
|
-
}
|
|
628
|
-
buildPrompt(instruction, config) {
|
|
629
|
-
const parts = [config?.prompt || instruction];
|
|
630
|
-
if (config?.context) {
|
|
631
|
-
parts.push(`Context:
|
|
632
|
-
${config.context}`);
|
|
633
|
-
}
|
|
634
|
-
if (config?.wordCount) {
|
|
635
|
-
parts.push(`Target approximately ${config.wordCount} words.`);
|
|
636
|
-
}
|
|
637
|
-
if (config?.tone) {
|
|
638
|
-
parts.push(`Use a ${config.tone} tone.`);
|
|
639
|
-
}
|
|
640
|
-
if (config?.language) {
|
|
641
|
-
parts.push(`Respond in ${config.language} language.`);
|
|
642
|
-
}
|
|
643
|
-
parts.push(`${config?.context ? "Use the provided context to inform your response. " : ""}Respond with only the transformed text. Do not include explanations or additional commentary.`);
|
|
644
|
-
return parts.join(`
|
|
645
|
-
`);
|
|
646
|
-
}
|
|
647
|
-
toMessages(messages) {
|
|
648
|
-
return messages.map((msg) => ({ role: msg.role, content: msg.content }));
|
|
649
|
-
}
|
|
650
|
-
async executeChat(content, systemPrompt, config) {
|
|
651
|
-
const apiKey = this.getApiKey(config);
|
|
652
|
-
const model = config?.model ?? "gpt-4o-mini";
|
|
653
|
-
const adapter = this.getAdapter(apiKey, model);
|
|
654
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
655
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
40
|
+
${z}`},W=[...N,U],Z=x({adapter:B,messages:W,stream:!0});for await(let V of Z)if(V.type==="content")yield V.content}}q=$([_.ai()],q);import{jsonSchemaToTypeString as u}from"@ooneex/validation";import{chat as O}from"@tanstack/ai";import{createOpenaiChat as d}from"@tanstack/ai-openai";import{type as m}from"arktype";class L{getApiKey(z){let H=z?.apiKey||Bun.env.OPENAI_API_KEY||"";if(!H)throw new Y("OpenAI API key is required. Provide an API key through config options or set the OPENAI_API_KEY environment variable.");return H}getAdapter(z,H="gpt-4o-mini"){return d(H,z)}buildPrompt(z,H){let R=[H?.prompt||z];if(H?.context)R.push(`Context:
|
|
41
|
+
${H.context}`);if(H?.wordCount)R.push(`Target approximately ${H.wordCount} words.`);if(H?.tone)R.push(`Use a ${H.tone} tone.`);if(H?.language)R.push(`Respond in ${H.language} language.`);return R.push(`${H?.context?"Use the provided context to inform your response. ":""}Respond with only the transformed text. Do not include explanations or additional commentary.`),R.join(`
|
|
42
|
+
`)}toMessages(z){return z.map((H)=>({role:H.role,content:H.content}))}async executeChat(z,H,R){let D=this.getApiKey(R),B=R?.model??"gpt-4o-mini",F=this.getAdapter(D,B),J=R?.messages?this.toMessages(R.messages):[],N={role:"user",content:`${H}
|
|
656
43
|
|
|
657
44
|
Text to process:
|
|
658
|
-
${
|
|
659
|
-
const messages = [...baseMessages, userMessage];
|
|
660
|
-
const result = await chat4({
|
|
661
|
-
adapter,
|
|
662
|
-
messages,
|
|
663
|
-
stream: false
|
|
664
|
-
});
|
|
665
|
-
return result.trim();
|
|
666
|
-
}
|
|
667
|
-
async makeShorter(content, config) {
|
|
668
|
-
const prompt = this.buildPrompt("Condense the following text while preserving its core meaning and key information. Remove redundancies and unnecessary details.", config);
|
|
669
|
-
return this.executeChat(content, prompt, config);
|
|
670
|
-
}
|
|
671
|
-
async makeLonger(content, config) {
|
|
672
|
-
const prompt = this.buildPrompt("Expand the following text by adding relevant details, examples, and explanations while maintaining coherence and the original message.", config);
|
|
673
|
-
return this.executeChat(content, prompt, config);
|
|
674
|
-
}
|
|
675
|
-
async summarize(content, config) {
|
|
676
|
-
const prompt = this.buildPrompt("Provide a clear and comprehensive summary of the following text, capturing all essential points and main ideas.", config);
|
|
677
|
-
return this.executeChat(content, prompt, config);
|
|
678
|
-
}
|
|
679
|
-
async concise(content, config) {
|
|
680
|
-
const prompt = this.buildPrompt("Rewrite the following text in the most concise form possible without losing essential meaning.", config);
|
|
681
|
-
return this.executeChat(content, prompt, config);
|
|
682
|
-
}
|
|
683
|
-
async paragraph(content, config) {
|
|
684
|
-
const prompt = this.buildPrompt("Transform the following text into well-structured paragraph format with clear topic sentences and logical flow.", config);
|
|
685
|
-
return this.executeChat(content, prompt, config);
|
|
686
|
-
}
|
|
687
|
-
async bulletPoints(content, config) {
|
|
688
|
-
const prompt = this.buildPrompt("Convert the following text into a clear, organized list of bullet points highlighting the key information.", config);
|
|
689
|
-
return this.executeChat(content, prompt, config);
|
|
690
|
-
}
|
|
691
|
-
async rephrase(content, config) {
|
|
692
|
-
const prompt = this.buildPrompt("Rephrase the following text using different words and sentence structures while preserving the original meaning.", config);
|
|
693
|
-
return this.executeChat(content, prompt, config);
|
|
694
|
-
}
|
|
695
|
-
async simplify(content, config) {
|
|
696
|
-
const prompt = this.buildPrompt("Simplify the following text by using plain language, shorter sentences, and avoiding jargon. Make it accessible to a general audience.", config);
|
|
697
|
-
return this.executeChat(content, prompt, config);
|
|
698
|
-
}
|
|
699
|
-
async changeTone(content, tone, config) {
|
|
700
|
-
const prompt = this.buildPrompt(`Rewrite the following text in a ${tone} tone while maintaining clarity.`, config);
|
|
701
|
-
return this.executeChat(content, prompt, config);
|
|
702
|
-
}
|
|
703
|
-
async proofread(content, config) {
|
|
704
|
-
const prompt = this.buildPrompt("Proofread and correct the following text for grammar, spelling, punctuation, and clarity issues. Return the corrected version.", config);
|
|
705
|
-
return this.executeChat(content, prompt, config);
|
|
706
|
-
}
|
|
707
|
-
async translate(content, config) {
|
|
708
|
-
const targetLanguage = config?.language ?? "en";
|
|
709
|
-
const prompt = this.buildPrompt(`Translate the following text accurately into ${targetLanguage}, preserving the original meaning, tone, and nuance.`, config);
|
|
710
|
-
return this.executeChat(content, prompt, config);
|
|
711
|
-
}
|
|
712
|
-
async explain(content, config) {
|
|
713
|
-
const prompt = this.buildPrompt("Provide a clear explanation of the following text, breaking down complex concepts and clarifying the meaning.", config);
|
|
714
|
-
return this.executeChat(content, prompt, config);
|
|
715
|
-
}
|
|
716
|
-
async expandIdeas(content, config) {
|
|
717
|
-
const prompt = this.buildPrompt("Expand on the ideas presented in the following text by exploring related concepts, implications, and additional perspectives.", config);
|
|
718
|
-
return this.executeChat(content, prompt, config);
|
|
719
|
-
}
|
|
720
|
-
async fixGrammar(content, config) {
|
|
721
|
-
const prompt = this.buildPrompt("Fix all grammatical errors in the following text, including subject-verb agreement, tense consistency, and sentence structure.", config);
|
|
722
|
-
return this.executeChat(content, prompt, config);
|
|
723
|
-
}
|
|
724
|
-
async generateTitle(content, config) {
|
|
725
|
-
const prompt = this.buildPrompt("Generate a compelling, descriptive title for the following text that captures its main theme and engages readers.", config);
|
|
726
|
-
return this.executeChat(content, prompt, config);
|
|
727
|
-
}
|
|
728
|
-
async extractKeywords(content, config) {
|
|
729
|
-
const prompt = this.buildPrompt("Extract the most important keywords and key phrases from the following text. Return only the keywords as a comma-separated list without numbering, brackets, or additional formatting.", config);
|
|
730
|
-
const result = await this.executeChat(content, prompt, config);
|
|
731
|
-
return result.split(",").map((keyword) => keyword.trim()).filter((keyword) => keyword.length > 0);
|
|
732
|
-
}
|
|
733
|
-
async extractCategories(content, config) {
|
|
734
|
-
const prompt = this.buildPrompt("Identify the most relevant categories or topics that best describe the following text. Return only the categories as a comma-separated list without numbering, brackets, or additional formatting.", config);
|
|
735
|
-
const result = await this.executeChat(content, prompt, config);
|
|
736
|
-
return result.split(",").map((category) => category.trim()).filter((category) => category.length > 0);
|
|
737
|
-
}
|
|
738
|
-
async run(prompt, config) {
|
|
739
|
-
const apiKey = this.getApiKey(config);
|
|
740
|
-
const model = config?.model ?? "gpt-4o";
|
|
741
|
-
const adapter = this.getAdapter(apiKey, model);
|
|
742
|
-
let defaultPrompt = "Process the following request and respond appropriately. If the request asks for structured data, return valid JSON.";
|
|
743
|
-
if (config?.output) {
|
|
744
|
-
const schema = config.output.toJsonSchema();
|
|
745
|
-
const outputType = jsonSchemaToTypeString4(schema);
|
|
746
|
-
defaultPrompt += `
|
|
45
|
+
${z}`},U=[...J,N];return(await O({adapter:F,messages:U,stream:!1})).trim()}async makeShorter(z,H){let R=this.buildPrompt("Condense the following text while preserving its core meaning and key information. Remove redundancies and unnecessary details.",H);return this.executeChat(z,R,H)}async makeLonger(z,H){let R=this.buildPrompt("Expand the following text by adding relevant details, examples, and explanations while maintaining coherence and the original message.",H);return this.executeChat(z,R,H)}async summarize(z,H){let R=this.buildPrompt("Provide a clear and comprehensive summary of the following text, capturing all essential points and main ideas.",H);return this.executeChat(z,R,H)}async concise(z,H){let R=this.buildPrompt("Rewrite the following text in the most concise form possible without losing essential meaning.",H);return this.executeChat(z,R,H)}async paragraph(z,H){let R=this.buildPrompt("Transform the following text into well-structured paragraph format with clear topic sentences and logical flow.",H);return this.executeChat(z,R,H)}async bulletPoints(z,H){let R=this.buildPrompt("Convert the following text into a clear, organized list of bullet points highlighting the key information.",H);return this.executeChat(z,R,H)}async rephrase(z,H){let R=this.buildPrompt("Rephrase the following text using different words and sentence structures while preserving the original meaning.",H);return this.executeChat(z,R,H)}async simplify(z,H){let R=this.buildPrompt("Simplify the following text by using plain language, shorter sentences, and avoiding jargon. Make it accessible to a general audience.",H);return this.executeChat(z,R,H)}async changeTone(z,H,R){let D=this.buildPrompt(`Rewrite the following text in a ${H} tone while maintaining clarity.`,R);return this.executeChat(z,D,R)}async proofread(z,H){let R=this.buildPrompt("Proofread and correct the following text for grammar, spelling, punctuation, and clarity issues. Return the corrected version.",H);return this.executeChat(z,R,H)}async translate(z,H){let R=H?.language??"en",D=this.buildPrompt(`Translate the following text accurately into ${R}, preserving the original meaning, tone, and nuance.`,H);return this.executeChat(z,D,H)}async explain(z,H){let R=this.buildPrompt("Provide a clear explanation of the following text, breaking down complex concepts and clarifying the meaning.",H);return this.executeChat(z,R,H)}async expandIdeas(z,H){let R=this.buildPrompt("Expand on the ideas presented in the following text by exploring related concepts, implications, and additional perspectives.",H);return this.executeChat(z,R,H)}async fixGrammar(z,H){let R=this.buildPrompt("Fix all grammatical errors in the following text, including subject-verb agreement, tense consistency, and sentence structure.",H);return this.executeChat(z,R,H)}async generateTitle(z,H){let R=this.buildPrompt("Generate a compelling, descriptive title for the following text that captures its main theme and engages readers.",H);return this.executeChat(z,R,H)}async extractKeywords(z,H){let R=this.buildPrompt("Extract the most important keywords and key phrases from the following text. Return only the keywords as a comma-separated list without numbering, brackets, or additional formatting.",H);return(await this.executeChat(z,R,H)).split(",").map((B)=>B.trim()).filter((B)=>B.length>0)}async extractCategories(z,H){let R=this.buildPrompt("Identify the most relevant categories or topics that best describe the following text. Return only the categories as a comma-separated list without numbering, brackets, or additional formatting.",H);return(await this.executeChat(z,R,H)).split(",").map((B)=>B.trim()).filter((B)=>B.length>0)}async run(z,H){let R=this.getApiKey(H),D=H?.model??"gpt-4o",B=this.getAdapter(R,D),F="Process the following request and respond appropriately. If the request asks for structured data, return valid JSON.";if(H?.output){let Q=H.output.toJsonSchema(),C=u(Q);F+=`
|
|
747
46
|
|
|
748
|
-
Output Type: ${
|
|
749
|
-
}
|
|
750
|
-
const systemPrompt = this.buildPrompt(defaultPrompt, config);
|
|
751
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
752
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
47
|
+
Output Type: ${C}`}let J=this.buildPrompt(F,H),N=H?.messages?this.toMessages(H.messages):[],U={role:"user",content:`${J}
|
|
753
48
|
|
|
754
49
|
Request:
|
|
755
|
-
${
|
|
756
|
-
const messages = [...baseMessages, userMessage];
|
|
757
|
-
const result = await chat4({
|
|
758
|
-
adapter,
|
|
759
|
-
messages,
|
|
760
|
-
stream: false
|
|
761
|
-
});
|
|
762
|
-
const trimmed = result.trim();
|
|
763
|
-
let parsed;
|
|
764
|
-
try {
|
|
765
|
-
const cleaned = trimmed.replace(/```json\n?|\n?```/g, "").trim();
|
|
766
|
-
parsed = JSON.parse(cleaned);
|
|
767
|
-
} catch {
|
|
768
|
-
parsed = trimmed;
|
|
769
|
-
}
|
|
770
|
-
if (config?.output) {
|
|
771
|
-
const validation = config.output(parsed);
|
|
772
|
-
if (validation instanceof type4.errors) {
|
|
773
|
-
throw new AiException(`Output validation failed: ${validation.summary}`);
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
return parsed;
|
|
777
|
-
}
|
|
778
|
-
async* runStream(prompt, config) {
|
|
779
|
-
const apiKey = this.getApiKey(config);
|
|
780
|
-
const model = config?.model ?? "gpt-4o";
|
|
781
|
-
const adapter = this.getAdapter(apiKey, model);
|
|
782
|
-
const defaultPrompt = "Process the following request and respond appropriately.";
|
|
783
|
-
const systemPrompt = this.buildPrompt(defaultPrompt, config);
|
|
784
|
-
const baseMessages = config?.messages ? this.toMessages(config.messages) : [];
|
|
785
|
-
const userMessage = { role: "user", content: `${systemPrompt}
|
|
50
|
+
${z}`},W=[...N,U],V=(await O({adapter:B,messages:W,stream:!1})).trim(),X;try{let Q=V.replace(/```json\n?|\n?```/g,"").trim();X=JSON.parse(Q)}catch{X=V}if(H?.output){let Q=H.output(X);if(Q instanceof m.errors)throw new Y(`Output validation failed: ${Q.summary}`)}return X}async*runStream(z,H){let R=this.getApiKey(H),D=H?.model??"gpt-4o",B=this.getAdapter(R,D),F="Process the following request and respond appropriately.",J=this.buildPrompt("Process the following request and respond appropriately.",H),N=H?.messages?this.toMessages(H.messages):[],U={role:"user",content:`${J}
|
|
786
51
|
|
|
787
52
|
Request:
|
|
788
|
-
${
|
|
789
|
-
const messages = [...baseMessages, userMessage];
|
|
790
|
-
const stream = chat4({
|
|
791
|
-
adapter,
|
|
792
|
-
messages,
|
|
793
|
-
stream: true
|
|
794
|
-
});
|
|
795
|
-
for await (const chunk of stream) {
|
|
796
|
-
if (chunk.type === "content") {
|
|
797
|
-
yield chunk.content;
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
OpenAi = __legacyDecorateClassTS([
|
|
803
|
-
decorator.ai()
|
|
804
|
-
], OpenAi);
|
|
805
|
-
export {
|
|
806
|
-
decorator,
|
|
807
|
-
OpenAi,
|
|
808
|
-
OllamaAi,
|
|
809
|
-
GeminiAi,
|
|
810
|
-
AnthropicAi,
|
|
811
|
-
AiException
|
|
812
|
-
};
|
|
53
|
+
${z}`},W=[...N,U],Z=O({adapter:B,messages:W,stream:!0});for await(let V of Z)if(V.type==="content")yield V.content}}L=$([_.ai()],L);export{_ as decorator,L as OpenAi,q as OllamaAi,j as GeminiAi,I as AnthropicAi,Y as AiException};
|
|
813
54
|
|
|
814
|
-
//# debugId=
|
|
55
|
+
//# debugId=66CB2B945DCDCB8864756E2164756E21
|
package/dist/index.js.map
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"import { jsonSchemaToTypeString } from \"@ooneex/validation\";\nimport { chat, type ModelMessage } from \"@tanstack/ai\";\nimport { createOllamaChat } from \"@tanstack/ai-ollama\";\nimport { type } from \"arktype\";\nimport { AiException } from \"./AiException\";\nimport { decorator } from \"./decorators\";\nimport type { AiMessageType, AiToneType, IAiChat, OllamaConfigType, OllamaModelType } from \"./types\";\n\n@decorator.ai()\nexport class OllamaAi implements IAiChat<OllamaConfigType> {\n private getHost(config?: OllamaConfigType): string {\n return config?.host || Bun.env.OLLAMA_HOST || \"http://localhost:11434\";\n }\n\n private getAdapter(model: OllamaModelType = \"llama3\", host?: string) {\n return createOllamaChat(model, host);\n }\n\n private buildPrompt(instruction: string, config?: OllamaConfigType): string {\n const parts: string[] = [config?.prompt || instruction];\n\n if (config?.context) {\n parts.push(`Context:\\n${config.context}`);\n }\n\n if (config?.wordCount) {\n parts.push(`Target approximately ${config.wordCount} words.`);\n }\n\n if (config?.tone) {\n parts.push(`Use a ${config.tone} tone.`);\n }\n\n if (config?.language) {\n parts.push(`Respond in ${config.language} language.`);\n }\n\n parts.push(\n `${config?.context ? \"Use the provided context to inform your response. \" : \"\"}Respond with only the transformed text. Do not include explanations or additional commentary.`,\n );\n\n return parts.join(\"\\n\");\n }\n\n private toMessages(messages: AiMessageType[]): ModelMessage[] {\n return messages.map((msg) => ({ role: msg.role as \"user\" | \"assistant\" | \"tool\", content: msg.content }));\n }\n\n private async executeChat(content: string, systemPrompt: string, config?: OllamaConfigType): Promise<string> {\n const host = this.getHost(config);\n const model = config?.model ?? \"llama3\";\n const adapter = this.getAdapter(model, host);\n\n const baseMessages: ModelMessage[] = config?.messages ? this.toMessages(config.messages) : [];\n const userMessage: ModelMessage = { role: \"user\", content: `${systemPrompt}\\n\\nText to process:\\n${content}` };\n\n const messages = [...baseMessages, userMessage];\n const result = await chat({\n adapter,\n messages: messages as unknown as NonNullable<\n Parameters<typeof chat<typeof adapter, undefined, false>>[0][\"messages\"]\n >,\n stream: false,\n });\n\n return result.trim();\n }\n\n public async makeShorter(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Condense the following text while preserving its core meaning and key information. Remove redundancies and unnecessary details.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async makeLonger(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Expand the following text by adding relevant details, examples, and explanations while maintaining coherence and the original message.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async summarize(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Provide a clear and comprehensive summary of the following text, capturing all essential points and main ideas.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async concise(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Rewrite the following text in the most concise form possible without losing essential meaning.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async paragraph(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Transform the following text into well-structured paragraph format with clear topic sentences and logical flow.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async bulletPoints(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Convert the following text into a clear, organized list of bullet points highlighting the key information.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async rephrase(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Rephrase the following text using different words and sentence structures while preserving the original meaning.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async simplify(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Simplify the following text by using plain language, shorter sentences, and avoiding jargon. Make it accessible to a general audience.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async changeTone(\n content: string,\n tone: AiToneType,\n config?: Omit<OllamaConfigType, \"tone\" | \"output\">,\n ): Promise<string> {\n const prompt = this.buildPrompt(`Rewrite the following text in a ${tone} tone while maintaining clarity.`, config);\n return this.executeChat(content, prompt, config);\n }\n\n public async proofread(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Proofread and correct the following text for grammar, spelling, punctuation, and clarity issues. Return the corrected version.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async translate(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const targetLanguage = config?.language ?? \"en\";\n const prompt = this.buildPrompt(\n `Translate the following text accurately into ${targetLanguage}, preserving the original meaning, tone, and nuance.`,\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async explain(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Provide a clear explanation of the following text, breaking down complex concepts and clarifying the meaning.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async expandIdeas(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Expand on the ideas presented in the following text by exploring related concepts, implications, and additional perspectives.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async fixGrammar(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Fix all grammatical errors in the following text, including subject-verb agreement, tense consistency, and sentence structure.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async generateTitle(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Generate a compelling, descriptive title for the following text that captures its main theme and engages readers.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async extractKeywords(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string[]> {\n const prompt = this.buildPrompt(\n \"Extract the most important keywords and key phrases from the following text. Return only the keywords as a comma-separated list without numbering, brackets, or additional formatting.\",\n config,\n );\n\n const result = await this.executeChat(content, prompt, config);\n\n return result\n .split(\",\")\n .map((keyword) => keyword.trim())\n .filter((keyword) => keyword.length > 0);\n }\n\n public async extractCategories(content: string, config?: Omit<OllamaConfigType, \"output\">): Promise<string[]> {\n const prompt = this.buildPrompt(\n \"Identify the most relevant categories or topics that best describe the following text. Return only the categories as a comma-separated list without numbering, brackets, or additional formatting.\",\n config,\n );\n\n const result = await this.executeChat(content, prompt, config);\n\n return result\n .split(\",\")\n .map((category) => category.trim())\n .filter((category) => category.length > 0);\n }\n\n public async run<T>(prompt: string, config?: Omit<OllamaConfigType, \"prompt\">): Promise<T> {\n const host = this.getHost(config);\n const model = config?.model ?? \"llama3\";\n const adapter = this.getAdapter(model, host);\n\n let defaultPrompt =\n \"Process the following request and respond appropriately. If the request asks for structured data, return valid JSON.\";\n\n if (config?.output) {\n const schema = config.output.toJsonSchema();\n const outputType = jsonSchemaToTypeString(schema);\n defaultPrompt += `\\n\\nOutput Type: ${outputType}`;\n }\n\n const systemPrompt = this.buildPrompt(defaultPrompt, config);\n\n const baseMessages = config?.messages ? this.toMessages(config.messages) : [];\n const userMessage: ModelMessage = { role: \"user\", content: `${systemPrompt}\\n\\nRequest:\\n${prompt}` };\n\n const messages = [...baseMessages, userMessage];\n const result = await chat({\n adapter,\n messages: messages as unknown as NonNullable<\n Parameters<typeof chat<typeof adapter, undefined, false>>[0][\"messages\"]\n >,\n stream: false,\n });\n\n const trimmed = result.trim();\n\n let parsed: T;\n try {\n const cleaned = trimmed.replace(/```json\\n?|\\n?```/g, \"\").trim();\n parsed = JSON.parse(cleaned) as T;\n } catch {\n parsed = trimmed as T;\n }\n\n if (config?.output) {\n const validation = config.output(parsed);\n if (validation instanceof type.errors) {\n throw new AiException(`Output validation failed: ${validation.summary}`);\n }\n }\n\n return parsed;\n }\n\n /**\n * Streams the AI response chunk by chunk as an async generator.\n *\n * @example\n * ```ts\n * const adapter = new OllamaChatAdapter();\n *\n * // Stream the response chunk by chunk\n * for await (const chunk of adapter.runStream(\"Explain quantum computing\")) {\n * process.stdout.write(chunk); // Print each chunk as it arrives\n * }\n * ```\n */\n public async *runStream(\n prompt: string,\n config?: Omit<OllamaConfigType, \"prompt\" | \"output\">,\n ): AsyncGenerator<string, void, unknown> {\n const host = this.getHost(config);\n const model = config?.model ?? \"llama3\";\n const adapter = this.getAdapter(model, host);\n\n const defaultPrompt = \"Process the following request and respond appropriately.\";\n const systemPrompt = this.buildPrompt(defaultPrompt, config);\n\n const baseMessages: ModelMessage[] = config?.messages ? this.toMessages(config.messages) : [];\n const userMessage: ModelMessage = { role: \"user\", content: `${systemPrompt}\\n\\nRequest:\\n${prompt}` };\n\n const messages = [...baseMessages, userMessage];\n const stream = chat({\n adapter,\n messages: messages as unknown as NonNullable<\n Parameters<typeof chat<typeof adapter, undefined, true>>[0][\"messages\"]\n >,\n stream: true,\n });\n\n for await (const chunk of stream) {\n if (chunk.type === \"content\") {\n yield chunk.content;\n }\n }\n }\n}\n",
|
|
10
10
|
"import { jsonSchemaToTypeString } from \"@ooneex/validation\";\nimport { chat, type ModelMessage } from \"@tanstack/ai\";\nimport { createOpenaiChat } from \"@tanstack/ai-openai\";\nimport { type } from \"arktype\";\nimport { AiException } from \"./AiException\";\nimport { decorator } from \"./decorators\";\nimport type { AiMessageType, AiToneType, IAiChat, OpenAiConfigType, OpenAiModelType } from \"./types\";\n\n@decorator.ai()\nexport class OpenAi implements IAiChat<OpenAiConfigType> {\n private getApiKey(config?: OpenAiConfigType): string {\n const apiKey = config?.apiKey || Bun.env.OPENAI_API_KEY || \"\";\n\n if (!apiKey) {\n throw new AiException(\n \"OpenAI API key is required. Provide an API key through config options or set the OPENAI_API_KEY environment variable.\",\n );\n }\n\n return apiKey;\n }\n\n private getAdapter(apiKey: string, model: OpenAiModelType = \"gpt-4o-mini\") {\n return createOpenaiChat(model, apiKey);\n }\n\n private buildPrompt(instruction: string, config?: OpenAiConfigType): string {\n const parts: string[] = [config?.prompt || instruction];\n\n if (config?.context) {\n parts.push(`Context:\\n${config.context}`);\n }\n\n if (config?.wordCount) {\n parts.push(`Target approximately ${config.wordCount} words.`);\n }\n\n if (config?.tone) {\n parts.push(`Use a ${config.tone} tone.`);\n }\n\n if (config?.language) {\n parts.push(`Respond in ${config.language} language.`);\n }\n\n parts.push(\n `${config?.context ? \"Use the provided context to inform your response. \" : \"\"}Respond with only the transformed text. Do not include explanations or additional commentary.`,\n );\n\n return parts.join(\"\\n\");\n }\n\n private toMessages(messages: AiMessageType[]): ModelMessage[] {\n return messages.map((msg) => ({ role: msg.role as \"user\" | \"assistant\" | \"tool\", content: msg.content }));\n }\n\n private async executeChat(content: string, systemPrompt: string, config?: OpenAiConfigType): Promise<string> {\n const apiKey = this.getApiKey(config);\n const model = config?.model ?? \"gpt-4o-mini\";\n const adapter = this.getAdapter(apiKey, model);\n\n const baseMessages: ModelMessage[] = config?.messages ? this.toMessages(config.messages) : [];\n const userMessage: ModelMessage = { role: \"user\", content: `${systemPrompt}\\n\\nText to process:\\n${content}` };\n\n const messages = [...baseMessages, userMessage];\n const result = await chat({\n adapter,\n messages: messages as unknown as NonNullable<\n Parameters<typeof chat<typeof adapter, undefined, false>>[0][\"messages\"]\n >,\n stream: false,\n });\n\n return result.trim();\n }\n\n public async makeShorter(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Condense the following text while preserving its core meaning and key information. Remove redundancies and unnecessary details.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async makeLonger(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Expand the following text by adding relevant details, examples, and explanations while maintaining coherence and the original message.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async summarize(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Provide a clear and comprehensive summary of the following text, capturing all essential points and main ideas.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async concise(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Rewrite the following text in the most concise form possible without losing essential meaning.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async paragraph(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Transform the following text into well-structured paragraph format with clear topic sentences and logical flow.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async bulletPoints(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Convert the following text into a clear, organized list of bullet points highlighting the key information.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async rephrase(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Rephrase the following text using different words and sentence structures while preserving the original meaning.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async simplify(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Simplify the following text by using plain language, shorter sentences, and avoiding jargon. Make it accessible to a general audience.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async changeTone(\n content: string,\n tone: AiToneType,\n config?: Omit<OpenAiConfigType, \"tone\" | \"output\">,\n ): Promise<string> {\n const prompt = this.buildPrompt(`Rewrite the following text in a ${tone} tone while maintaining clarity.`, config);\n return this.executeChat(content, prompt, config);\n }\n\n public async proofread(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Proofread and correct the following text for grammar, spelling, punctuation, and clarity issues. Return the corrected version.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async translate(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const targetLanguage = config?.language ?? \"en\";\n const prompt = this.buildPrompt(\n `Translate the following text accurately into ${targetLanguage}, preserving the original meaning, tone, and nuance.`,\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async explain(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Provide a clear explanation of the following text, breaking down complex concepts and clarifying the meaning.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async expandIdeas(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Expand on the ideas presented in the following text by exploring related concepts, implications, and additional perspectives.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async fixGrammar(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Fix all grammatical errors in the following text, including subject-verb agreement, tense consistency, and sentence structure.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async generateTitle(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string> {\n const prompt = this.buildPrompt(\n \"Generate a compelling, descriptive title for the following text that captures its main theme and engages readers.\",\n config,\n );\n return this.executeChat(content, prompt, config);\n }\n\n public async extractKeywords(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string[]> {\n const prompt = this.buildPrompt(\n \"Extract the most important keywords and key phrases from the following text. Return only the keywords as a comma-separated list without numbering, brackets, or additional formatting.\",\n config,\n );\n\n const result = await this.executeChat(content, prompt, config);\n\n return result\n .split(\",\")\n .map((keyword) => keyword.trim())\n .filter((keyword) => keyword.length > 0);\n }\n\n public async extractCategories(content: string, config?: Omit<OpenAiConfigType, \"output\">): Promise<string[]> {\n const prompt = this.buildPrompt(\n \"Identify the most relevant categories or topics that best describe the following text. Return only the categories as a comma-separated list without numbering, brackets, or additional formatting.\",\n config,\n );\n\n const result = await this.executeChat(content, prompt, config);\n\n return result\n .split(\",\")\n .map((category) => category.trim())\n .filter((category) => category.length > 0);\n }\n\n public async run<T>(prompt: string, config?: Omit<OpenAiConfigType, \"prompt\">): Promise<T> {\n const apiKey = this.getApiKey(config);\n const model = config?.model ?? \"gpt-4o\";\n const adapter = this.getAdapter(apiKey, model);\n\n let defaultPrompt =\n \"Process the following request and respond appropriately. If the request asks for structured data, return valid JSON.\";\n\n if (config?.output) {\n const schema = config.output.toJsonSchema();\n const outputType = jsonSchemaToTypeString(schema);\n defaultPrompt += `\\n\\nOutput Type: ${outputType}`;\n }\n\n const systemPrompt = this.buildPrompt(defaultPrompt, config);\n\n const baseMessages = config?.messages ? this.toMessages(config.messages) : [];\n const userMessage: ModelMessage = { role: \"user\", content: `${systemPrompt}\\n\\nRequest:\\n${prompt}` };\n\n const messages = [...baseMessages, userMessage];\n const result = await chat({\n adapter,\n messages: messages as unknown as NonNullable<\n Parameters<typeof chat<typeof adapter, undefined, false>>[0][\"messages\"]\n >,\n stream: false,\n });\n\n const trimmed = result.trim();\n\n let parsed: T;\n try {\n const cleaned = trimmed.replace(/```json\\n?|\\n?```/g, \"\").trim();\n parsed = JSON.parse(cleaned) as T;\n } catch {\n parsed = trimmed as T;\n }\n\n if (config?.output) {\n const validation = config.output(parsed);\n if (validation instanceof type.errors) {\n throw new AiException(`Output validation failed: ${validation.summary}`);\n }\n }\n\n return parsed;\n }\n\n /**\n * Streams the AI response chunk by chunk as an async generator.\n *\n * @example\n * ```ts\n * const adapter = new OpenAiAdapter();\n *\n * // Stream the response chunk by chunk\n * for await (const chunk of adapter.runStream(\"Explain quantum computing\")) {\n * process.stdout.write(chunk); // Print each chunk as it arrives\n * }\n * ```\n */\n public async *runStream(\n prompt: string,\n config?: Omit<OpenAiConfigType, \"prompt\" | \"output\">,\n ): AsyncGenerator<string, void, unknown> {\n const apiKey = this.getApiKey(config);\n const model = config?.model ?? \"gpt-4o\";\n const adapter = this.getAdapter(apiKey, model);\n\n const defaultPrompt = \"Process the following request and respond appropriately.\";\n const systemPrompt = this.buildPrompt(defaultPrompt, config);\n\n const baseMessages: ModelMessage[] = config?.messages ? this.toMessages(config.messages) : [];\n const userMessage: ModelMessage = { role: \"user\", content: `${systemPrompt}\\n\\nRequest:\\n${prompt}` };\n\n const messages = [...baseMessages, userMessage];\n const stream = chat({\n adapter,\n messages: messages as unknown as NonNullable<\n Parameters<typeof chat<typeof adapter, undefined, true>>[0][\"messages\"]\n >,\n stream: true,\n });\n\n for await (const chunk of stream) {\n if (chunk.type === \"content\") {\n yield chunk.content;\n }\n }\n }\n}\n"
|
|
11
11
|
],
|
|
12
|
-
"mappings": ";;;;;;;;;;;;AAAA;AACA;AAAA;AAEO,MAAM,oBAAoB,UAAU;AAAA,EACzC,WAAW,CAAC,SAAiB,OAAgC,CAAC,GAAG;AAAA,IAC/D,MAAM,SAAS;AAAA,MACb,QAAQ,WAAW,KAAK;AAAA,MACxB;AAAA,IACF,CAAC;AAAA,IACD,KAAK,OAAO;AAAA;AAEhB;;ACXA;AACA;AACA;AACA;;;ACHA;AAGO,IAAM,YAAY;AAAA,EACvB,IAAI,CAAC,QA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|
|
1
1
|
{
|
|
2
2
|
"name": "@ooneex/ai",
|
|
3
3
|
"description": "Unified AI client library with support for OpenAI, Anthropic, Google Gemini, and Ollama providers",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"test": "bun test tests"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ooneex/container": "0.0.
|
|
32
|
-
"@ooneex/exception": "0.0.
|
|
33
|
-
"@ooneex/http-status": "0.0.
|
|
34
|
-
"@ooneex/validation": "0.0.
|
|
31
|
+
"@ooneex/container": "0.0.14",
|
|
32
|
+
"@ooneex/exception": "0.0.13",
|
|
33
|
+
"@ooneex/http-status": "0.0.13",
|
|
34
|
+
"@ooneex/validation": "0.0.13",
|
|
35
35
|
"@tanstack/ai": "^0.2.0",
|
|
36
36
|
"@tanstack/ai-anthropic": "^0.2.0",
|
|
37
37
|
"@tanstack/ai-gemini": "^0.2.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@tanstack/ai-openai": "^0.2.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@ooneex/translation": "0.0.
|
|
42
|
+
"@ooneex/translation": "0.0.13"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
45
|
"ai",
|