@j-o-r/hello-dave 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +445 -160
  3. package/README.md.backup +269 -0
  4. package/README.md.bak +481 -0
  5. package/README.md.bak.1774780058 +338 -0
  6. package/README.md.bak2 +455 -0
  7. package/bin/dave.js +165 -0
  8. package/docs.bak.1774780058/agent-manager.md +167 -0
  9. package/docs.bak.1774780058/agent-manager.md.bak +137 -0
  10. package/docs.bak.1774780058/agent-manager.md.bak2 +157 -0
  11. package/docs.bak.1774780058/codeserver-pattern.md +191 -0
  12. package/docs.bak.1774780058/path-resolution-best-practices.md +104 -0
  13. package/docs.bak.1774780058/project-overview.md +67 -0
  14. package/docs.bak.1774780058/project-overview.md.bak +67 -0
  15. package/docs.bak.1774780058/prompt-class.md +141 -0
  16. package/docs.bak.1774780058/prompt-class.md.bak +142 -0
  17. package/docs.bak.1774780058/tools-syntax-validation.md +121 -0
  18. package/docs.bak.1774780058/tools-syntax-validation.md.bak2 +125 -0
  19. package/docs.bak.1774780058/tools-syntax-validation.md.bak3 +125 -0
  20. package/docs.bak.1774780058/tools-syntax-validation.md.bak4 +106 -0
  21. package/docs.bak.1774780058/tools-syntax-validation.md.bak_path +106 -0
  22. package/docs.bak.1774780058/toolset.md +164 -0
  23. package/docs.bak.1774780058/toolset.md.bak +94 -0
  24. package/docs.bak.1774780058/toolset.md.bak3 +161 -0
  25. package/docs.bak.1774780058/toolset.md.bak4 +161 -0
  26. package/docs.bak.1774780058/toolset.md.bak5 +161 -0
  27. package/docs.bak.1774780058/toolset.md.bak6 +163 -0
  28. package/docs.bak.1774780058/toolset.md.bak_path +163 -0
  29. package/docs.bak.1774780058/toolset.md.bak_syntax +161 -0
  30. package/docs.bak.1774780058/xai-responses.md +111 -0
  31. package/docs.bak.1774780058/xai-responses.md.bak +107 -0
  32. package/docs.bak.1774780058/xai-responses.md.bak2 +107 -0
  33. package/docs.bak.1774780058/xai_collections.md +106 -0
  34. package/examples/ask_agent.js +137 -0
  35. package/examples/code_agent.js +149 -0
  36. package/examples/coderev_agent.js +136 -0
  37. package/examples/codeserver.sh +47 -0
  38. package/examples/daisy_agent.js +170 -0
  39. package/examples/docs_agent.js +148 -0
  40. package/examples/gpt_agent.js +125 -0
  41. package/examples/grok_agent.js +132 -0
  42. package/examples/grok_agent.js.bak +98 -0
  43. package/examples/grok_agent.js.bak.2 +99 -0
  44. package/examples/grok_agent.js.bak.3 +1 -0
  45. package/examples/grok_agent.js.bak.4 +124 -0
  46. package/examples/grok_agent.js.bak.5 +1 -0
  47. package/examples/grok_agent.js.bak.6 +1 -0
  48. package/examples/memory_agent.js +152 -0
  49. package/examples/npm_agent.js +202 -0
  50. package/examples/npm_agent.js.bak.3 +2 -0
  51. package/examples/npm_agent.js.bak.4 +205 -0
  52. package/examples/npm_agent.js.bak.5 +1 -0
  53. package/examples/npm_agent.js.bak.6 +1 -0
  54. package/examples/prompt_agent.js +133 -0
  55. package/examples/readme_agent.js +148 -0
  56. package/examples/spawn_agent.js +293 -0
  57. package/examples/test_agent.js +187 -0
  58. package/examples/todo_agent.js +175 -0
  59. package/examples.bak.1774780058/ask_agent.js +114 -0
  60. package/examples.bak.1774780058/code_agent.js +149 -0
  61. package/examples.bak.1774780058/coderev_agent.js +72 -0
  62. package/examples.bak.1774780058/codeserver.sh +47 -0
  63. package/examples.bak.1774780058/daisy_agent.js +177 -0
  64. package/examples.bak.1774780058/docs_agent.js +119 -0
  65. package/{bin/hdAsk.js → examples.bak.1774780058/gpt_agent.js} +46 -40
  66. package/examples.bak.1774780058/grok_agent.js +98 -0
  67. package/examples.bak.1774780058/memory_agent.js +112 -0
  68. package/examples.bak.1774780058/npm_agent.js +175 -0
  69. package/examples.bak.1774780058/prompt_agent.js +112 -0
  70. package/examples.bak.1774780058/readme_agent.js +144 -0
  71. package/examples.bak.1774780058/spawn_agent.js +263 -0
  72. package/examples.bak.1774780058/test_agent.js +162 -0
  73. package/examples.bak.1774780058/todo_agent.js +138 -0
  74. package/lib/API/openai.com/reponses/text.js +12 -18
  75. package/lib/API/x.ai/collections.js +354 -0
  76. package/lib/API/x.ai/files.js +218 -0
  77. package/lib/API/x.ai/responses.js +492 -0
  78. package/lib/API/x.ai/text.js +1 -1
  79. package/lib/AgentClient.js +13 -6
  80. package/lib/AgentManager.js +80 -10
  81. package/lib/AgentServer.js +50 -22
  82. package/lib/Cli.js +7 -1
  83. package/lib/Prompt.js +4 -2
  84. package/lib/ToolSet.js +2 -1
  85. package/lib/genericToolset.js +258 -88
  86. package/lib/genericToolset.js.bak_syntax +402 -0
  87. package/lib/index.js +4 -2
  88. package/lib/wsCli.js +256 -0
  89. package/lib/wsIO.js +96 -0
  90. package/package.json +26 -21
  91. package/scenarios.bak.1774780058/data/eval_node_message.json +9 -0
  92. package/scenarios.bak.1774780058/data/hist_oa.json +66 -0
  93. package/scenarios.bak.1774780058/data/o3_response1.json +96 -0
  94. package/scenarios.bak.1774780058/data/oa_reasoning_parse.json +112 -0
  95. package/scenarios.bak.1774780058/data/tool_oa.json +96 -0
  96. package/scenarios.bak.1774780058/data/tool_xai.json +59 -0
  97. package/scenarios.bak.1774780058/data/tool_xai2.json +40 -0
  98. package/scenarios.bak.1774780058/data/xai-response-1.json +59 -0
  99. package/scenarios.bak.1774780058/data/xai-response-2.json +10 -0
  100. package/scenarios.bak.1774780058/data/xai_reasoning_tools_resp.json +59 -0
  101. package/scenarios.bak.1774780058/data/xai_search_response.json +58 -0
  102. package/scenarios.bak.1774780058/environment.js +10 -0
  103. package/scenarios.bak.1774780058/example.js +17 -0
  104. package/scenarios.bak.1774780058/genericToolset.test.js +182 -0
  105. package/scenarios.bak.1774780058/grok.js +113 -0
  106. package/scenarios.bak.1774780058/memory-tools.js +51 -0
  107. package/scenarios.bak.1774780058/openai-o3.js +137 -0
  108. package/scenarios.bak.1774780058/openai-prompt.js +155 -0
  109. package/scenarios.bak.1774780058/openai-session.js +148 -0
  110. package/scenarios.bak.1774780058/openai.js +102 -0
  111. package/scenarios.bak.1774780058/prompt.js +118 -0
  112. package/scenarios.bak.1774780058/promptFishbowl.js +76 -0
  113. package/scenarios.bak.1774780058/search.brave.com.js +25 -0
  114. package/scenarios.bak.1774780058/sh.js +15 -0
  115. package/scenarios.bak.1774780058/test-wsio.js +26 -0
  116. package/scenarios.bak.1774780058/testToolset.js +42 -0
  117. package/scenarios.bak.1774780058/toolset.js +16 -0
  118. package/scenarios.bak.1774780058/toolset.test.js +141 -0
  119. package/scenarios.bak.1774780058/write_file_syntax.test.js +145 -0
  120. package/scenarios.bak.1774780058/write_file_validation/README.md +30 -0
  121. package/scenarios.bak.1774780058/write_file_validation/bad.js +3 -0
  122. package/scenarios.bak.1774780058/write_file_validation/good.js +4 -0
  123. package/scenarios.bak.1774780058/write_file_validation/test.sh +43 -0
  124. package/scenarios.bak.1774780058/wsClient.js +69 -0
  125. package/scenarios.bak.1774780058/xai_responses.integration.test.js +57 -0
  126. package/scenarios.bak.1774780058/xai_responses.test.js +154 -0
  127. package/scenarios.bak.1774780058/xaicoll.js +50 -0
  128. package/scenarios.bak.1774780058/xaifiles.js +48 -0
  129. package/types/API/openai.com/reponses/text.d.ts +17 -3
  130. package/types/API/x.ai/collections.d.ts +167 -0
  131. package/types/API/x.ai/files.d.ts +84 -0
  132. package/types/API/x.ai/responses.d.ts +379 -0
  133. package/types/AgentClient.d.ts +5 -0
  134. package/types/AgentManager.d.ts +25 -31
  135. package/types/AgentServer.d.ts +5 -1
  136. package/types/Prompt.d.ts +4 -2
  137. package/types/ToolSet.d.ts +1 -0
  138. package/types/index.d.ts +4 -3
  139. package/types/wsCli.d.ts +3 -0
  140. package/types/wsIO.d.ts +26 -0
  141. package/utils/bars.js +40 -0
  142. package/utils/clear_sessions.sh +54 -0
  143. package/{bin/hdInspect.js → utils/format_log.js} +5 -0
  144. package/utils/list_sessions.sh +46 -0
  145. package/utils/search_sessions.sh +73 -0
  146. package/utils/syntax_check.sh +61 -0
  147. package/utils/test.sh +46 -0
  148. package/bin/hdClear.js +0 -13
  149. package/bin/hdCode.js +0 -115
  150. package/bin/hdConnect.js +0 -230
  151. package/bin/hdNpm.js +0 -114
  152. package/bin/hdPrompt.js +0 -108
  153. package/examples/claude-test.js +0 -89
  154. package/examples/claude.js +0 -143
  155. package/examples/gpt.js +0 -127
  156. package/examples/gpt_code.js +0 -125
  157. package/examples/gpt_note_keeping.js +0 -117
  158. package/examples/grok.js +0 -119
  159. package/examples/grok_code.js +0 -114
  160. package/examples/grok_note_keeping.js +0 -111
  161. package/module.md +0 -189
package/lib/wsIO.js ADDED
@@ -0,0 +1,96 @@
1
+ import { WebSocket } from 'ws';
2
+ /*
3
+ * Oneshot direct write response to/from a Agent server
4
+ */
5
+ /**
6
+ * @typedef {object} wsResponse
7
+ * @property {string} action
8
+ * @property {string} content
9
+ * @property {number} id - message id
10
+ */
11
+ /**
12
+ * One-shot WebSocket client for hello-dave server using standard 'ws' library.
13
+ * Connects directly to pure WS endpoint (no HTTP upgrade).
14
+ * Sends intro + action, awaits matching response by ID, closes, returns response.
15
+ *
16
+ * @param {string} connectUrl - Websocket server endpoint to connect to
17
+ * @param {string} [secret] - Secret websocket connection key
18
+ * @param {'user_request'|'user_info'|'user_reset'} action - Action
19
+ * @param {string} [input] - When action is 'user_request' input is the query
20
+ * @returns {Promise<wsResponse>}
21
+ */
22
+ export default async function wsio(connectUrl, secret = '', action, input = '') {
23
+ if (!['user_request', 'user_reset', 'user_info'].includes(action)) {
24
+ throw new Error(`Invalid action: ${action}. Must be one of: user_input, user_reset, user_info`);
25
+ }
26
+ if (action === 'user_request' && (!input || typeof input !== 'string' || input.trim() === '')) {
27
+ throw new Error('Non-empty string input required for "user_input"');
28
+ }
29
+
30
+ let b64secret = '';
31
+ if (secret !== '') {
32
+ b64secret = Buffer.from(secret).toString('base64');
33
+ }
34
+
35
+ const url = `${connectUrl}${connectUrl.includes('?') ? '&' : '?'}wssrc_id=${b64secret}`;
36
+
37
+ return new Promise((resolve, reject) => {
38
+ const ws = new WebSocket(url);
39
+
40
+ let resolved = false;
41
+ const TIMEOUT_MS = 30000; // 30s timeout
42
+ const timeoutId = setTimeout(() => {
43
+ if (!resolved) {
44
+ ws.close();
45
+ reject(new Error('Request timeout (30s)'));
46
+ }
47
+ }, TIMEOUT_MS);
48
+
49
+ const actionId = Date.now();
50
+
51
+ ws.on('open', () => {
52
+ // Send introduction first (matches wsConnect.js protocol)
53
+ const introId = Date.now() - 1;
54
+ ws.send(JSON.stringify({
55
+ action: 'user_introduction',
56
+ content: '',
57
+ id: introId
58
+ }));
59
+
60
+ // Send the action immediately after
61
+ ws.send(JSON.stringify({
62
+ action,
63
+ content: input,
64
+ id: actionId
65
+ }));
66
+ });
67
+
68
+ ws.on('message', (data) => {
69
+ try {
70
+ const parsed = JSON.parse(data.toString());
71
+ if (parsed.id === actionId) {
72
+ clearTimeout(timeoutId);
73
+ resolved = true;
74
+ ws.close(1000, 'Request complete');
75
+ resolve(parsed);
76
+ }
77
+ } catch (e) {
78
+ // Ignore non-JSON or non-matching messages (e.g., intro response)
79
+ }
80
+ });
81
+
82
+ ws.on('close', (code, reason) => {
83
+ clearTimeout(timeoutId);
84
+ if (!resolved) {
85
+ reject(new Error(`Connection closed (${code}): ${reason || 'Unknown reason'}`));
86
+ }
87
+ });
88
+
89
+ ws.on('error', (error) => {
90
+ clearTimeout(timeoutId);
91
+ if (!resolved) {
92
+ reject(new Error(`WebSocket error: ${error.message}`));
93
+ }
94
+ });
95
+ });
96
+ }
package/package.json CHANGED
@@ -1,41 +1,46 @@
1
1
  {
2
2
  "name": "@j-o-r/hello-dave",
3
3
  "type": "module",
4
- "version": "0.0.2",
5
- "description": "ESM toolkit for building AI agents with unified access to Grok, OpenAI, and Anthropic endpoints",
6
- "main": "lib/AgentManager.js",
7
- "types": "types/AgentManager.d.ts",
4
+ "version": "0.0.4",
5
+ "description": "ESM toolkit for building AI agents with unified access to Grok (XAI), OpenAI, and Anthropic endpoints",
6
+ "main": "./lib/index.js",
7
+ "types": "./types/index.d.ts",
8
+ "typesVersions": {
9
+ ">4": {
10
+ "*": [
11
+ "types/*"
12
+ ]
13
+ }
14
+ },
8
15
  "bin": {
9
- "hdPrompt": "bin/hdPrompt.js",
10
- "hdNpm": "bin/hdNpm.js",
11
- "hdAsk": "bin/hdAsk.js",
12
- "hdCode": "bin/hdCode.js",
13
- "hdConnect": "bin/hdConnect.js",
14
- "hdInspect": "bin/hdInspect.js",
15
- "hdClear": "bin/hdClear.js"
16
+ "dave": "bin/dave.js",
17
+ "createAgent": "examples/spawn_agent.js"
16
18
  },
17
19
  "scripts": {
18
- "hdPrompt": "bin/hdPrompt.js",
19
- "hdAsk": "bin/hdAsk.js",
20
- "hdCode": "bin/hdCode.js",
21
- "hdNpm": "bin/hdNpm.js",
22
- "hdConnect": "bin/hdConnect.js",
23
- "hdInspect": "bin/hdInspect.js",
24
- "hdClear": "bin/hdClear.js",
25
- "test": "scenarios/grok.js",
26
20
  "release": "npm run types && npm pack --pack-destination=release",
27
21
  "types": "rm -fr types/* && tsc -p tsc.json",
28
- "publish": "npm run release && npm publish --access public"
22
+ "publish": "npm run release && npm publish --access public",
23
+ "local": "npm -g uninstall '@j-o-r/hello-dave' && npm install -g .",
24
+ "link-self": "mkdir -p node_modules/@j-o-r && ln -sf . node_modules/@j-o-r/hello-dave && npm ls @j-o-r/hello-dave",
25
+ "unlink-self": "rm -rf node_modules/@j-o-r/hello-dave",
26
+ "tests": "utils/test.sh"
29
27
  },
30
28
  "repository": {
31
29
  "type": "git",
32
30
  "url": "https://codeberg.org/duin/hello-dave"
33
31
  },
34
32
  "dependencies": {
35
- "@j-o-r/apiserver": "^2.1.5",
33
+ "@j-o-r/apiserver": "*",
36
34
  "@j-o-r/cli": "*",
37
35
  "gpt-3-encoder": "*"
38
36
  },
37
+ "exports": {
38
+ ".": {
39
+ "types": "./types/index.d.ts",
40
+ "default": "./lib/index.js"
41
+ },
42
+ "./*": "lib/*.js"
43
+ },
39
44
  "author": "Jorrit Duin <j-o-r@duin.work>",
40
45
  "bugs": {
41
46
  "url": "https://codeberg.org/duin/hello-dave/issues"
@@ -0,0 +1,9 @@
1
+ {
2
+ "type": "function_request",
3
+ "function_request": {
4
+ "name": "execute_javascript",
5
+ "id": "fc_686284be7fec81a0af404739ec17e29f09dcb726e1aa6681",
6
+ "call_id": "call_w0WnYfQiqFey5UiF4jG0XQcn",
7
+ "parameters": "{\"script\": \"/*\\n * Function: parseMessages\\n * Description: Parses the 'response' object and adds messages to the given Prompt instance.\\n * The function supports two types of response items:\\n * 1. function_call: These are mapped to a function_request message with role 'assistant'.\\n * The function_request content fields are: name, id, call_id, and parameters (from arguments).\\n * 2. message: These are mapped to text messages. In case the content array contains items with type 'output_text',\\n * they are converted into PRTextMessage objects (i.e., with type \\\"text\\\") and added to the prompt.\\n * In the case where there is more than one piece of content, addMultiModal is used.\\n *\\n * Note: This function assumes that the response is already parsed (i.e., a JS object) and that prompt is an instance\\n * of the Prompt class imported from lib/Prompt.js.\\n */\\n\\nexport function parseMessages(response, prompt) {\\n if (!response || !Array.isArray(response.output)) {\\n console.warn('Invalid response format. Expected an object with an output array.');\\n return;\\n }\\n\\n response.output.forEach(item => {\\n if (item.type === 'function_call') {\\n // Convert function_call to a function_request message\\n const functionRequestContent = {\\n type: 'function_request',\\n function_request: {\\n id: item.id,\\n name: item.name,\\n call_id: item.call_id,\\n parameters: item.arguments\\n }\\n };\\n // Add as a multi-modal assistant message\\n try {\\n prompt.addMultiModal('assistant', [functionRequestContent]);\\n } catch (err) {\\n console.error('Error adding function_request message:', err);\\n }\\n } else if (item.type === 'message') {\\n // Determine the role; if not provided, use 'assistant' by default\\n const role = item.role || 'assistant';\\n let prContents = [];\\n\\n if (Array.isArray(item.content)) {\\n item.content.forEach(contentItem => {\\n if (contentItem.type === 'output_text') {\\n prContents.push({\\n type: 'text',\\n text: contentItem.text\\n });\\n } else if (contentItem.type === 'image_url') {\\n prContents.push({\\n type: 'image_url',\\n image_url: contentItem.image_url\\n });\\n } else {\\n // If another type is encountered, you may want to add additional handling here.\\n console.warn('Unhandled content type in message:', contentItem.type);\\n }\\n });\\n }\\n\\n if (prContents.length > 0) {\\n try {\\n // If there is only one text message and no multi-modal requirements, use add\\n if (prContents.length === 1 && prContents[0].type === 'text') {\\n prompt.add(role, prContents[0].text);\\n } else {\\n prompt.addMultiModal(role, prContents);\\n }\\n } catch (err) {\\n console.error('Error adding message:', err);\\n }\\n }\\n } else {\\n console.warn('Unhandled item type:', item.type);\\n }\\n });\\n}\\n\\n// Example usage:\\n// import Prompt from './lib/Prompt.js';\\n// import { parseMessages } from './parseMessages.js';\\n// \\n// const prompt = new Prompt(1000);\\n// const response = {\\n// output: [\\n// {\\n// id: 'fc_68624cb486148191b2078ec2a76e389a068902ce013ce130',\\n// type: 'function_call',\\n// status: 'completed',\\n// arguments: '{}',\\n// call_id: 'call_6YNYwCZRbmMPr5WaEo1FkbXx',\\n// name: 'get_date_time'\\n// },\\n// {\\n// id: 'msg_68624cb7c28c8191aff3106ebea965d4068902ce013ce130',\\n// type: 'message',\\n// status: 'completed',\\n// content: [\\n// {\\n// type: 'output_text',\\n// annotations: [],\\n// logprobs: [],\\n// text: 'Today is Friday, 12 May 2025. The current weather in Amsterdam, The Netherlands is 24°C.'\\n// }\\n// ],\\n// role: 'assistant'\\n// }\\n// ]\\n// };\\n// \\n// parseMessages(response, prompt);\\n// console.log(prompt.messages);\\n\"}"
8
+ }
9
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "background": false,
3
+ "include": null,
4
+ "input": [
5
+ {
6
+ "role": "user",
7
+ "content": [
8
+ {
9
+ "type": "input_text",
10
+ "text": "What is your task?"
11
+ }
12
+ ]
13
+ },
14
+ {
15
+ "role": "assistant",
16
+ "content": [
17
+ {
18
+ "type": "output_text",
19
+ "text": "My task is to assist with administrative duties, such as answering questions, scheduling, providing information, and supporting office operations efficiently."
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ "role": "user",
25
+ "content": [
26
+ {
27
+ "type": "input_text",
28
+ "text": "What day is today and what is the weather forcast in Amsterdam, The Netherlands"
29
+ }
30
+ ]
31
+ }
32
+ ],
33
+ "instructions": "You are an assistant for an administrative office. Respond precise and concise",
34
+ "max_output_tokens": 4000,
35
+ "model": "gpt-4.1",
36
+ "store": false,
37
+ "tool_choice": "auto",
38
+ "tools": [
39
+ {
40
+ "type": "function",
41
+ "name": "get_current_weather",
42
+ "description": "Get the current weather in a given location",
43
+ "parameters": {
44
+ "type": "object",
45
+ "properties": {
46
+ "location": {
47
+ "type": "string",
48
+ "description": "The city and country"
49
+ }
50
+ },
51
+ "required": [
52
+ "location"
53
+ ]
54
+ }
55
+ },
56
+ {
57
+ "type": "function",
58
+ "name": "get_date_time",
59
+ "description": "Get the current date and time",
60
+ "parameters": {
61
+ "type": "object",
62
+ "properties": {}
63
+ }
64
+ }
65
+ ]
66
+ }
@@ -0,0 +1,96 @@
1
+ {
2
+ "status": 200,
3
+ "responseType": "js",
4
+ "response": {
5
+ "id": "resp_6874b24814cc819ea71f8eb6e91232ca02f4bf761199143a",
6
+ "object": "response",
7
+ "created_at": 1752478280,
8
+ "status": "completed",
9
+ "background": false,
10
+ "error": null,
11
+ "incomplete_details": null,
12
+ "instructions": "Respond precise and concise",
13
+ "max_output_tokens": null,
14
+ "max_tool_calls": 10,
15
+ "model": "gpt-4.1-2025-04-14",
16
+ "output": [
17
+ {
18
+ "id": "fc_6874b24891c0819e9062bad90155a54c02f4bf761199143a",
19
+ "type": "function_call",
20
+ "status": "completed",
21
+ "arguments": "{}",
22
+ "call_id": "call_VxiUGAEYYi6vIB2Pvii7BjfC",
23
+ "name": "get_date_time"
24
+ },
25
+ {
26
+ "id": "fc_6874b248a410819ea277914240709c9d02f4bf761199143a",
27
+ "type": "function_call",
28
+ "status": "completed",
29
+ "arguments": "{\"location\":\"Amsterdam, The Netherlands\"}",
30
+ "call_id": "call_4R7UXEUNHODywjbuqCvtoj0K",
31
+ "name": "get_current_weather"
32
+ }
33
+ ],
34
+ "parallel_tool_calls": true,
35
+ "previous_response_id": null,
36
+ "reasoning": {
37
+ "effort": null,
38
+ "summary": null
39
+ },
40
+ "service_tier": "default",
41
+ "store": true,
42
+ "temperature": 1,
43
+ "text": {
44
+ "format": {
45
+ "type": "text"
46
+ }
47
+ },
48
+ "tool_choice": "auto",
49
+ "tools": [
50
+ {
51
+ "type": "function",
52
+ "description": "Get the current weather in a given location",
53
+ "name": "get_current_weather",
54
+ "parameters": {
55
+ "type": "object",
56
+ "properties": {
57
+ "location": {
58
+ "type": "string",
59
+ "description": "The city and country"
60
+ }
61
+ },
62
+ "required": [
63
+ "location"
64
+ ]
65
+ },
66
+ "strict": true
67
+ },
68
+ {
69
+ "type": "function",
70
+ "description": "Get the current date and time",
71
+ "name": "get_date_time",
72
+ "parameters": {
73
+ "type": "object",
74
+ "properties": {}
75
+ },
76
+ "strict": true
77
+ }
78
+ ],
79
+ "top_logprobs": 0,
80
+ "top_p": 1,
81
+ "truncation": "disabled",
82
+ "usage": {
83
+ "input_tokens": 86,
84
+ "input_tokens_details": {
85
+ "cached_tokens": 0
86
+ },
87
+ "output_tokens": 46,
88
+ "output_tokens_details": {
89
+ "reasoning_tokens": 0
90
+ },
91
+ "total_tokens": 132
92
+ },
93
+ "user": null,
94
+ "metadata": {}
95
+ }
96
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "status": 200,
3
+ "responseType": "js",
4
+ "response": {
5
+ "id": "resp_6863d9370ab48192b83fae94e9782ecd0019502d0d1a63e8",
6
+ "object": "response",
7
+ "created_at": 1751374135,
8
+ "status": "completed",
9
+ "background": false,
10
+ "error": null,
11
+ "incomplete_details": null,
12
+ "instructions": "You are Dave, an assistant for this project, which is a Node.js 22 / JavaScript ESM ES2022 project with minimal external dependencies. Comments are in JSDoc format.\n\nThe goal is to create a multi-endpoint API for AI models and system integration that can be easily tested with a CLI interface and utilized in other projects.\n\nBe helpful, but keep responses brief and concise. User input may include new questions, remarks about previous conversations, or opinions on past answers.\n\nAsk a clarifying question to establish context before providing an answer when necessary, and reason explicitly before reaching a conclusion.",
13
+ "max_output_tokens": 4000,
14
+ "max_tool_calls": null,
15
+ "model": "o3-mini-2025-01-31",
16
+ "output": [
17
+ {
18
+ "id": "rs_6863d938a7008192bfd00349682585390019502d0d1a63e8",
19
+ "type": "reasoning",
20
+ "summary": [
21
+ {
22
+ "type": "summary_text",
23
+ "text": "**Defining core functionalities**\n\nI need to outline core functionalities, focusing on aspects like multi-endpoint API, AI integration, and CLI testing. Each functionality should be described clearly and concisely. For the multi-endpoint API, I might explain its role in allowing different interfaces to interact efficiently. Regarding AI integration, I can highlight how it enhances automation and data processing. Finally, for CLI testing, I'll emphasize enabling user interaction through the command line, streamlining testing processes. I'll ensure the explanations are specific yet straightforward."
24
+ }
25
+ ]
26
+ },
27
+ {
28
+ "id": "msg_6863d93a45508192919451d43bb4462b0019502d0d1a63e8",
29
+ "type": "message",
30
+ "status": "completed",
31
+ "content": [
32
+ {
33
+ "type": "output_text",
34
+ "annotations": [],
35
+ "logprobs": [],
36
+ "text": "The project's core functionalities include:\n\n1. Multiple API endpoints that support various AI model integrations.\n2. A command-line interface for testing and interacting with the endpoints.\n3. System integration capabilities, making it adaptable for deployment in other projects.\n4. Minimal external dependencies, leveraging Node.js 22 and modern JavaScript (ES2022).\n5. A modular design that allows for easy extension of both API and CLI functionalities.\n\nLet me know if you'd like more details on any specific functionality."
37
+ }
38
+ ],
39
+ "role": "assistant"
40
+ }
41
+ ],
42
+ "parallel_tool_calls": true,
43
+ "previous_response_id": null,
44
+ "reasoning": {
45
+ "effort": "low",
46
+ "summary": "detailed"
47
+ },
48
+ "service_tier": "default",
49
+ "store": false,
50
+ "temperature": 1,
51
+ "text": {
52
+ "format": {
53
+ "type": "text"
54
+ }
55
+ },
56
+ "tool_choice": "auto",
57
+ "tools": [
58
+ {
59
+ "type": "function",
60
+ "description": "Execute a Bash command on Ubuntu 25.04 x86_64GNU/Linux and with xdg-open ,msmtp ,node ,curl.",
61
+ "name": "execute_bash",
62
+ "parameters": {
63
+ "type": "object",
64
+ "properties": {
65
+ "command": {
66
+ "type": "string",
67
+ "description": "The bash command."
68
+ }
69
+ },
70
+ "required": [
71
+ "command"
72
+ ]
73
+ },
74
+ "strict": true
75
+ },
76
+ {
77
+ "type": "function",
78
+ "description": "Execute ESM ES6 javascript on `node`.",
79
+ "name": "execute_javascript",
80
+ "parameters": {
81
+ "type": "object",
82
+ "properties": {
83
+ "script": {
84
+ "type": "string",
85
+ "description": "ES6 ESM Javascript to execute"
86
+ }
87
+ },
88
+ "required": [
89
+ "script"
90
+ ]
91
+ },
92
+ "strict": true
93
+ }
94
+ ],
95
+ "top_logprobs": 0,
96
+ "top_p": 1,
97
+ "truncation": "disabled",
98
+ "usage": {
99
+ "input_tokens": 321,
100
+ "input_tokens_details": {
101
+ "cached_tokens": 0
102
+ },
103
+ "output_tokens": 99,
104
+ "output_tokens_details": {
105
+ "reasoning_tokens": 0
106
+ },
107
+ "total_tokens": 420
108
+ },
109
+ "user": null,
110
+ "metadata": {}
111
+ }
112
+ }
@@ -0,0 +1,96 @@
1
+ {
2
+ "status": 200,
3
+ "response": {
4
+ "id": "resp_685d593c2be081a3aead008d73a85ccb0c3ba89bbd579f4c",
5
+ "object": "response",
6
+ "created_at": 1750948156,
7
+ "status": "completed",
8
+ "background": false,
9
+ "error": null,
10
+ "incomplete_details": null,
11
+ "instructions": "You are an assistant for an administrative office. Respond precise and concise",
12
+ "max_output_tokens": 4000,
13
+ "max_tool_calls": null,
14
+ "model": "gpt-4.1-2025-04-14",
15
+ "output": [
16
+ {
17
+ "id": "fc_685d593ccbec81a3a82ce22587b0ea1f0c3ba89bbd579f4c",
18
+ "type": "function_call",
19
+ "status": "completed",
20
+ "arguments": "{}",
21
+ "call_id": "call_at1hBqHlVOXWvjs2d2KZnY6n",
22
+ "name": "get_date_time"
23
+ },
24
+ {
25
+ "id": "fc_685d593ce3dc81a3a78b88ed1f9c80d50c3ba89bbd579f4c",
26
+ "type": "function_call",
27
+ "status": "completed",
28
+ "arguments": "{\"location\":\"Amsterdam, The Netherlands\"}",
29
+ "call_id": "call_e233mDWoMkYk1uwbaHj4T9kF",
30
+ "name": "get_current_weather"
31
+ }
32
+ ],
33
+ "parallel_tool_calls": true,
34
+ "previous_response_id": null,
35
+ "reasoning": {
36
+ "effort": null,
37
+ "summary": null
38
+ },
39
+ "service_tier": "default",
40
+ "store": false,
41
+ "temperature": 1,
42
+ "text": {
43
+ "format": {
44
+ "type": "text"
45
+ }
46
+ },
47
+ "tool_choice": "auto",
48
+ "tools": [
49
+ {
50
+ "type": "function",
51
+ "description": "Get the current weather in a given location",
52
+ "name": "get_current_weather",
53
+ "parameters": {
54
+ "type": "object",
55
+ "properties": {
56
+ "location": {
57
+ "type": "string",
58
+ "description": "The city and country"
59
+ }
60
+ },
61
+ "required": [
62
+ "location"
63
+ ]
64
+ },
65
+ "strict": true
66
+ },
67
+ {
68
+ "type": "function",
69
+ "description": "Get the current date and time",
70
+ "name": "get_date_time",
71
+ "parameters": {
72
+ "type": "object",
73
+ "properties": {}
74
+ },
75
+ "strict": true
76
+ }
77
+ ],
78
+ "top_p": 1,
79
+ "truncation": "disabled",
80
+ "usage": {
81
+ "input_tokens": 134,
82
+ "input_tokens_details": {
83
+ "cached_tokens": 0
84
+ },
85
+ "output_tokens": 46,
86
+ "output_tokens_details": {
87
+ "reasoning_tokens": 0
88
+ },
89
+ "total_tokens": 180
90
+ },
91
+ "user": null,
92
+ "metadata": {}
93
+ },
94
+ "headers": {},
95
+ "responseType": "js"
96
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "status": 200,
3
+ "response": {
4
+ "id": "2ebef507-bb45-4f25-bf52-87640fa092de",
5
+ "object": "chat.completion",
6
+ "created": 1751032835,
7
+ "model": "grok-3",
8
+ "choices": [
9
+ {
10
+ "index": 0,
11
+ "message": {
12
+ "role": "assistant",
13
+ "content": "\n",
14
+ "tool_calls": [
15
+ {
16
+ "id": "call_43974044",
17
+ "function": {
18
+ "name": "get_date_time",
19
+ "arguments": "{}"
20
+ },
21
+ "type": "function"
22
+ },
23
+ {
24
+ "id": "call_08990177",
25
+ "function": {
26
+ "name": "get_current_weather",
27
+ "arguments": "{\"location\":\"Amsterdam, The Netherlands\"}"
28
+ },
29
+ "type": "function"
30
+ }
31
+ ],
32
+ "refusal": null
33
+ },
34
+ "finish_reason": "stop"
35
+ }
36
+ ],
37
+ "usage": {
38
+ "prompt_tokens": 352,
39
+ "completion_tokens": 52,
40
+ "total_tokens": 404,
41
+ "prompt_tokens_details": {
42
+ "text_tokens": 352,
43
+ "audio_tokens": 0,
44
+ "image_tokens": 0,
45
+ "cached_tokens": 6
46
+ },
47
+ "completion_tokens_details": {
48
+ "reasoning_tokens": 0,
49
+ "audio_tokens": 0,
50
+ "accepted_prediction_tokens": 0,
51
+ "rejected_prediction_tokens": 0
52
+ },
53
+ "num_sources_used": 0
54
+ },
55
+ "system_fingerprint": "fp_be0739e203"
56
+ },
57
+ "headers": {},
58
+ "responseType": "js"
59
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "status": 200,
3
+ "responseType": "js",
4
+ "response": {
5
+ "id": "bf3d0a13-75f8-e2e5-4eab-93b4f20611cd",
6
+ "object": "chat.completion",
7
+ "created": 1751356925,
8
+ "model": "grok-3",
9
+ "choices": [
10
+ {
11
+ "index": 0,
12
+ "message": {
13
+ "role": "assistant",
14
+ "content": "Today is Friday, May 12, 2025, and the time is 12:45. The current weather in Amsterdam, The Netherlands, is 24°C.",
15
+ "refusal": null
16
+ },
17
+ "finish_reason": "stop"
18
+ }
19
+ ],
20
+ "usage": {
21
+ "prompt_tokens": 386,
22
+ "completion_tokens": 35,
23
+ "total_tokens": 421,
24
+ "prompt_tokens_details": {
25
+ "text_tokens": 386,
26
+ "audio_tokens": 0,
27
+ "image_tokens": 0,
28
+ "cached_tokens": 5
29
+ },
30
+ "completion_tokens_details": {
31
+ "reasoning_tokens": 0,
32
+ "audio_tokens": 0,
33
+ "accepted_prediction_tokens": 0,
34
+ "rejected_prediction_tokens": 0
35
+ },
36
+ "num_sources_used": 0
37
+ },
38
+ "system_fingerprint": "fp_be0739e203"
39
+ }
40
+ }