Documentation Index
Fetch the complete documentation index at: https://docs.poly.ai/llms.txt
Use this file to discover all available pages before exploring further.
This page requires Python familiarity. PolyAI’s function runtime executes Python in a managed cloud sandbox. Only the standard library and the packages listed below are available. You cannot install additional packages. If you need a library that is not listed, contact your PolyAI representative.
Execution environment
Functions run in a sandboxed cloud environment. This means:- No local file system access – you cannot read or write files from your machine (e.g., CSV files, text files, or databases stored locally).
- No package installation – only the standard library and the pre-installed packages listed below are available.
- Network access – you can make outbound HTTP requests using the
requestslibrary to call external APIs or fetch hosted data.
requests.
Standard library
Within functions you have access to the full Python standard library, including modules likedatetime, json, re, urllib, and hashlib.
Notable language features
The runtime supports modern Python language features, including:- Structural pattern matching (
match/case, Python 3.10+) – a cleaner alternative to longif/elifchains for branching on values or structures. See the Python docs on match statements. - Parenthesized context managers (Python 3.10+) – you can use parentheses to split multiple context managers across lines:
- Exception Groups and
except*(Python 3.11+) – handle multiple exceptions raised concurrently. Useful when your function makes parallel API calls. See PEP 654.
Pre-installed packages
The following packages are pre-installed and available forimport:
| Library | Description |
|---|---|
| requests | HTTP library for making API requests |
| urllib3 | Low-level HTTP client |
| jsonschema | JSON schema validation |

