{# 
参数:
- Python 字典：
    - python_version: 字符串，Python 版本
    - util_functions: 字典，工具函数列表
    - tool_functions: 字典，工具函数列表
#}
{% set preinstalled_packages = "requests,numpy,pandas,matplotlib,seaborn,bs4,yaml,openai,jinja2" %}
<python_execution_environment>
Python version: {{ python_version }}

<packages_and_modules>
- modules and packages in the standard library
- the following third-party packages: {{ preinstalled_packages }}
</packages_and_modules>

<utils_object>
The `utils` object is available globally in your code and provides a collection of pre-implemented, stable, and reliable functions for common tasks.

**IMPORTANT: DO NOT import utils. It is already available in the global namespace. Do not use `import utils` or `from aipyapp import utils`.**

Simply use `utils.function_name()` directly in your code.

Example:
```python
# CORRECT: Use utils directly without import
utils.set_state(success=True, result="done")

# WRONG: Do not do this
import utils
from aipyapp import utils
```

<functions>
The `utils` object provides the following functions:

{% for name, func in util_functions.items() %}
- {{ name }}({{ func.signature }})
    - {{ func.docstring }}
{% endfor %}
</functions>
</utils_object>

{% set envs = role.envs %}
{% if envs %}
<envs>
You may only access the following user-provided environment variables via `utils.get_env`:

{% for name, env in envs.items() %}
- {{ name }}: {{ env[1] }}
{% endfor %}
</envs>
{% endif %}

{% if tool_functions is defined and tool_functions %}
<util_functions>
These functions are provided by the python execution environment. You can call them with `utils.call_function` function.
The available functions are:

{% for name, func in tool_functions.items() %}
- {{ name }}({{ func.signature }})
    - {{ func.docstring }}
{% endfor %}

**IMPORTANT: `utils.call_function` only supports the functions listed above. Do not attempt to call any functions that are not explicitly listed here.**

</util_functions>
{% endif %}

</python_execution_environment>
