-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code capability enhancement & Bot crash fix #272
base: main
Are you sure you want to change the base?
Code capability enhancement & Bot crash fix #272
Conversation
ecaf5e8
to
02232e2
Compare
…e-exception-fixes' into Tasks-more-relevant-docs-and-code-exception-fixes # Conflicts: # src/agent/coder.js # src/agent/prompter.js
Resolve merge conflicts with the latest codeNew additions
|
Can you try re-running this with a stupider model (not state-of-the-art lol). I'm curious to see if they benefit too, or just advanced ones. |
Comparison Experiment on Low-Performance Models1. ObjectiveThe objective is set using the following command: 2. Model SelectionFirst, I tested the lowest-performance model, gpt-3.5-turbo, but it could not limit itself to using only 3. Experimental Process
4. Experimental Results4.1 OriginalTotal run time: 16 minutes 41 seconds.
4.2 ModifiedI didn’t give any reminders to the bot while it was running.
4.3 Complete Comparison VideoTotal duration: 16 minutes 41 seconds. |
e1dfad9
to
0a21561
Compare
…e-exception-fixes' into Tasks-more-relevant-docs-and-code-exception-fixes # Conflicts: # src/agent/coder.js
Resolved merge conflict with Action Manager |
f6e309a
to
a6edd8f
Compare
…e-exception-fixes' into Tasks-more-relevant-docs-and-code-exception-fixes # Conflicts: # src/agent/prompter.js
There is a part that needs improvement |
Improve the relevance of docs to !newAction("task")Fix Qwen api concurrency limit issue |
Last Modified Time: November 10, 2024, 5:53 PM
Latest changes are as follows:
Improvement Effects
Model: GPT-4o
Initial Command:
!goal("Your goal is: use only "!newAction" instructions and rely only on code execution to obtain a diamond pickaxe. You must complete this task step by step and by yourself. And can't use another "!command". You should promptly check to see what you have.")
Effect: After testing, under the condition of relying solely on generated code, the bot can run stably for at least 30 minutes without crashing (I manually ended the process at 30 minutes), during which it executed over 130 validated code snippets.
Remaining Issues:
WARNING: If you use the command above or set a goal that requires a long time to work, please pay attention to the execution status and token consumption, as the LLM may continuously generate code in certain situations. For example, when "an iron pickaxe is available and diamonds need to be mined," it might stand still using its code abilities to search for nearby diamond locations. Since diamonds are rare, it may fail to find them continuously, repeatedly improving the code and getting stuck, leading to substantial token consumption.Please test with caution, it cost me $60 to test with gpt-4o for 60min. But gpt-4o-mini is much cheaper and can be used to test this command
Added Features:
2.1 During code generation, the top
select_num
relevant skillsDocs related to!newAction("task")
will be selected and sent to the LLM in the prompt to help it focus better on thetask
. Currently,select_num
is set to 5.2.2 Before running the code, use ESLint to perform syntax and exception checks on the generated code to detect issues in advance, check for undefined functions, and add exceptions to messages.
2.3 During code execution, detailed error information will be included in messages.
Added Files:
3.1 file path: ./bots/codeCheckTemplate.js
A template used for performing checks before code execution. ESLint cannot be used for detection in the sandbox.
3.2 file path: ./eslint.config.js
Manages the ESLint rules for code syntax and exception detection.
Modified Code Content:
4.1 package.json
- Added: ESLint dependency.
4.2 settings.js
- Set:
code_timeout_mins=3
, ensuring timely code execution updates and preventing long blocks.4.3 coder.js
- Added:
checkCode
function to pre-check for syntax and exceptions. First, it checks whether the functions used in the code exist. If they don't, it writes the illegal functions to themessage
, then proceeds with syntax and exception checks.- Modified: Modified the return value of
stageCode
function fromreturn { main: mainFn };
toreturn { func: { main: mainFn }, src_check_copy: src_check_copy };
to ensure pre-execution exception detection.4.4 action_manager.js
- Enhanced:
catch (err)
error detection to include detailed exception content and related code Docs in messages, improving the LLM's ability to fix code.4.5 index.js
- Modified:
docHelper
andgetSkillDocs
return values to return the docArray of functions from the skill library for subsequent word embedding vector calculations.4.6 prompter.js
- Added:
this.skill_docs_embeddings = {};
to store the docArray word embedding vectors.- Added: Parallel initialization of
this.skill_docs_embeddings
ininitExamples
.- Added:
getRelevantSkillDocs function
to obtainselect_num
relevant doc texts based on input messages and select_num. If select_num >= 0, it is meaningful; otherwise, return all content sorted by relevance.Note: This modification ensures code quality by making minimal changes only where necessary, while also clearing test outputs and comments. If further modifications are needed, please feel free to let me know.