@codebam/cf-workers-telegram-bot 12.6.16 → 12.6.17

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/ai.js CHANGED
@@ -79,7 +79,7 @@ input, config) {
79
79
  return `- Name: ${t.name}\n Description: ${t.description}\n Parameters: ${JSON.stringify(t.parameters)}`;
80
80
  })
81
81
  .join('\n');
82
- const promptInstruction = `\n\n[SYSTEM INSTRUCTION] You have access to the following tools:\n${toolInstructions}\n\nTo use a tool, you MUST output a tool call wrapped in XML format, like so:\n<tool_call>{"name": "search", "arguments": {"q": "query" }}</tool_call>\nor\n<tool_call>{"name": "fetch", "arguments": {"url": "https://example.com" }}</tool_call>\n\nMake sure the tool call is outputted EXACTLY as shown. The system will intercept this call, execute the tool, and return the output to you. Do not write code or direct the user to run code; call the tools yourself.`;
82
+ const promptInstruction = `\n\n[SYSTEM INSTRUCTION] You have access to the following tools:\n${toolInstructions}\n\nTo use a tool, you MUST output a tool call wrapped in XML format, like so:\n<tool_call>{"name": "search", "arguments": {"query": "query" }}</tool_call>\nor\n<tool_call>{"name": "fetch", "arguments": {"url": "https://example.com" }}</tool_call>\n\nMake sure the tool call is outputted EXACTLY as shown. The system will intercept this call, execute the tool, and return the output to you. Do not write code or direct the user to run code; call the tools yourself.`;
83
83
  systemMsg.content = systemMsg.content + promptInstruction;
84
84
  }
85
85
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
package/dist/utils.d.ts CHANGED
@@ -45,7 +45,8 @@ export declare const searchTool: {
45
45
  };
46
46
  required: string[];
47
47
  };
48
- function: ({ query }: {
49
- query: string;
48
+ function: (args: {
49
+ query?: string;
50
+ q?: string;
50
51
  }) => Promise<string>;
51
52
  };
package/dist/utils.js CHANGED
@@ -132,7 +132,8 @@ export const searchTool = {
132
132
  },
133
133
  required: ['query'],
134
134
  },
135
- function: async ({ query }) => {
135
+ function: async (args) => {
136
+ const query = args.query || args.q || '';
136
137
  const instances = [
137
138
  'https://searxng.site/',
138
139
  'https://priv.au/',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebam/cf-workers-telegram-bot",
3
- "version": "12.6.16",
3
+ "version": "12.6.17",
4
4
  "description": "serverless telegram bot on cf workers",
5
5
  "main": "./dist/main.js",
6
6
  "module": "./dist/main.js",