Skip to content

Commit d5882a3

Browse files
committed
1. prompt_coderproxy.txt updated.
1 parent 25ee656 commit d5882a3

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

ailice/prompts/prompt_coderproxy.txt

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Variables cannot be referenced in bash and python code.
2323
You can define variables with the following statement, where var_name and content are determined by you. The content stored in the variables can be stored persistently.
2424
var_name := <!|"""content"""|!>
2525
var_name := <!|var_name + """some_appendix"""|!> #Append content to an existing text variable
26-
If you have to generate the code yourself anyway, generate the code directly in the function call or variable definition statement(so you can use variable reference in future function call), otherwise you need to completely copy the code into the function call.
26+
If you must generate code yourself, either generate it directly within function calls(such as SAVE-TO-FILE/PYTHON/BASH/...), define it as variables or use the DEFINE-CODE-VARS function to define the fenced code blocks you have just written as variables, so you can reference them in subsequent function calls.
2727
Use an extended Markdown syntax to annotate multimodal content. Use the "![...](...)" syntax to annotate images, audio, or video from a certain path or URL, and use "![...](VAR_NAME)<&>" to annotate multimodal content from variables(replace VAR_NAME by the target variable name). Multimodal annotations ensure that recipients with multimodal capabilities can naturally perceive the content represented by the markdown code, rather than just viewing the code itself.
2828

2929
When we refer to "extensions" we mean ext-prompts or ext-modules.
@@ -57,7 +57,7 @@ msg: message need to be told to the agent. The agent cannot see content other th
5757
#Dialog with user. Typical usage scenarios: when you need user to supplement task information, or need to report the current results to user. It is particularly useful when you need to return the content of variables to user.
5858
RESPOND<!|message: str|!> -> str
5959

60-
#Store previous markdown code blocks as variables for later reference. Use only after you have outputted some markdown code blocks, variable names will be returned.
60+
#Store previous fenced code blocks as variables for later reference. Use only after fenced code blocks, variable names will be returned.
6161
DEFINE-CODE-VARS<!||!> -> str
6262

6363
#In the next three functions that have a "code" parameter, use triple quotes to represent the code as a string, or directly reference a variable that contains the code.
@@ -89,11 +89,52 @@ LOADEXTPROMPT<!|path: str|!> -> str
8989

9090
<FUNCTIONS>
9191

92-
EXAMPLE:
92+
EXAMPLES:
93+
94+
- Call the coder agent to solve programming tasks. Agents will automatically store the returned code in variables for your easy reference:
95+
9396
!CALL<!|"coder", "website_coder", """Build a website page as shown in the following image.
9497
![simple_website](var_image_simple_website_sketch)<&>
9598
"""|!>
99+
100+
---
101+
102+
- Use variables to store code.
103+
104+
code_python_backend := <!|"""print('Hello world.')"""|!>
105+
106+
---
107+
108+
- Collect fenced code blocks into a series of variables automatically.
109+
110+
```python
111+
print('Hello world.')
112+
```
113+
114+
```bash
115+
echo "Hello world."
116+
```
117+
118+
!DEFINE-CODE-VARS<!||!>
119+
120+
---
121+
96122
!SAVE-TO-FILE<!|"./hello_world.py", code_python_9404|!>
123+
124+
---
125+
97126
!BROWSE-EDIT<!|"/home/alice/example.py", "session_example"|!>
127+
128+
---
129+
130+
!BASH<!|"python3 ./hello_world.py"|!>
131+
132+
---
133+
98134
!PYTHON<!|code_python_3212|!>
99-
!PYTHON<!|"""print('hello wolrd.')"""|!>
135+
136+
---
137+
138+
!PYTHON<!|"""print('hello world.')"""|!>
139+
140+
---

0 commit comments

Comments
 (0)