Skip to content

AI assistant agent that can understand natural language instructions, decompose complex tasks into executable steps, and utilize the Rewoo/ReAct Reasoning or Debate Mode framework to enhance understanding and task breakdown.

License

Notifications You must be signed in to change notification settings

tbxy09/JustWondering

 
 

Repository files navigation

Hightlights

  • Mode Used : all prompt designed and tunned upon GPT-3.5
  • Reasonning Building: decompose complex tasks into executable steps, and leverages the Rewoo/ReAct Reasoning or Debate Mode framework to enhance understanding and task breakdown.
  • My strategy is to enhance the reasonning process, not the observation/action process during reasonning building, I create talks between developer and a coding worker, a debate mode to generate a multi turn progress to a more detail plan image]

Setup Azure API (added after Oct.26 for tester)

  • export AZURE_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxx
  • export AZURE_OPENAI_DEPLOYMENT_NAME= (I am using a gpt-3.5 16k model of Azure)
  • export AZURE_OPENAI_ENDPOINT=https://{endpoint_name}.openai.azure.com/
  • export AZURE_API_VERSION=2023-07-01-preview

Overall Flow

  • ReactChatAgent.run() is the main entry point, called by the client to execute an instruction
  • It calls _compose_prompt() to construct the prompt for the AI assistant
  • The prompt is sent to OpenAI API using _send_msg() to generate a response
  • _parse_output() processes the response to extract any tool actions
  • For each extracted action, the corresponding tool's run() is called based on _format_function_map()
  • The tool's run() calls internal methods like implement_code_changes() to execute that step
  • implement_code_changes() calls out to Codex for code generation
  • Generated artifacts are returned back up via the tool's run()
  • In ReactChatAgent, observations are used to construct context for next prompt
  • Loop continues until assistant indicates task is complete

Call Hierarchy

  • ReactChatAgent.run()
    • _compose_prompt()
      • _send_msg()
        • Azure GPT16k API
    • _parse_output()
      • _format_function_map()
        • Tool.run()
          • implement_code_changes()
            • Codex
  • Return back up call stack
    • Tool.run()
      • Returns observations
    • ReactChatAgent
      • Constructs context
      • Loops for next prompt

So in summary, ReactChatAgent.run() coordinates overall flow, prompts assistant, calls tools to execute steps, collects results for context, and loops until completion. Modular design allows extending with more tools.

Prompt Table

name anchor Description
talks_dev_coder justwondering/forge/prompts/talks_dev_coder.md the prompts encourage a natural conversational flow with back-and-forth between the developer and coder.There are examples and guidance provided in the comments for how to format the responses.
execute_commands prompts/execute_commands.prompt work as observation_promp,constructs the prompt to collect observations after executing, also for debugging and prompt tunning
implement_task FUNCTION_CALL function call is designed to filter out the easy task to determine the task type and ability, such as reading or writing. No reasoning is needed for non-coding tasks, as they will directly go into a bash shell tool. However, coding tasks that require reasoning will lead to a reasoning process.

Prompt borrowed from gptpilot

Call Prompt Schema Functions
convo.send_message('development/task/request_files_for_code_changes.prompt', step_data) request_files_for_code_changes.prompt step_data
convo.send_message('development/implement_changes.prompt', impl_data, IMPLEMENT_CHANGES) implement_changes.prompt impl_data IMPLEMENT_CHANGES

About

AI assistant agent that can understand natural language instructions, decompose complex tasks into executable steps, and utilize the Rewoo/ReAct Reasoning or Debate Mode framework to enhance understanding and task breakdown.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 61.3%
  • Python 26.3%
  • Jupyter Notebook 7.8%
  • Dart 3.2%
  • C++ 0.4%
  • TypeScript 0.3%
  • Other 0.7%