Refactor CLI input handling to ensure userText is passed correctly and improve output formatting in cli.js. Update package.json and package-lock.json to include 'exa-js' dependency for enhanced functionality. Revise systemprompt.txt to clarify tool usage and streamline instructions.

This commit is contained in:
sebseb7
2025-08-12 03:38:23 +00:00
parent ce6933377a
commit 70fe6fccdb
6 changed files with 116 additions and 15 deletions

29
tools/websearch.js Normal file
View File

@@ -0,0 +1,29 @@
import Exa from "exa-js";
const exa = new Exa("1513ba88-5280-402b-9da3-e060d38f96d8");
export default {
type: 'function',
name: 'websearch',
description: 'Perform a google web search.',
strict: true,
parameters: {
type: 'object',
required: ['query'],
additionalProperties: false,
properties: {
query: { type: 'string', description: 'The search query.' }
}
}
};
export async function run(args) {
try
{
console.log('Google search: ', args.query);
const result = await exa.search( args.query,{ type: "auto", userLocation: "DE", numResults: 20} );
console.log('Google search result: ', result.results[0]);
return result;
} catch (error) {
return `websearch error: ${error?.message || String(error)}`;
}
}