9. python — Run Python
Mode: Both · Category: Other · Copilot types: Internal, Chat
Executes Python code in a sandboxed environment. Operates in two modes:
Dynamic mode (no
code, orcodewithoutinput_schema/columns): The LLM writes and executes code freely.Static mode (
code+input_schemaand/orcolumns): Code is pre-defined by the creator. The LLM only fills the input variables declared ininput_schema. Data fromcolumnsis loaded as adfDataFrame before execution.
- id: python
- id: python
code: |
import pandas as pd
result = df[df['status'] == status_filter].shape[0]
print(f"Count: {result}")
columns:
- INVOICE.INVOICE_STATUS
- INVOICE.INVOICE_NUMBER
input_schema:
properties:
status_filter:
description: The status value to filter invoices by.
type: string- id: python
code: |
import pandas as pd
summary = df.describe()
print(summary.to_string())
columns:
- INVOICE.INVOICE_AMOUNT
- INVOICE.INVOICE_STATUS![]() |
Field | Type | Description |
|---|---|---|
| string | Pre-defined Python code. Setting this with |
| object | Input variable definitions — each property becomes an LLM argument. |
| list[string] | Column IDs loaded as a |
| bool | Allow the LLM to add ad-hoc filters to the data loading (default: |
