Skip to content

Commit 94fcaea

Browse files
committed
Update sheet builder prompt
1 parent 7b021b2 commit 94fcaea

File tree

2 files changed

+6
-52
lines changed

2 files changed

+6
-52
lines changed

llmstack/sheets/builder.py

Lines changed: 5 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,15 @@
1414
Promptly Sheets is a product similar to a spreadsheet, but can use LLMs to generate or analyze data.
1515
1616
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.).
1818
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.
1919
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.).
2320
2421
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.
2522
The formula will be executed in the context of the row and the values of the other cells in the row.
2623
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.
2724
When a cell address is used in a formula (eg., {{A1}}, {{B5}}, {{C12}} etc.), it will be replaced with the value of the cell.
2825
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-
3226
Following are the relevant schema models for columns, cells and formulas in Promptly Sheets:
3327
3428
---
@@ -51,63 +45,24 @@ class SheetCellStatus(int, Enum):
5145
5246
class SheetFormulaType(int, Enum):
5347
DATA_TRANSFORMER = 1
54-
PROCESSOR_RUN = 3
5548
AGENT_RUN = 4
5649
5750
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-
7251
7352
class DataTransformerFormulaData(SheetFormulaData):
7453
transformation_template: str # Liquid template language to transform the data from other cells
7554
7655
77-
class AgentRunFormulaDataConfig(BaseModel):
78-
system_message: Optional[str] = None
79-
max_steps: Optional[int] = 20
80-
split_tasks: Optional[bool] = True
81-
chat_history_limit: Optional[int] = 20
82-
temperature: Optional[float] = 0.7
83-
seed: Optional[int] = 222
84-
user_message: Optional[str] = "{{agent_instructions}}"
85-
86-
87-
class AgentRunFormulaDataProcessor(BaseModel):
88-
id: str
89-
name: str
90-
input: Optional[dict] = {}
91-
config: dict = {}
92-
description: str = ""
93-
provider_slug: str = ""
94-
processor_slug: str = ""
95-
output_template: Dict[str, Any] = {}
96-
97-
9856
class AgentRunFormulaData(SheetFormulaData):
99-
config: AgentRunFormulaDataConfig = AgentRunFormulaDataConfig()
100-
processors: List[AgentRunFormulaDataProcessor] = []
10157
agent_instructions: str = ""
10258
agent_system_message: str = ""
103-
type_slug: Literal["agent"] = "agent"
104-
output_template: Dict[str, Any] = {"markdown": "{{agent.content}}"}
59+
selected_tools: List[str] = [] # Available tools: web_search
10560
10661
10762
class SheetFormula(BaseModel):
10863
type: SheetFormulaType = SheetFormulaType.NONE
10964
data: Union[
110-
NoneFormulaData, ProcessorRunFormulaData, DataTransformerFormulaData, AgentRunFormulaData
65+
NoneFormulaData, DataTransformerFormulaData, AgentRunFormulaData
11166
]
11267
11368
@@ -125,7 +80,6 @@ class SheetCell(BaseModel):
12580
status: SheetCellStatus = SheetCellStatus.READY
12681
error: Optional[str] = None
12782
value: Optional[Any] = None
128-
formula: Optional[SheetFormula] = None
12983
spread_output: bool = False
13084
13185
---
@@ -208,8 +162,8 @@ class SheetCell(BaseModel):
208162
"properties": {
209163
"title": {"type": "string"},
210164
"col_letter": {"type": "string"},
211-
"cell_type": {"type": "string"},
212-
"width": {"type": "number"},
165+
"cell_type": {"type": "integer"},
166+
"width": {"type": "integer"},
213167
"formula": {"type": "object"},
214168
},
215169
},

llmstack/sheets/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class AgentRunFormulaData(SheetFormulaData):
105105
agent_system_message: str = ""
106106
selected_tools: List[str] = []
107107
type_slug: Literal["agent"] = "agent"
108-
output_template: Dict[str, Any] = {"markdown": "{{agent.content}}", "jsonpath": "$.agent.content"}
108+
output_template: Dict[str, Any] = {"markdown": "{{agent.content}}"}
109109

110110
@model_validator(mode="before")
111111
@classmethod

0 commit comments

Comments
 (0)