kbot tests:tools :)

This commit is contained in:
lovebird 2025-04-02 21:29:46 +02:00
parent e51e8a5b7b
commit 48c7d9627d
19 changed files with 8323 additions and 46 deletions

File diff suppressed because one or more lines are too long

View File

@ -3,9 +3,9 @@ export declare const get_var: (key?: string) => string;
export declare const HOME: (sub?: string) => string;
export declare const PREFERENCES_DEFAULT: (key?: string) => string;
export declare const E_Filters: z.ZodEnum<z.Writeable<any>>;
export declare const RouterTypeSchema: z.ZodEnum<["openrouter", "openai", "deepseek", "huggingface", "ollama", "fireworks", "gemini", "xai"]>;
export type RouterType = z.infer<typeof RouterTypeSchema>;
export declare const EMode: {
export declare const E_RouterTypeSchema: z.ZodEnum<["openrouter", "openai", "deepseek", "huggingface", "ollama", "fireworks", "gemini", "xai"]>;
export type E_RouterType = z.infer<typeof E_RouterTypeSchema>;
export declare const E_Mode: {
readonly COMPLETION: "completion";
readonly TOOLS: "tools";
readonly ASSISTANT: "assistant";

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,122 @@
[
{
"level": "debug",
"message": "It seems I need to read the file content in order to analyze and solve the equations. Could you please provide the content, or do you want me to repeat the file reading request?",
"timestamp": "2025-04-02T19:20:15.799Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "Here is the read data in JSON format:\n\n```json\n{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:20:14.746Z\"}\n```",
"timestamp": "2025-04-02T19:20:19.806Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "Please specify the the JSON format you want the results in.",
"timestamp": "2025-04-02T19:22:06.721Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "Here's the data read from the file:\n\n```json\n{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:22:06.737Z\"}\n```",
"timestamp": "2025-04-02T19:22:12.603Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "The list of files in the directory is not immediately available. I will attempt to retrieve it again.",
"timestamp": "2025-04-02T19:22:16.557Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "It seems there is an issue retrieving the list of files. Please ensure the directory path is correct and accessible. If you have any other requests, feel free to let me know!",
"timestamp": "2025-04-02T19:22:17.892Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "I attempted to read the file but it seems there might be an access issue or the file does not exist. Could you please check the file path or provide access details?",
"timestamp": "2025-04-02T19:23:59.200Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "```json\n{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:23:59.217Z\"}\n```",
"timestamp": "2025-04-02T19:24:04.104Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "I cannot assist with seeking content from your files.",
"timestamp": "2025-04-02T19:24:07.311Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "It seems that I don't have automatic access to read files from your system. I can guide you on how to get the content of the file or you can paste the equations here, and I can help you solve them. What would you prefer?",
"timestamp": "2025-04-02T19:24:28.979Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "It seems there was a repeated request for the file's content. To ensure consistency, here is the decoded data from the last correct read attempt:\n\n```json\n{\n \"test\": \"data\",\n \"timestamp\": \"2025-04-02T19:24:28.994Z\"\n}\n```",
"timestamp": "2025-04-02T19:24:42.728Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "I am unable to list the files in the directory `C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data`. Please verify that the directory path is correct and accessible.",
"timestamp": "2025-04-02T19:24:53.673Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "It seems like the file is not accessible at the moment. Please ensure the file path is correct or try again later.",
"timestamp": "2025-04-02T19:25:35.195Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:25:35.210Z\"}",
"timestamp": "2025-04-02T19:25:40.294Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "It seems I attempted to read a file from your local system but encountered an issue as I don't have direct access to files on your device. Please open the file and paste the equations here, and I'll be happy to help you solve them!",
"timestamp": "2025-04-02T19:27:27.666Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}",
"timestamp": "2025-04-02T19:27:32.431Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "I am unable to access the directory. Please make sure that the directory path is correct and accessible, or check if there are any permission restrictions. If you have any specific questions or need further assistance, please let me know!",
"timestamp": "2025-04-02T19:27:43.105Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "I cannot directly access the file as it's on a local system. You can provide its contents, and I'll assist you in solving the equations.",
"timestamp": "2025-04-02T19:29:20.983Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}",
"timestamp": "2025-04-02T19:29:28.238Z",
"service": "collector:onContent"
},
{
"level": "debug",
"message": "{\"files\":[]}",
"timestamp": "2025-04-02T19:29:30.520Z",
"service": "collector:onContent"
}
]

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,207 @@
{
"model": "deepseek/deepseek-r1-distill-qwen-14b:free",
"model": "openai/gpt-4o",
"messages": [
{
"role": "user",
"content": "Generate 5 SEO keywords for this text: \"Machine learning algorithms use statistical methods to enable computers to learn from data and improve their performance over time without being explicitly programmed.\" Return only the keywords separated by commas, no explanation."
"content": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
{
"role": "user",
"content": "USER Preferences : # Preferences\r\n\r\nYou are a helpful AI assistant. When asked to perform calculations, you should return only the numerical result without any explanation or comments. "
}
],
"tools": []
"tools": [
{
"type": "function",
"function": {
"name": "list_files",
"description": "List all files in a directory",
"parameters": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"pattern": {
"type": "string",
"optional": true
}
},
"required": [
"directory"
]
}
}
},
{
"type": "function",
"function": {
"name": "read_files",
"description": "Reads files in a directory with a given pattern",
"parameters": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"pattern": {
"type": "string",
"optional": true
}
},
"required": [
"directory"
]
}
}
},
{
"type": "function",
"function": {
"name": "remove_file",
"description": "Remove a file at given path",
"parameters": {
"type": "object",
"properties": {
"path": {
"type": "string"
}
},
"required": [
"path"
]
}
}
},
{
"type": "function",
"function": {
"name": "rename_file",
"description": "Rename or move a file or directory",
"parameters": {
"type": "object",
"properties": {
"src": {
"type": "string"
},
"dst": {
"type": "string"
}
},
"required": [
"path"
]
}
}
},
{
"type": "function",
"function": {
"name": "modify_project_files",
"description": "Create or modify existing project files in one shot, preferably used for creating project structure)",
"parameters": {
"type": "object",
"properties": {
"files": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"content": {
"type": "string",
"description": "base64 encoded string"
}
},
"required": [
"path",
"content"
]
}
}
},
"required": [
"files"
]
}
}
},
{
"type": "function",
"function": {
"name": "write_file",
"description": "Writes to a file, given a path and content (base64). No directory or file exists check needed!",
"parameters": {
"type": "object",
"properties": {
"file": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"content": {
"type": "string",
"description": "base64 encoded string"
}
}
}
},
"required": [
"file"
]
}
}
},
{
"type": "function",
"function": {
"name": "file_exists",
"description": "check if a file or folder exists",
"parameters": {
"type": "object",
"properties": {
"file": {
"type": "object",
"properties": {
"path": {
"type": "string"
}
}
}
},
"required": [
"file"
]
}
}
},
{
"type": "function",
"function": {
"name": "read_file",
"description": "read a file, at given a path",
"parameters": {
"type": "object",
"properties": {
"file": {
"type": "object",
"properties": {
"path": {
"type": "string"
}
}
}
},
"required": [
"file"
]
}
}
}
],
"tool_choice": "auto",
"parallel_tool_calls": false
}

View File

@ -0,0 +1,503 @@
[
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md"
}
},
"timestamp": "2025-04-02T19:20:14.133Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6MjA6MTQuNzQ2WiJ9"
}
},
"timestamp": "2025-04-02T19:20:18.526Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\test-data.json"
}
},
"timestamp": "2025-04-02T19:20:18.529Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot"
},
"timestamp": "2025-04-02T19:20:21.397Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md"
}
},
"timestamp": "2025-04-02T19:22:04.736Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6MjI6MDYuNzM3WiJ9"
}
},
"timestamp": "2025-04-02T19:22:09.399Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"timestamp": "2025-04-02T19:22:11.156Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:22:14.412Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:22:16.560Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md"
}
},
"timestamp": "2025-04-02T19:23:57.443Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6MjM6NTkuMjE3WiJ9"
}
},
"timestamp": "2025-04-02T19:24:01.816Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"timestamp": "2025-04-02T19:24:02.980Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:24:05.913Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md"
}
},
"timestamp": "2025-04-02T19:24:27.010Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6MjQ6MjguOTk0WiJ9"
}
},
"timestamp": "2025-04-02T19:24:31.805Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"timestamp": "2025-04-02T19:24:32.915Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"timestamp": "2025-04-02T19:24:35.107Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"timestamp": "2025-04-02T19:24:36.964Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"timestamp": "2025-04-02T19:24:38.924Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"timestamp": "2025-04-02T19:24:40.077Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:24:44.409Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:24:46.114Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:24:47.268Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:24:48.542Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:24:50.230Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:24:51.287Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:24:52.374Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md"
}
},
"timestamp": "2025-04-02T19:25:33.849Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6MjU6MzUuMjEwWiJ9"
}
},
"timestamp": "2025-04-02T19:25:38.124Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"timestamp": "2025-04-02T19:25:39.388Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:25:42.174Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:25:43.442Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:25:45.051Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:25:46.118Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:25:47.306Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:25:49.058Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:25:50.265Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:25:51.696Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:25:54.152Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:25:55.282Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md"
}
},
"timestamp": "2025-04-02T19:27:26.127Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}"
}
},
"timestamp": "2025-04-02T19:27:29.663Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"timestamp": "2025-04-02T19:27:30.814Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:27:33.811Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:27:35.338Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:27:36.722Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:27:37.918Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:27:39.340Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:27:40.508Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md"
}
},
"timestamp": "2025-04-02T19:28:27.731Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md"
}
},
"timestamp": "2025-04-02T19:29:19.540Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6Mjk6MjAuOTk4WiJ9"
}
},
"timestamp": "2025-04-02T19:29:24.289Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"timestamp": "2025-04-02T19:29:25.522Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"timestamp": "2025-04-02T19:29:27.281Z",
"service": "collector:onFunctionCallResult"
},
{
"level": "debug",
"message": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"timestamp": "2025-04-02T19:29:29.631Z",
"service": "collector:onFunctionCallResult"
}
]

View File

@ -0,0 +1,888 @@
[
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:20:14.124Z",
"sessionId": "1743621609900",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md and solve all equations. Return the results in the specified JSON format."
},
"timestamp": "2025-04-02T19:20:14.125Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "write_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6MjA6MTQuNzQ2WiJ9"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:20:18.515Z",
"sessionId": "1743621614873",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:20:14.746Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:20:18.516Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:20:18.516Z",
"sessionId": "1743621614873",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:20:14.746Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:20:18.516Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:20:21.394Z",
"sessionId": "1743621619886",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:20:21.395Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:22:04.730Z",
"sessionId": "1743621722780",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md and solve all equations. Return the results in the specified JSON format."
},
"timestamp": "2025-04-02T19:22:04.731Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "write_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6MjI6MDYuNzM3WiJ9"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:22:09.393Z",
"sessionId": "1743621726863",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:22:06.737Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:22:09.394Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:22:11.153Z",
"sessionId": "1743621726863",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:22:06.737Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:22:11.154Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:22:14.409Z",
"sessionId": "1743621732727",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:22:14.409Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:22:16.556Z",
"sessionId": "1743621732727",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:22:16.557Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:23:57.437Z",
"sessionId": "1743621835378",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md and solve all equations. Return the results in the specified JSON format."
},
"timestamp": "2025-04-02T19:23:57.437Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "write_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6MjM6NTkuMjE3WiJ9"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:01.810Z",
"sessionId": "1743621839343",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:23:59.217Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:24:01.811Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:02.977Z",
"sessionId": "1743621839343",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:23:59.217Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:24:02.978Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:05.910Z",
"sessionId": "1743621844236",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:24:05.910Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:27.005Z",
"sessionId": "1743621864760",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md and solve all equations. Return the results in the specified JSON format."
},
"timestamp": "2025-04-02T19:24:27.005Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "write_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6MjQ6MjguOTk0WiJ9"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:31.797Z",
"sessionId": "1743621869106",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:24:28.994Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:24:31.797Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:32.912Z",
"sessionId": "1743621869106",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:24:28.994Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:24:32.913Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:35.103Z",
"sessionId": "1743621869106",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:24:28.994Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:24:35.103Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:36.960Z",
"sessionId": "1743621869106",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:24:28.994Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:24:36.961Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:38.920Z",
"sessionId": "1743621869106",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:24:28.994Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:24:38.921Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:40.073Z",
"sessionId": "1743621869106",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:24:28.994Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:24:40.074Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:44.405Z",
"sessionId": "1743621882865",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:24:44.406Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:46.111Z",
"sessionId": "1743621882865",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:24:46.111Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:47.264Z",
"sessionId": "1743621882865",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:24:47.265Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:48.539Z",
"sessionId": "1743621882865",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:24:48.540Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:50.227Z",
"sessionId": "1743621882865",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:24:50.227Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:51.283Z",
"sessionId": "1743621882865",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:24:51.284Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:24:52.371Z",
"sessionId": "1743621882865",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:24:52.371Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:33.842Z",
"sessionId": "1743621932221",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md and solve all equations. Return the results in the specified JSON format."
},
"timestamp": "2025-04-02T19:25:33.843Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "write_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6MjU6MzUuMjEwWiJ9"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:38.118Z",
"sessionId": "1743621935323",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:25:35.210Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:25:38.118Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:39.385Z",
"sessionId": "1743621935323",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:25:35.210Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:25:39.385Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:42.170Z",
"sessionId": "1743621940421",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:25:42.170Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:43.439Z",
"sessionId": "1743621940421",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:25:43.439Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:45.048Z",
"sessionId": "1743621940421",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:25:45.049Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:46.114Z",
"sessionId": "1743621940421",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:25:46.115Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:47.302Z",
"sessionId": "1743621940421",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:25:47.303Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:49.055Z",
"sessionId": "1743621940421",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:25:49.055Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:50.261Z",
"sessionId": "1743621940421",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:25:50.261Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:51.692Z",
"sessionId": "1743621940421",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:25:51.693Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:54.148Z",
"sessionId": "1743621940421",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:25:54.148Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:25:55.279Z",
"sessionId": "1743621940421",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:25:55.279Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:27:26.121Z",
"sessionId": "1743622044371",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md and solve all equations. Return the results in the specified JSON format."
},
"timestamp": "2025-04-02T19:27:26.121Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "write_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:27:29.657Z",
"sessionId": "1743622047797",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:27:29.658Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:27:30.810Z",
"sessionId": "1743622047797",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:27:30.811Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:27:33.807Z",
"sessionId": "1743622052553",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:27:33.808Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:27:35.335Z",
"sessionId": "1743622052553",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:27:35.335Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:27:36.718Z",
"sessionId": "1743622052553",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:27:36.719Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:27:37.914Z",
"sessionId": "1743622052553",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:27:37.915Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:27:39.335Z",
"sessionId": "1743622052553",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:27:39.336Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:27:40.504Z",
"sessionId": "1743622052553",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:27:40.505Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:28:27.723Z",
"sessionId": "1743622106272",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md and solve all equations. Return the results in the specified JSON format."
},
"timestamp": "2025-04-02T19:28:27.724Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:29:19.532Z",
"sessionId": "1743622156991",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md and solve all equations. Return the results in the specified JSON format."
},
"timestamp": "2025-04-02T19:29:19.533Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "write_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json",
"content": "eyJ0ZXN0IjoiZGF0YSIsInRpbWVzdGFtcCI6IjIwMjUtMDQtMDJUMTk6Mjk6MjAuOTk4WiJ9"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:29:24.283Z",
"sessionId": "1743622161112",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:29:24.284Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:29:25.518Z",
"sessionId": "1743622161112",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:29:25.519Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "read_file",
"arguments": {
"file": {
"path": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json"
}
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:29:27.276Z",
"sessionId": "1743622161112",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}. Return the read data in JSON format."
},
"timestamp": "2025-04-02T19:29:27.277Z",
"service": "collector:onToolCall"
},
{
"level": "debug",
"message": {
"name": "list_files",
"arguments": {
"directory": "C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data"
},
"parsed_arguments": null,
"timestamp": "2025-04-02T19:29:29.625Z",
"sessionId": "1743622168366",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames."
},
"timestamp": "2025-04-02T19:29:29.626Z",
"service": "collector:onToolCall"
}
]

View File

@ -22,6 +22,7 @@
"test:format": "vitest run tests/unit/format.test.ts",
"test:seo": "vitest run tests/unit/seo.test.ts",
"test:language": "vitest run tests/unit/language.test.ts",
"test:tools": "vitest run tests/unit/tools.test.ts",
"test2:watch": "vitest",
"test2:coverage": "vitest run --coverage",
"webpack": "webpack --config webpack.config.js --stats-error-details",

View File

@ -23,7 +23,7 @@ import { load as loadProfile } from '../profile.js'
import { load as loadTools } from '../tools.js'
import { preferences, prompt } from '../prompt.js'
import { variables } from '../variables.js'
import { EMode } from '../zod_schema.js'
import { E_Mode } from '../zod_schema.js'
import { runCompletion } from './run-completion.js'
import { runTools } from './run-tools.js'
@ -80,7 +80,7 @@ export const processRun = async (opts: IKBotTask) => {
tools: []
} as ChatCompletionToolRunnerParams<any>
if (options.mode === EMode.TOOLS || options.mode === EMode.ASSISTANT) {
if (options.mode === E_Mode.TOOLS || options.mode === E_Mode.ASSISTANT) {
params.tools = await loadTools(options)
params.tool_choice = 'auto'
params.parallel_tool_calls = false
@ -94,15 +94,15 @@ export const processRun = async (opts: IKBotTask) => {
options = await options.onRun(options) || options
try {
switch (options.mode) {
case EMode.COMPLETION:
case E_Mode.COMPLETION:
ret = await runCompletion(client, params, options)
break
case EMode.TOOLS:
case E_Mode.TOOLS:
ret = await runTools(client, params, options)
break
case EMode.ASSISTANT:
case E_Mode.ASSISTANT:
ret = await runAssistant(client, params, options)
break

View File

@ -21,10 +21,10 @@ import { defaultTemplate } from './tools.js'
export const E_Filters = z.enum(Object.keys(Filters) as any)
export const RouterTypeSchema = z.enum(['openrouter', 'openai', 'deepseek', 'huggingface', 'ollama', 'fireworks', 'gemini', 'xai'])
export type RouterType = z.infer<typeof RouterTypeSchema>
export const E_RouterTypeSchema = z.enum(['openrouter', 'openai', 'deepseek', 'huggingface', 'ollama', 'fireworks', 'gemini', 'xai'])
export type E_RouterType = z.infer<typeof E_RouterTypeSchema>
export const EMode = {
export const E_Mode = {
COMPLETION: 'completion',
TOOLS: 'tools',
ASSISTANT: 'assistant',
@ -32,10 +32,10 @@ export const EMode = {
} as const
export const EType = z.enum([
EMode.COMPLETION,
EMode.TOOLS,
EMode.ASSISTANT,
EMode.CUSTOM
E_Mode.COMPLETION,
E_Mode.TOOLS,
E_Mode.ASSISTANT,
E_Mode.CUSTOM
])
// https://rjsf-team.github.io/react-jsonschema-form/docs/usage/widgets#file-widgets
/*
@ -147,7 +147,7 @@ export const OptionsSchema = (opts?: any): any => {
.add(
'mode',
EType
.default(EMode.TOOLS)
.default(E_Mode.TOOLS)
.describe(`Chat completion mode:\n\t completion, tools, assistant.
${chalk.green.bold('completion')}: no support for tools, please use --dst parameter to save the output.
${chalk.green.bold('tools')}: allows for tools to be used, eg 'save to ./output.md'. Not all models support this mode.

View File

@ -1,6 +1,8 @@
import { describe, it, expect } from 'vitest'
import * as path from 'node:path'
import { sync as exists } from "@polymech/fs/exists"
import { sync as read } from "@polymech/fs/read"
import {
getDefaultModels,
TEST_BASE_PATH,

View File

@ -1,20 +1,61 @@
import * as path from 'node:path'
import { E_OPENROUTER_MODEL_FREE, E_OPENAI_MODEL, E_OPENROUTER_MODEL } from '../../src/index'
import { E_OPENROUTER_MODEL_FREE, E_OPENAI_MODEL, E_OPENROUTER_MODEL, E_Mode } from '../../src/index'
import { run } from '../../src/index'
import { sync as write } from "@polymech/fs/write"
import { sync as read } from "@polymech/fs/read"
import { sync as exists } from "@polymech/fs/exists"
import { sync as mkdirp } from "mkdirp"
export const getDefaultModels = () => [
//E_OPENROUTER_MODEL_FREE.MODEL_FREE_DEEPSEEK_DEEPSEEK_CHAT_FREE,
export enum ModelCategory {
FAST = 'fast',
LANGUAGE = 'language',
TOOL = 'tool',
ALL = 'all'
}
export const getFastModels = (): string[] => {
return [
E_OPENROUTER_MODEL.MODEL_OPENAI_GPT_3_5_TURBO,
E_OPENROUTER_MODEL.MODEL_DEEPSEEK_DEEPSEEK_R1_DISTILL_QWEN_14B_FREE,
E_OPENROUTER_MODEL.MODEL_OPENAI_GPT_4O_MINI
]
}
export const getLanguageModels = (): string[] => {
return [
E_OPENROUTER_MODEL.MODEL_ANTHROPIC_CLAUDE_3_5_SONNET,
E_OPENROUTER_MODEL.MODEL_QWEN_QWQ_32B,
E_OPENROUTER_MODEL.MODEL_OPENAI_GPT_4O_MINI,
E_OPENROUTER_MODEL.MODEL_OPENAI_GPT_3_5_TURBO,
E_OPENROUTER_MODEL.MODEL_DEEPSEEK_DEEPSEEK_R1,
E_OPENROUTER_MODEL.MODEL_DEEPSEEK_DEEPSEEK_R1_DISTILL_QWEN_14B_FREE
]
E_OPENROUTER_MODEL.MODEL_OPENAI_GPT_3_5_TURBO
]
}
export const getToolModels = (): string[] => {
return [
E_OPENROUTER_MODEL.MODEL_OPENAI_GPT_4O
]
}
export const getDefaultModels = (category: ModelCategory = ModelCategory.FAST): string[] => {
switch (category) {
case ModelCategory.FAST:
return getFastModels()
case ModelCategory.LANGUAGE:
return getLanguageModels()
case ModelCategory.TOOL:
return getToolModels()
case ModelCategory.ALL:
default:
return [
E_OPENROUTER_MODEL.MODEL_ANTHROPIC_CLAUDE_3_5_SONNET,
E_OPENROUTER_MODEL.MODEL_QWEN_QWQ_32B,
E_OPENROUTER_MODEL.MODEL_OPENAI_GPT_4O_MINI,
E_OPENROUTER_MODEL.MODEL_OPENAI_GPT_3_5_TURBO,
E_OPENROUTER_MODEL.MODEL_DEEPSEEK_DEEPSEEK_R1,
E_OPENROUTER_MODEL.MODEL_DEEPSEEK_DEEPSEEK_R1_DISTILL_QWEN_14B_FREE
]
}
}
export const isOpenRouterModel = (model: string): boolean => {
return Object.values(E_OPENROUTER_MODEL).includes(model as E_OPENROUTER_MODEL)
@ -23,7 +64,7 @@ export const isOpenRouterModel = (model: string): boolean => {
export const TEST_BASE_PATH = path.resolve(__dirname, '../../')
export const TEST_LOGS_PATH = path.resolve(__dirname, '../../logs')
export const TEST_PREFERENCES_PATH = path.resolve(__dirname, '../../preferences.md')
export const TEST_TIMEOUT = 5000 // 30 seconds timeout for API calls
export const TEST_TIMEOUT = 30000 // 30 seconds timeout for API calls
// Report paths configuration
export const REPORTS_DIR = path.resolve(__dirname, './reports')
@ -110,7 +151,9 @@ export const runTest = async (
expected: string,
testName: string,
modelName: string,
logPath: string
logPath: string,
mode: "completion" | "tools" | "assistant" | "custom" = "completion",
options: any = {}
): Promise<TestResult> => {
let model = 'unknown'
let router = 'openrouter'
@ -122,12 +165,13 @@ export const runTest = async (
const result = await Promise.race([
run({
prompt,
mode: 'completion',
mode,
model: modelName,
path: TEST_BASE_PATH,
logs: TEST_LOGS_PATH,
preferences: TEST_PREFERENCES_PATH,
logLevel:4,
logLevel: 2,
...options,
onRun: async (options) => {
model = options.model || 'unknown'
router = options.model as string
@ -362,4 +406,4 @@ export const generateTestReport = (
// Write report to file
write(reportPath, report)
}
}

View File

@ -5942,6 +5942,340 @@
},
"reason": "API call timed out",
"category": "seo"
},
{
"test": "equation_solving",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md and solve all equations. Return the results in the specified JSON format.",
"result": [],
"expected": "[{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:20:14.739Z",
"passed": false,
"duration": 5009,
"error": {
"message": "API call timed out",
"code": "UNKNOWN",
"type": "Error",
"details": {
"stack": "Error: API call timed out\n at Timeout._onTimeout (C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\commons.ts:182:33)\n at listOnTimeout (node:internal/timers:594:17)\n at processTimers (node:internal/timers:529:7)",
"message": "API call timed out"
}
},
"reason": "API call timed out",
"category": "tools"
},
{
"test": "file_operations",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:20:14.746Z\"}. Return the read data in JSON format.",
"result": [],
"expected": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:20:14.746Z\"}",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:20:19.753Z",
"passed": false,
"duration": 5007,
"error": {
"message": "API call timed out",
"code": "UNKNOWN",
"type": "Error",
"details": {
"stack": "Error: API call timed out\n at Timeout._onTimeout (C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\commons.ts:182:33)\n at listOnTimeout (node:internal/timers:594:17)\n at processTimers (node:internal/timers:529:7)",
"message": "API call timed out"
}
},
"reason": "API call timed out",
"category": "tools"
},
{
"test": "directory_listing",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot. Return the list as a JSON array of filenames.",
"result": [],
"expected": "[]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:20:24.772Z",
"passed": false,
"duration": 5014,
"error": {
"message": "API call timed out",
"code": "UNKNOWN",
"type": "Error",
"details": {
"stack": "Error: API call timed out\n at Timeout._onTimeout (C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\commons.ts:182:33)\n at listOnTimeout (node:internal/timers:594:17)\n at processTimers (node:internal/timers:529:7)",
"message": "API call timed out"
}
},
"reason": "API call timed out",
"category": "tools"
},
{
"test": "equation_solving",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md and solve all equations. Return the results in the specified JSON format.",
"result": [
"Please specify the the JSON format you want the results in."
],
"expected": "[{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:22:06.731Z",
"passed": false,
"duration": 4124,
"reason": "Expected [{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}], but got please specify the the json format you want the results in.",
"category": "tools"
},
{
"test": "file_operations",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:22:06.737Z\"}. Return the read data in JSON format.",
"result": [
"Here's the data read from the file:\n\n```json\n{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:22:06.737Z\"}\n```"
],
"expected": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:22:06.737Z\"}",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:22:12.607Z",
"passed": false,
"duration": 5870,
"reason": "Expected {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:22:06.737Z\"}, but got here's the data read from the file:\n\n```json\n{\"test\":\"data\",\"timestamp\":\"2025-04-02t19:22:06.737z\"}\n```",
"category": "tools"
},
{
"test": "directory_listing",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames.",
"result": [
"It seems there is an issue retrieving the list of files. Please ensure the directory path is correct and accessible. If you have any other requests, feel free to let me know!"
],
"expected": "[]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:22:17.893Z",
"passed": false,
"duration": 5282,
"reason": "Expected [], but got it seems there is an issue retrieving the list of files. please ensure the directory path is correct and accessible. if you have any other requests, feel free to let me know!",
"category": "tools"
},
{
"test": "equation_solving",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md and solve all equations. Return the results in the specified JSON format.",
"result": [
"I attempted to read the file but it seems there might be an access issue or the file does not exist. Could you please check the file path or provide access details?"
],
"expected": "[{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:23:59.211Z",
"passed": false,
"duration": 4000,
"reason": "Expected [{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}], but got i attempted to read the file but it seems there might be an access issue or the file does not exist. could you please check the file path or provide access details?",
"category": "tools"
},
{
"test": "file_operations",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:23:59.217Z\"}. Return the read data in JSON format.",
"result": [
"```json\n{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:23:59.217Z\"}\n```"
],
"expected": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:23:59.217Z\"}",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:24:04.105Z",
"passed": false,
"duration": 4888,
"reason": "Expected {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:23:59.217Z\"}, but got ```json\n{\"test\":\"data\",\"timestamp\":\"2025-04-02t19:23:59.217z\"}\n```",
"category": "tools"
},
{
"test": "directory_listing",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames.",
"result": [
"I cannot assist with seeking content from your files."
],
"expected": "[]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:24:07.315Z",
"passed": false,
"duration": 3205,
"reason": "Expected [], but got i cannot assist with seeking content from your files.",
"category": "tools"
},
{
"test": "equation_solving",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md and solve all equations. Return the results in the specified JSON format.",
"result": [
"It seems that I don't have automatic access to read files from your system. I can guide you on how to get the content of the file or you can paste the equations here, and I can help you solve them. What would you prefer?"
],
"expected": "[{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:24:28.988Z",
"passed": false,
"duration": 4398,
"reason": "Expected [{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}], but got it seems that i don't have automatic access to read files from your system. i can guide you on how to get the content of the file or you can paste the equations here, and i can help you solve them. what would you prefer?",
"category": "tools"
},
{
"test": "file_operations",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:24:28.994Z\"}. Return the read data in JSON format.",
"result": [
"It seems there was a repeated request for the file's content. To ensure consistency, here is the decoded data from the last correct read attempt:\n\n```json\n{\n \"test\": \"data\",\n \"timestamp\": \"2025-04-02T19:24:28.994Z\"\n}\n```"
],
"expected": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:24:28.994Z\"}",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:24:42.733Z",
"passed": false,
"duration": 13739,
"reason": "Expected {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:24:28.994Z\"}, but got it seems there was a repeated request for the file's content. to ensure consistency, here is the decoded data from the last correct read attempt:\n\n```json\n{\n \"test\": \"data\",\n \"timestamp\": \"2025-04-02t19:24:28.994z\"\n}\n```",
"category": "tools"
},
{
"test": "directory_listing",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames.",
"result": [
"I am unable to list the files in the directory `C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data`. Please verify that the directory path is correct and accessible."
],
"expected": "[]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:24:53.674Z",
"passed": false,
"duration": 10936,
"reason": "Expected [], but got i am unable to list the files in the directory `c:\\users\\zx\\desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data`. please verify that the directory path is correct and accessible.",
"category": "tools"
},
{
"test": "equation_solving",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md and solve all equations. Return the results in the specified JSON format.",
"result": [
"It seems like the file is not accessible at the moment. Please ensure the file path is correct or try again later."
],
"expected": "[{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:25:35.205Z",
"passed": false,
"duration": 3155,
"reason": "Expected [{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}], but got it seems like the file is not accessible at the moment. please ensure the file path is correct or try again later.",
"category": "tools"
},
{
"test": "file_operations",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:25:35.210Z\"}. Return the read data in JSON format.",
"result": [
"{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:25:35.210Z\"}"
],
"expected": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:25:35.210Z\"}",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:25:40.298Z",
"passed": false,
"duration": 5088,
"reason": "Expected {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:25:35.210Z\"}, but got {\"test\":\"data\",\"timestamp\":\"2025-04-02t19:25:35.210z\"}",
"category": "tools"
},
{
"test": "directory_listing",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames.",
"result": [],
"expected": "[]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:25:55.283Z",
"passed": false,
"duration": 14981,
"reason": "Model returned empty response",
"category": "tools"
},
{
"test": "equation_solving",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md and solve all equations. Return the results in the specified JSON format.",
"result": [
"It seems I attempted to read a file from your local system but encountered an issue as I don't have direct access to files on your device. Please open the file and paste the equations here, and I'll be happy to help you solve them!"
],
"expected": "[{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:27:27.676Z",
"passed": false,
"duration": 3474,
"reason": "Expected [{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}], but got it seems i attempted to read a file from your local system but encountered an issue as i don't have direct access to files on your device. please open the file and paste the equations here, and i'll be happy to help you solve them!",
"category": "tools"
},
{
"test": "file_operations",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}. Return the read data in JSON format.",
"result": [
"{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}"
],
"expected": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:27:32.435Z",
"passed": false,
"duration": 4753,
"reason": "Expected {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}, but got {\"test\":\"data\",\"timestamp\":\"2025-04-02t19:27:27.682z\"}",
"category": "tools"
},
{
"test": "directory_listing",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames.",
"result": [
"I am unable to access the directory. Please make sure that the directory path is correct and accessible, or check if there are any permission restrictions. If you have any specific questions or need further assistance, please let me know!"
],
"expected": "[]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:27:43.106Z",
"passed": false,
"duration": 10667,
"reason": "Expected [], but got i am unable to access the directory. please make sure that the directory path is correct and accessible, or check if there are any permission restrictions. if you have any specific questions or need further assistance, please let me know!",
"category": "tools"
},
{
"test": "equation_solving",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md and solve all equations. Return the results in the specified JSON format.",
"result": [
"I cannot directly access the file as it's on a local system. You can provide its contents, and I'll assist you in solving the equations."
],
"expected": "[{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:29:20.992Z",
"passed": false,
"duration": 4181,
"reason": "Expected [{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}], but got i cannot directly access the file as it's on a local system. you can provide its contents, and i'll assist you in solving the equations.",
"category": "tools"
},
{
"test": "file_operations",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}. Return the read data in JSON format.",
"result": [
"{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}"
],
"expected": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:29:28.241Z",
"passed": false,
"duration": 7243,
"reason": "Expected {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}, but got {\"test\":\"data\",\"timestamp\":\"2025-04-02t19:29:20.998z\"}",
"category": "tools"
},
{
"test": "directory_listing",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames.",
"result": [
"{\"files\":[]}"
],
"expected": "[]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:29:30.520Z",
"passed": false,
"duration": 2274,
"reason": "Expected [], but got {\"files\":[]}",
"category": "tools"
}
],
"highscores": [
@ -6094,7 +6428,37 @@
"duration_secs": 1.694
}
]
},
{
"test": "equation_solving",
"rankings": [
{
"model": "openai/gpt-4o",
"duration": 4181,
"duration_secs": 4.181
}
]
},
{
"test": "file_operations",
"rankings": [
{
"model": "openai/gpt-4o",
"duration": 7243,
"duration_secs": 7.243
}
]
},
{
"test": "directory_listing",
"rankings": [
{
"model": "openai/gpt-4o",
"duration": 2274,
"duration_secs": 2.274
}
]
}
],
"lastUpdated": "2025-04-02T14:25:35.176Z"
"lastUpdated": "2025-04-02T19:29:30.523Z"
}

View File

@ -0,0 +1,170 @@
{
"results": [
{
"test": "equation_solving",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\tools.test.md and solve all equations. Return the results in the specified JSON format.",
"result": [
"It seems like the file is not accessible at the moment. Please ensure the file path is correct or try again later."
],
"expected": "[{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:25:35.205Z",
"passed": false,
"duration": 3155,
"reason": "Expected [{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}], but got it seems like the file is not accessible at the moment. please ensure the file path is correct or try again later.",
"category": "tools"
},
{
"test": "file_operations",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:25:35.210Z\"}. Return the read data in JSON format.",
"result": [
"{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:25:35.210Z\"}"
],
"expected": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:25:35.210Z\"}",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:25:40.298Z",
"passed": false,
"duration": 5088,
"reason": "Expected {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:25:35.210Z\"}, but got {\"test\":\"data\",\"timestamp\":\"2025-04-02t19:25:35.210z\"}",
"category": "tools"
},
{
"test": "directory_listing",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames.",
"result": [],
"expected": "[]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:25:55.283Z",
"passed": false,
"duration": 14981,
"reason": "Model returned empty response",
"category": "tools"
},
{
"test": "equation_solving",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md and solve all equations. Return the results in the specified JSON format.",
"result": [
"It seems I attempted to read a file from your local system but encountered an issue as I don't have direct access to files on your device. Please open the file and paste the equations here, and I'll be happy to help you solve them!"
],
"expected": "[{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:27:27.676Z",
"passed": false,
"duration": 3474,
"reason": "Expected [{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}], but got it seems i attempted to read a file from your local system but encountered an issue as i don't have direct access to files on your device. please open the file and paste the equations here, and i'll be happy to help you solve them!",
"category": "tools"
},
{
"test": "file_operations",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}. Return the read data in JSON format.",
"result": [
"{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}"
],
"expected": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:27:32.435Z",
"passed": false,
"duration": 4753,
"reason": "Expected {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:27:27.682Z\"}, but got {\"test\":\"data\",\"timestamp\":\"2025-04-02t19:27:27.682z\"}",
"category": "tools"
},
{
"test": "directory_listing",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames.",
"result": [
"I am unable to access the directory. Please make sure that the directory path is correct and accessible, or check if there are any permission restrictions. If you have any specific questions or need further assistance, please let me know!"
],
"expected": "[]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:27:43.106Z",
"passed": false,
"duration": 10667,
"reason": "Expected [], but got i am unable to access the directory. please make sure that the directory path is correct and accessible, or check if there are any permission restrictions. if you have any specific questions or need further assistance, please let me know!",
"category": "tools"
},
{
"test": "equation_solving",
"prompt": "Read the file at C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\units\\tools.test.md and solve all equations. Return the results in the specified JSON format.",
"result": [
"I cannot directly access the file as it's on a local system. You can provide its contents, and I'll assist you in solving the equations."
],
"expected": "[{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:29:20.992Z",
"passed": false,
"duration": 4181,
"reason": "Expected [{\"equation\":\"2x + 5 = 13\",\"result\":\"4\"},{\"equation\":\"3y - 7 = 20\",\"result\":\"9\"},{\"equation\":\"4z + 8 = 32\",\"result\":\"6\"}], but got i cannot directly access the file as it's on a local system. you can provide its contents, and i'll assist you in solving the equations.",
"category": "tools"
},
{
"test": "file_operations",
"prompt": "Write the following data to C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data\\test-data.json and then read it back: {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}. Return the read data in JSON format.",
"result": [
"{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}"
],
"expected": "{\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:29:28.241Z",
"passed": false,
"duration": 7243,
"reason": "Expected {\"test\":\"data\",\"timestamp\":\"2025-04-02T19:29:20.998Z\"}, but got {\"test\":\"data\",\"timestamp\":\"2025-04-02t19:29:20.998z\"}",
"category": "tools"
},
{
"test": "directory_listing",
"prompt": "List all files in the directory C:\\Users\\zx\\Desktop\\polymech\\polymech-mono\\packages\\kbot\\tests\\unit\\test-data. Return the list as a JSON array of filenames.",
"result": [
"{\"files\":[]}"
],
"expected": "[]",
"model": "openai/gpt-4o",
"router": "openai/gpt-4o",
"timestamp": "2025-04-02T19:29:30.520Z",
"passed": false,
"duration": 2274,
"reason": "Expected [], but got {\"files\":[]}",
"category": "tools"
}
],
"highscores": [
{
"test": "equation_solving",
"rankings": [
{
"model": "openai/gpt-4o",
"duration": 4181,
"duration_secs": 4.181
}
]
},
{
"test": "file_operations",
"rankings": [
{
"model": "openai/gpt-4o",
"duration": 7243,
"duration_secs": 7.243
}
]
},
{
"test": "directory_listing",
"rankings": [
{
"model": "openai/gpt-4o",
"duration": 2274,
"duration_secs": 2.274
}
]
}
],
"lastUpdated": "2025-04-02T19:29:30.521Z"
}

View File

@ -0,0 +1,53 @@
# LLM Tools Test Results
## Highscores
### Performance Rankings (Duration)
| Test | Model | Duration (ms) | Duration (s) |
|------|-------|--------------|--------------|
| equation_solving | openai/gpt-4o | 4181 | 4.18 |
| file_operations | openai/gpt-4o | 7243 | 7.24 |
| directory_listing | openai/gpt-4o | 2274 | 2.27 |
## Summary
- Total Tests: 3
- Passed: 0
- Failed: 3
- Success Rate: 0.00%
- Average Duration: 4566ms (4.57s)
## Failed Tests
### equation_solving - openai/gpt-4o
- Prompt: `Read the file at C:\Users\zx\Desktop\polymech\polymech-mono\packages\kbot\tests\units\tools.test.md and solve all equations. Return the results in the specified JSON format.`
- Expected: `[{"equation":"2x + 5 = 13","result":"4"},{"equation":"3y - 7 = 20","result":"9"},{"equation":"4z + 8 = 32","result":"6"}]`
- Actual: `I cannot directly access the file as it's on a local system. You can provide its contents, and I'll assist you in solving the equations.`
- Duration: 4181ms (4.18s)
- Reason: Expected [{"equation":"2x + 5 = 13","result":"4"},{"equation":"3y - 7 = 20","result":"9"},{"equation":"4z + 8 = 32","result":"6"}], but got i cannot directly access the file as it's on a local system. you can provide its contents, and i'll assist you in solving the equations.
- Timestamp: 4/2/2025, 9:29:20 PM
### file_operations - openai/gpt-4o
- Prompt: `Write the following data to C:\Users\zx\Desktop\polymech\polymech-mono\packages\kbot\tests\unit\test-data\test-data.json and then read it back: {"test":"data","timestamp":"2025-04-02T19:29:20.998Z"}. Return the read data in JSON format.`
- Expected: `{"test":"data","timestamp":"2025-04-02T19:29:20.998Z"}`
- Actual: `{"test":"data","timestamp":"2025-04-02T19:29:20.998Z"}`
- Duration: 7243ms (7.24s)
- Reason: Expected {"test":"data","timestamp":"2025-04-02T19:29:20.998Z"}, but got {"test":"data","timestamp":"2025-04-02t19:29:20.998z"}
- Timestamp: 4/2/2025, 9:29:28 PM
### directory_listing - openai/gpt-4o
- Prompt: `List all files in the directory C:\Users\zx\Desktop\polymech\polymech-mono\packages\kbot\tests\unit\test-data. Return the list as a JSON array of filenames.`
- Expected: `[]`
- Actual: `{"files":[]}`
- Duration: 2274ms (2.27s)
- Reason: Expected [], but got {"files":[]}
- Timestamp: 4/2/2025, 9:29:30 PM
## Passed Tests
*No passed tests*

View File

@ -0,0 +1,11 @@
# Test Equations
Solve the following equations and provide the results in the format:
{
"equation": "equation text",
"result": "numeric result"
}
1. 2x + 5 = 13
2. 3y - 7 = 20
3. 4z + 8 = 32

View File

@ -0,0 +1,95 @@
import { describe, it, expect } from 'vitest'
import * as path from 'node:path'
import { sync as exists } from "@polymech/fs/exists"
import { sync as read } from "@polymech/fs/read"
import { z } from 'zod'
import {
getDefaultModels,
TEST_BASE_PATH,
TEST_LOGS_PATH,
TEST_PREFERENCES_PATH,
TEST_TIMEOUT,
TestResult,
runTest,
generateTestReport,
getReportPaths,
ModelCategory
} from './commons'
// Use tool models for this test file
const models = getDefaultModels(ModelCategory.TOOL)
// Define the Zod schema for equation results
const equationResultSchema = z.object({
equation: z.string(),
result: z.string()
})
const equationResultsSchema = z.array(equationResultSchema)
describe('LLM Tools Operations', () => {
let testResults: TestResult[] = []
const TEST_LOG_PATH = getReportPaths('tools', 'json')
const TEST_REPORT_PATH = getReportPaths('tools', 'md')
const TEST_DATA_PATH = path.resolve('./tests/units/tools.test.md')
const TEST_DATA_DIR = path.resolve(__dirname, 'test-data')
it.each(models)('should read and solve equations with model %s', async (modelName) => {
const result = await runTest(
`Read the file at ${TEST_DATA_PATH} and solve all equations. Return the results in the specified JSON format.`,
JSON.stringify([
{ equation: "2x + 5 = 13", result: "4" },
{ equation: "3y - 7 = 20", result: "9" },
{ equation: "4z + 8 = 32", result: "6" }
]),
'equation_solving',
modelName,
TEST_LOG_PATH,
'tools',
{ format: equationResultsSchema }
)
testResults.push(result)
expect(result.result[0]?.trim()).toBeTruthy()
}, { timeout: TEST_TIMEOUT })
it.each(models)('should write and read back data with model %s', async (modelName) => {
const testData = { test: "data", timestamp: new Date().toISOString() }
const testFilePath = path.resolve(TEST_DATA_DIR, 'test-data.json')
const result = await runTest(
`Write the following data to ${testFilePath} and then read it back: ${JSON.stringify(testData)}. Return the read data in JSON format.`,
JSON.stringify(testData),
'file_operations',
modelName,
TEST_LOG_PATH,
'tools',
{
disable: ['npm,git,interact,terminal,search,web,email,user']
}
)
testResults.push(result)
expect(result.result[0]?.trim()).toBeTruthy()
}, { timeout: TEST_TIMEOUT })
it.each(models)('should list directory contents with model %s', async (modelName) => {
const result = await runTest(
`List all files in the directory ${TEST_DATA_DIR}. Return the list as a JSON array of filenames.`,
'[]', // We don't know exact contents, just verify we get a valid JSON array
'directory_listing',
modelName,
TEST_LOG_PATH,
'tools',
{
disable: ['npm,git,interact,terminal,search,web,email,user']
}
)
testResults.push(result)
expect(result.result[0]?.trim()).toBeTruthy()
}, { timeout: TEST_TIMEOUT })
it('should generate markdown report', () => {
generateTestReport(testResults, 'LLM Tools Test Results', TEST_REPORT_PATH)
expect(exists(TEST_REPORT_PATH) === 'file').toBe(true)
})
})