You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llmstack/sheets/builder.py
+5-51Lines changed: 5 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -14,21 +14,15 @@
14
14
Promptly Sheets is a product similar to a spreadsheet, but can use LLMs to generate or analyze data.
15
15
16
16
Similar to a spreadsheet, a cell is the smallest unit of data in Promptly Sheets. A sheet is organized as a grid of cells with columns and rows.
17
-
Columns are identified by a column letter (A, B, C .. Z, AA, AB, etc.) and rows are identified by a row number (1, 2, 3, etc.).
17
+
Each cell is identified by its column letter and row number (e.g. A1, B5, C12, etc.). A range of cells is identified by its starting cell and ending cell separated by a dash (e.g. A1-B5, C1-D5, etc.).
18
18
Each cell will have a value, which can be a string, number, or other data type. A cell can also have a formula that uses other cells in the sheet to generate a value for the cell.
19
19
A user can optionally specify a formula for a column that will be used to generate the values for the cells in that column.
20
-
A formula can be specified at a cell level too to generate a value for a specific cell or to spread over a range of cells with the current cell as the starting cell.
21
-
22
-
Each cell is identified by its column letter and row number (e.g. A1, B5, C12, etc.). A range of cells is identified by its starting cell and ending cell separated by a dash (e.g. A1-B5, C1-D5, etc.).
23
20
24
21
Sheet is processed row by row. The user can specify a formula for a column that will be used to generate the values for the cells in that column.
25
22
The formula will be executed in the context of the row and the values of the other cells in the row.
26
23
To refer to the values of other cells in the same row, use the cell address with the column letter wrapped in double curly brackets (e.g. {{A}}, {{B}} etc.). We internally use liquid template language to render the formula.
27
24
When a cell address is used in a formula (eg., {{A1}}, {{B5}}, {{C12}} etc.), it will be replaced with the value of the cell.
28
25
29
-
When specifying the formula at a cell level, the formula will have access to data in cells above and to the left of the current cell.
30
-
This is because the sheet is processed column by column and row by row. In this case, when we use {{A}}, the formula will have access to all the cells in column A.
31
-
32
26
Following are the relevant schema models for columns, cells and formulas in Promptly Sheets:
33
27
34
28
---
@@ -51,63 +45,24 @@ class SheetCellStatus(int, Enum):
51
45
52
46
class SheetFormulaType(int, Enum):
53
47
DATA_TRANSFORMER = 1
54
-
PROCESSOR_RUN = 3
55
48
AGENT_RUN = 4
56
49
57
50
58
-
class SheetFormulaData(BaseModel):
59
-
max_parallel_runs: Optional[int] = None
60
-
61
-
62
-
class ProcessorRunFormulaData(SheetFormulaData):
63
-
provider_slug: str
64
-
processor_slug: str
65
-
input: dict = {}
66
-
config: dict = {}
67
-
output_template: dict = {
68
-
"markdown": "",
69
-
"jsonpath": "",
70
-
}
71
-
72
51
73
52
class DataTransformerFormulaData(SheetFormulaData):
74
53
transformation_template: str # Liquid template language to transform the data from other cells
0 commit comments