refactor: demo agent with LLM_AGENT_VAR_* (#82)

This commit is contained in:
sigoden
2024-07-30 15:09:18 +08:00
committed by GitHub
parent 213d1b3fd7
commit 3e8b7b2e45
3 changed files with 19 additions and 16 deletions
+16 -13
View File
@@ -21,21 +21,26 @@ variables:
When use define variables, please avoid these built-in variables:
| name | description | example |
| :------------ | :-------------------------------------------- | :----------------------- |
| __os__ | Operating system name | linux |
| __os_family__ | Operating system family | unix |
| __arch__ | System architecture | x86_64 |
| __shell__ | Current user's default shell | bash |
| __locale__ | User's preferred language and region settings | en-US |
| __now__ | Current timestamp in ISO 8601 format | 2024-07-29T08:11:24.367Z |
| __cwd__ | Current working directory | /tmp |
| name | description | example |
| :-------------- | :-------------------------------------------- | :----------------------- |
| `__os__` | Operating system name | linux |
| `__os_family__` | Operating system family | unix |
| `__arch__` | System architecture | x86_64 |
| `__shell__` | Current user's default shell | bash |
| `__locale__` | User's preferred language and region settings | en-US |
| `__now__` | Current timestamp in ISO 8601 format | 2024-07-29T08:11:24.367Z |
| `__cwd__` | Current working directory | /tmp |
| `__tools__` | List of agent tools | |
Variables should be used in the `instructions` field.
Variables can be used in the `instructions` and tools script.
```yaml
instructions: |
The instructions can inline user defined variables: {{foo}}, {{bar}} and builtin variables {{__shell__}}.
The instructions can access variables {{foo}} and {{bar}}.
```
```sh
echo "The tools script can access environment variables $LLM_AGENT_VAR_FOO and $LLM_AGENT_VAR_BAR"
```
### documents
@@ -53,8 +58,6 @@ documents:
The tool script implements agent-specific tools.
> You only need one of the `tools.sh`, `tools.js`, or `tools.py`.
## tools.txt
The `tools.txt` file enables tool reuse from the `/tools` folder in this project.