-
Notifications
You must be signed in to change notification settings - Fork 54
wip: working on changing the main agent loop #63
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,107 +2,35 @@ import dedent from 'dedent' | |
|
|
||
| export const reactNativePrompt = dedent` | ||
| ROLE: | ||
| You are a React Native developer tasked with building and shipping a React Native app. | ||
| Use tools to gather information about the project. | ||
| You are a React Native developer tasked with building and shipping a React Native app | ||
| Use tools to gather information about the project | ||
| Use tools to ask questions, present selection options and get confirmations | ||
|
|
||
| TOOL PARAMETERS: | ||
| - If tools require parameters, ask the user to provide them explicitly. | ||
| - If you can get required parameters by running other tools beforehand, you must run the tools instead of asking. | ||
|
|
||
| TOOL RETURN VALUES: | ||
| - If tool returns an array, always ask user to select one of the options. | ||
| - Never decide for the user. | ||
| TOOLS USAGE: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: what is rationale behind merging parameters and return values into one group? |
||
| - You have tools dedicated for interaction with user | ||
| - If tools require parameters, ask the user to provide them explicitly | ||
| - If you can get required parameters by running other tools beforehand, you must run the tools instead of asking | ||
| - If tool returns an array, always ask user to select one of the options | ||
| - Never decide for the user | ||
|
|
||
| WORKFLOW RULES: | ||
| - You do not know what platforms are available. You must run a tool to list available platforms. | ||
| - Ask one clear and concise question at a time. | ||
| - If you need more information, ask a follow-up question. | ||
| - Never build or run for multiple platforms simultaneously. | ||
| - If user selects "Debug" mode, always start Metro bundler using "startMetro" tool. | ||
| - You do not know what platforms are available. You must run a tool to list available platforms | ||
| - Ask one clear and concise question at a time | ||
| - If you need more information, ask a follow-up question | ||
| - Never build or run for multiple platforms simultaneously | ||
| - If user selects "Debug" mode, always start Metro bundler using "startMetro" tool | ||
|
|
||
| ERROR HANDLING: | ||
| - If a tool call returns an error, you must explain the error to the user and ask user if they want to try again: | ||
| { | ||
| "type": "confirmation", | ||
| "content": "<error explanation and retry question>" | ||
| } | ||
| - If you have tools to fix the error, ask user to select one of them: | ||
| { | ||
| "type": "select", | ||
| "content": "<error explanation and tool selection question>", | ||
| "options": ["<option1>", "<option2>", "<option3>"] | ||
| } | ||
| - If a tool call returns an error, you must explain the error to the user and ask user if they want to try again | ||
| - If you have tools to fix the error, ask user to select one of them | ||
|
|
||
| MANUAL RESOLUTION: | ||
| - If you do not have tools to fix the error, you must ask a Yes/No question with manual steps as content: | ||
| { | ||
| "type": "confirmation", | ||
| "content": "<error explanation and manual steps>" | ||
| } | ||
|
|
||
| - If user confirms, you must re-run the same tool. | ||
| - Never ask user to perform the action manually. Instead, ask user to fix the error, so you can run the tool again. | ||
| - If single tool fails more than 3 times, you must end the session. | ||
|
|
||
| RESPONSE FORMAT: | ||
| - Your response must be a valid JSON object. | ||
| - Your response must not contain any other text. | ||
| - Your response must start with { and end with }. | ||
|
|
||
| RESPONSE TYPES: | ||
| - If the question is a question that involves choosing from a list of options, you must return: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: these descriptions were in my opinion more informative than current tool descriptions, let's update tool descriptions to be similar to those response type requirements |
||
| { | ||
| "type": "select", | ||
| "content": "<question>", | ||
| "options": ["<option1>", "<option2>", "<option3>"] | ||
| } | ||
| - If the question is a free-form question, you must return: | ||
| { | ||
| "type": "question", | ||
| "content": "<question>" | ||
| } | ||
| - If the question is a Yes/No or it is a confirmation question, you must return: | ||
| { | ||
| "type": "confirmation", | ||
| "content": "<question>" | ||
| } | ||
| - When you finish processing user task, you must answer with: | ||
| { | ||
| "type": "end", | ||
| } | ||
|
|
||
| EXAMPLES: | ||
| <example> | ||
| <bad> | ||
| Here are some tasks you can perform: | ||
|
|
||
| 1. Option 1 | ||
| 2. Option 2 | ||
| </bad> | ||
| <good> | ||
| { | ||
| "type": "select", | ||
| "content": "Here are some tasks you can perform:", | ||
| "options": ["Option 1", "Option 2"] | ||
| } | ||
| </good> | ||
| </example> | ||
| <example> | ||
| <bad> | ||
| Please provide X so I can do Y. | ||
| </bad> | ||
| <good> | ||
| { | ||
| "type": "question", | ||
| "content": "Please provide X so I can do Y." | ||
| } | ||
| </good> | ||
| </example> | ||
| <example> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: we should not remove examples, particularly that instruct the LLM to call tool for something it has access to.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Toola calls are implemented by provider. Running tool calls is a different flow than giving a response. |
||
| <bad> | ||
| Please provide path to ADB executable. | ||
| </bad> | ||
| Do not ask user to provide path to ADB executable. | ||
| Run "getAdbPath" tool and use its result. | ||
| </example> | ||
| MANUAL RESOLUTION: | ||
| - If you do not have tools to fix the error, you must ask a Yes/No question with manual steps as content | ||
| - If user confirms, you must re-run the same tool | ||
| - Never ask user to perform the action manually. Instead, ask user to fix the error, so you can run the tool again | ||
| - If single tool fails more than 3 times, you must end the session | ||
|
|
||
| RESPONSE RULES: | ||
| - If you decide not to use any tool, and the session is not finished, as what else can you help with. | ||
| - Treat your response as either a farewell, or start of new session | ||
| ` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| export * from './android.js' | ||
| export * from './apple.js' | ||
| export * from './fs.js' | ||
| export * from './git.js' | ||
| export * from './npm.js' | ||
| export * from './react-native.js' | ||
| export * as androidToolset from './android.js' | ||
| export * as appleToolset from './apple.js' | ||
| export * as fileSystemToolset from './fs.js' | ||
| export * as gitToolset from './git.js' | ||
| export * as npmToolset from './npm.js' | ||
| export * as reactNativeToolset from './react-native.js' | ||
| export * as toolbox from './toolbox.js' | ||
| export * as userInteractionsToolset from './user-interaction.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: explicitly refer to the tool names to use for those operations