pref: change the database type to SQLite

This commit is contained in:
LIlGG
2025-09-25 15:24:13 +08:00
parent 1f4fb103e9
commit 530dfac665
16 changed files with 513 additions and 311 deletions

View File

@@ -80,7 +80,7 @@ ${Object.entries(context)
return _streamText({
model,
tools,
tools: tools(),
system: systemPrompt,
maxOutputTokens: maxTokens || MAX_TOKENS,
messages: convertToModelMessages(messages),

View File

@@ -1,9 +1,17 @@
import type { Tool, ToolSet } from 'ai';
import { serperTool } from './serper';
import { weatherTool } from './weather';
export const tools = {
serper: serperTool,
weather: weatherTool,
};
export const tools: () => ToolSet = () => {
const tools: Record<string, Tool> = {};
export { serperTool, weatherTool };
if (process.env.SERPER_API_KEY) {
tools.serper = serperTool;
}
if (process.env.WEATHER_API_KEY) {
tools.weather = weatherTool;
}
return tools;
};