refactor: demo agent with LLM_AGENT_VAR_* (#82)
This commit is contained in:
@@ -140,7 +140,7 @@ documents:
|
|||||||
- https://example.com/remote-file.txt
|
- https://example.com/remote-file.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
Refer to `./agents/todo-{sh,js,py}` for examples of how to implement a agent.
|
Refer to [./agents/demo](https://github.com/sigoden/llm-functions/tree/main/agents/demo) for examples of how to implement a agent.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
+16
-13
@@ -21,21 +21,26 @@ variables:
|
|||||||
|
|
||||||
When use define variables, please avoid these built-in variables:
|
When use define variables, please avoid these built-in variables:
|
||||||
|
|
||||||
| name | description | example |
|
| name | description | example |
|
||||||
| :------------ | :-------------------------------------------- | :----------------------- |
|
| :-------------- | :-------------------------------------------- | :----------------------- |
|
||||||
| __os__ | Operating system name | linux |
|
| `__os__` | Operating system name | linux |
|
||||||
| __os_family__ | Operating system family | unix |
|
| `__os_family__` | Operating system family | unix |
|
||||||
| __arch__ | System architecture | x86_64 |
|
| `__arch__` | System architecture | x86_64 |
|
||||||
| __shell__ | Current user's default shell | bash |
|
| `__shell__` | Current user's default shell | bash |
|
||||||
| __locale__ | User's preferred language and region settings | en-US |
|
| `__locale__` | User's preferred language and region settings | en-US |
|
||||||
| __now__ | Current timestamp in ISO 8601 format | 2024-07-29T08:11:24.367Z |
|
| `__now__` | Current timestamp in ISO 8601 format | 2024-07-29T08:11:24.367Z |
|
||||||
| __cwd__ | Current working directory | /tmp |
|
| `__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
|
```yaml
|
||||||
instructions: |
|
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
|
### documents
|
||||||
@@ -53,8 +58,6 @@ documents:
|
|||||||
|
|
||||||
The tool script implements agent-specific tools.
|
The tool script implements agent-specific tools.
|
||||||
|
|
||||||
> You only need one of the `tools.sh`, `tools.js`, or `tools.py`.
|
|
||||||
|
|
||||||
## tools.txt
|
## tools.txt
|
||||||
|
|
||||||
The `tools.txt` file enables tool reuse from the `/tools` folder in this project.
|
The `tools.txt` file enables tool reuse from the `/tools` folder in this project.
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ name: Demo
|
|||||||
description: This is demo agent.
|
description: This is demo agent.
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
instructions: |
|
instructions: |
|
||||||
You are a AI agent designed to demonstrate agent capabilities.
|
You are a AI agent designed to demonstrate agent capabilities.
|
||||||
|
|
||||||
<tools>
|
<tools>
|
||||||
__TOOLS__
|
{{__tools__}}
|
||||||
</tools>
|
</tools>
|
||||||
|
|
||||||
<system>
|
<system>
|
||||||
|
|||||||
Reference in New Issue
Block a user