Refactor read_file and ripgrep tools to implement file reading and searching functionalities. The read_file tool now validates paths within a restricted directory and handles line skipping and reading limits. The ripgrep tool is implemented to perform pattern searches with optional flags for line numbers and case sensitivity, enhancing search capabilities and error handling.
This commit is contained in:
11
cli.js
11
cli.js
@@ -48,8 +48,7 @@ async function loadTools() {
|
||||
return Object.fromEntries(toolEntries);
|
||||
}
|
||||
|
||||
streamOnce(new OpenAI({ apiKey: 'csk-8jftdte6r6vf8fdvp9xkyek5t3jnc6jfhh93d3ewfcwxxvh9', baseURL: "https://api.cerebras.ai/v1"}), 'Erstelle eine React Project für eine Abovverwaltung. Mui, Sqllite, Express, Nodejs, KEIN Typescript, Aber ESM import. webpack, kein vite. HRM, nodemon');
|
||||
//streamOnce(new OpenAI({ apiKey: process.env.OPENAI_API_KEY }), 'Erstelle eine React Project für eine Abovverwaltung. Mui, Sqllite, Express, Nodejs, KEIN Typescript, Aber ESM import. webpack, kein vite. HRM, nodemon');
|
||||
streamOnce(new OpenAI({ apiKey: process.env.OPENAI_API_KEY }), 'Erstelle eine React Project für eine Abovverwaltung. Mui, Sqllite, Express, Nodejs, KEIN Typescript, Aber ESM import. webpack, kein vite. HRM, nodemon');
|
||||
|
||||
|
||||
let counter = 0;
|
||||
@@ -65,7 +64,7 @@ async function streamOnce(openai, userText) {
|
||||
while(input.length > 0){
|
||||
|
||||
const call = {
|
||||
model: 'gpt-oss-120b',
|
||||
model: 'gpt-5-mini',
|
||||
input: input,
|
||||
text: { format: { type: 'text' }, verbosity: 'high' },
|
||||
reasoning: { effort: 'medium', summary: 'detailed' },
|
||||
@@ -83,7 +82,7 @@ async function streamOnce(openai, userText) {
|
||||
previousResponseId = event.response.id;
|
||||
});
|
||||
stream.on('response.reasoning_summary_text.delta', (event) => {
|
||||
////process.stdout.write(event.delta);
|
||||
process.stdout.write('o')
|
||||
});
|
||||
stream.on('response.reasoning_summary_text.done', () => {
|
||||
process.stdout.write('\n');
|
||||
@@ -91,7 +90,7 @@ async function streamOnce(openai, userText) {
|
||||
});
|
||||
|
||||
stream.on('response.output_text.delta', (event) => {
|
||||
////process.stdout.write(event.delta);
|
||||
process.stdout.write('.')
|
||||
});
|
||||
|
||||
|
||||
@@ -101,7 +100,7 @@ async function streamOnce(openai, userText) {
|
||||
}
|
||||
});
|
||||
stream.on('response.function_call_arguments.delta', (event) => {
|
||||
////process.stdout.write(event.delta);
|
||||
process.stdout.write('x');
|
||||
});
|
||||
|
||||
const functionCalls = [];
|
||||
|
||||
Reference in New Issue
Block a user