refactor: repartition server-side and client-side code
This commit is contained in:
17
app/.server/llm/tools/index.ts
Normal file
17
app/.server/llm/tools/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { Tool, ToolSet } from 'ai';
|
||||
import { serperTool } from './serper';
|
||||
import { weatherTool } from './weather';
|
||||
|
||||
export const tools: () => ToolSet = () => {
|
||||
const tools: Record<string, Tool> = {};
|
||||
|
||||
if (process.env.SERPER_API_KEY) {
|
||||
tools.serper = serperTool;
|
||||
}
|
||||
|
||||
if (process.env.WEATHER_API_KEY) {
|
||||
tools.weather = weatherTool;
|
||||
}
|
||||
|
||||
return tools;
|
||||
};
|
||||
Reference in New Issue
Block a user