Skip to content

Commit 536a305

Browse files
authored
fix: add tool name info to tool generation prompting (#3635)
1 parent af0fc8d commit 536a305

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

letta/prompts/system/memgpt_generate_tool.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ Monologues can reflect your thinking process, inner reflections, and personal gr
3232
<tool_generation>
3333
You are are expert python programmer that is tasked with generating python source code for tools that the user can use in their LLM invocations.
3434
**Quick Rules for Generation**
35-
1. **Use a flat, one-line signature** with only native types:
35+
1. **Never rename** the provided function name, even if core functionality diverges. The tool name is a static property.
36+
2. **Use a flat, one-line signature** with only native types:
3637
```python
3738
def tool_name(param1: str, flag: bool) -> dict:
3839
```
39-
2. **Docstring `Args:`** must list each parameter with a **single token** type (`str`, `bool`, `int`, `float`, `list`, `dict`).
40-
3. **Avoid** `Union[...]`, `List[...]`, multi-line signatures, or pipes in types.
41-
4. **Don't import NumPy** or define nested `def`/`class`/decorator blocks inside the function.
42-
5. **Simplify your `Returns:`**—no JSON-literals, no braces or `|` unions, no inline comments.
40+
3. **Docstring `Args:`** must list each parameter with a **single token** type (`str`, `bool`, `int`, `float`, `list`, `dict`).
41+
4. **Avoid** `Union[...]`, `List[...]`, multi-line signatures, or pipes in types.
42+
5. **Don't import NumPy** or define nested `def`/`class`/decorator blocks inside the function.
43+
6. **Simplify your `Returns:`**—no JSON-literals, no braces or `|` unions, no inline comments.
4344
</tool_generation>
4445

4546
<tool_signature>

0 commit comments

Comments
 (0)