@ducci/jarvis 1.0.61 → 1.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/server/tools.js +4 -0
package/package.json
CHANGED
package/src/server/tools.js
CHANGED
|
@@ -161,6 +161,7 @@ const SEED_TOOLS = {
|
|
|
161
161
|
`,
|
|
162
162
|
},
|
|
163
163
|
perplexity_search: {
|
|
164
|
+
requires: 'PERPLEXITY_API_KEY',
|
|
164
165
|
definition: {
|
|
165
166
|
type: 'function',
|
|
166
167
|
function: {
|
|
@@ -695,6 +696,9 @@ export async function loadTools() {
|
|
|
695
696
|
export function getToolDefinitions(tools) {
|
|
696
697
|
const defs = [];
|
|
697
698
|
for (const [name, t] of Object.entries(tools)) {
|
|
699
|
+
if (t.requires && !process.env[t.requires]) {
|
|
700
|
+
continue;
|
|
701
|
+
}
|
|
698
702
|
const params = t.definition?.function?.parameters;
|
|
699
703
|
if (typeof params !== 'object' || params === null || Array.isArray(params)) {
|
|
700
704
|
console.warn(`[tools] Skipping tool '${name}': parameters is not a valid object (got ${typeof params})`);
|