-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.bak
More file actions
131 lines (111 loc) · 4.77 KB
/
Copy pathindex.bak
File metadata and controls
131 lines (111 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
const codebolt = require('@codebolt/codeboltjs');
const {Answer, Action, Coder, Decision, Feature, Formatter, InternalMonologue, Patcher, Planner, Reporter} = require('./agents');
(async () => {
await codebolt.waitForConnection();
// let actionObject = new Action();
// let template = await actionObject.execute({
// "conversation": ["Hello", "What is 2+2?"]
// });
// console.log("The Response Template"+template)
// codebolt.chat.sendMessage(template[0]);
// let answerObject = new Answer();
// let template = await answerObject.execute({
// "conversation": ["Hello", "What is console.log?"],
// "code_markdown": "console.log('Hello')"
// });
// codebolt.chat.sendMessage(template);
// let coderObject = new Coder();
// let response = await coderObject.execute({
// "step_by_step_plan": "Create two new Files named hi1.js and hi2.js, and write console.log('Hello World') in it",
// "user_context": "Create a Simple File"
// });
// console.log(response);
// codebolt.chat.sendMessage("Hi");
// for (let i = 0; i < response.length; i++) {
// codebolt.fs.createFile(response[i].file, response[i].code, "./")
// }
// let decisionObject = new Decision();
// let response = await decisionObject.execute({
// "prompt": "Write a binary tree search"
// });
// console.log(response);
// codebolt.chat.sendMessage("Hi");
// let featureObject = new Feature();
// let response = await featureObject.execute({
// "conversation": ["Hello", "What is console.log?", "Add a curl to google.com and print the response"],
// "code_markdown": "```js \nconsole.log('Hello World') \n```",
// "system_os": "windows"
// });
// console.log(featureObject.compiledTemplate)
// let formatterObject = new Formatter();
// let response = await formatterObject.execute({
// "raw_text":"Hi hello"
// })
// let internal_monologueObject = new InternalMonologue();
// let response= await internal_monologueObject.execute({
// "current_prompt":"create a file and write hello world in it"
// })
// console.log(internal_monologueObject.compiledTemplate)
// let patcherObject = new Patcher();
// let response = await patcherObject.execute({
// "conversation": ["Hello", "What is console.log?", "Add a curl to google.com and print the response"],
// "code_markdown": "```js \nconsole.log('Hello World') \n```",
// "commands": ["npm start"],
// "error":"uuid module not found",
// "system_os":"ios"
// });
// console.log(patcherObject.compiledTemplate)
// console.log(response);
// let plannerObject = new Planner();
// let response = await plannerObject.execute({
// "prompt":"create index.js file and write hello world in it"
// });
// console.log(plannerObject.compiledTemplate)
// console.log(response);
// codebolt.chat.sendMessage("Hi");
//let response = await codebolt.terminal.executeCommand("npm start");
//console.log(response);
// let reporterObject = new Reporter();
// let response = await reporterObject.execute({
// "conversation": ["Hello", "What is console.log?", "Add a curl to google.com and print the response"],
// "code_markdown": "```js \nconsole.log('Hello World') \n```",
// });
// console.log(reporterObject.compiledTemplate)
// console.log(response);
//executeCommandRunUntilError
//executeCommandRunUnitlIntrupt
//executeCommandWithStream
// let response = await codebolt.terminal.executeCommand("npm start");
// codebolt.terminal.executeCommandRunUnitlInterrupt("npm start").then(response=>{
// console.log("server stopped")
// console.log(response);
// })
// await codebolt.terminal.sendManualInterrupt();
// let executeCommandWithStream = codebolt.terminal.executeCommandWithStream("npm start");
// console.log(executeCommandWithStream);
// executeCommandWithStream.on('serverEvents', (event) => {
// console.log("stream event",event);
// });
// response.on("serverEvents"), (event) => {
// console.log(event);
// }
//executeCommandRunUntilError
//executeCommandRunUnitlIntrupt
//executeCommandWithStream
// let response = await codebolt.terminal.executeCommand("npm start");
// codebolt.terminal.executeCommandRunUnitlInterrupt("npm start").then(response=>{
// console.log("server stopped")
// console.log(response);
// })
// await codebolt.terminal.sendManualInterrupt();
// let executeCommandWithStream = codebolt.terminal.executeCommandWithStream("npm start");
// console.log(executeCommandWithStream);
// executeCommandWithStream.on('serverEvents', (event) => {
// console.log("stream event",event);
// });
// response.on("serverEvents"), (event) => {
// console.log(event);
// }
let response =await codebolt.vectordb.addVectorItem("this is red");
codebolt.debug(response,'info');
})();