Skip to content

Commit ed3ba82

Browse files
committed
[UI] Update Column Usage Guide (#857)
1 parent a18a1db commit ed3ba82

File tree

2 files changed

+64
-30
lines changed

2 files changed

+64
-30
lines changed

services/app/src/lib/components/tables/(sub)/guides/llm.md

Lines changed: 56 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
### Basic Concept
1+
##### Basic Concept
22

3-
The **LLM Column** in a **Generative Table** lets you synthesize outputs using a Large Language Model (LLM). You define a prompt (and optionally Retrieval Augmented Generation (RAG) settings), and the LLM generates the value for the column / cell.
3+
The **LLM Column** in a Generative Table lets you synthesize outputs using a Large Language Model (LLM). You define a prompt (and optionally Retrieval Augmented Generation (RAG) settings), and the LLM generates the value for the column / cell.
44

55
The LLM Column will:
66

@@ -17,7 +17,7 @@ You control how the LLM behaves through:
1717

1818
---
1919

20-
### Referencing Upstream Columns in Prompts
20+
##### Referencing Upstream Columns in Prompts
2121

2222
The **Prompt** can reference values from upstream columns (columns to the left) using the syntax:
2323

@@ -33,26 +33,15 @@ For a row where the `Input` column contains value `Good morning`, the actual pro
3333

3434
> Translate "Good morning" into Italian:
3535
36-
Tips
36+
To insert a reference, click on the corresponding columns above the Prompt input area. Alternatively, you can manually insert `${Column Name}` into the Prompt.
3737

38-
- To insert a reference, click on the corresponding columns above the Prompt input area
39-
- Alternatively, you can manually insert `${Column Name}` into the Prompt
40-
- You can reference multiple columns in the same prompt, as long as the names match your column names exactly (case-sensitive).
41-
- Repeated references will be not be de-duplicated. For example:
42-
43-
> <span class="column-variable input-col">Input</span>
44-
>
45-
> Translate "<span class="column-variable input-col">Input</span>" into Italian:
38+
You can reference multiple columns in the same prompt, as long as the names match your column names exactly (case-sensitive).
4639

47-
will result in
48-
49-
> Good morning
50-
>
51-
> Translate "Good morning" into Italian:
40+
See more prompting tips below.
5241

5342
---
5443

55-
### Retrieval Augmented Generation (RAG)
44+
##### Retrieval Augmented Generation (RAG)
5645

5746
You can optionally use RAG to ground the LLM’s output in external knowledge stored in a Knowledge Table.
5847

@@ -78,10 +67,55 @@ When RAG is enabled, the LLM Column will:
7867
- After reranking, the top‑`k` references are selected and injected into the prompt sent to the LLM.
7968

8069
5. Optionally generate inline citations
81-
- You can enable inline citations in **pandoc style**:
82-
```text
83-
[@ref0; @ref1; @ref2]
84-
```
70+
- You can enable inline citations in **pandoc style**: `[@ref0; @ref1; @ref2]`
8571
- When enabled, the generated text can include these citation markers to indicate which references support which statements.
8672

8773
The final prompts sent to the LLM is your System Prompt and Prompt, plus any injected references (and, if configured, citation context), all guided by the settings you choose (k, citations, reranking).
74+
75+
---
76+
77+
##### Multi‑turn Chat
78+
79+
When Multi‑turn Chat is enabled, each generation can use data from previous rows as conversation history, rather than only the current row. By default, rows are ordered from latest to oldest, and the LLM sees all rows from the current one downward as its context.
80+
81+
For example:
82+
83+
1. Create a table with an input column `Query` and a multi‑turn LLM column `Output`.
84+
2. Add a row where `Query` is `What is 2+2?`. The LLM will respond with `4`.
85+
3. Add another row where `Query` is `Add 3`. Because multi‑turn chat is enabled, the LLM will understand this as continuing the previous exchange and return `7` as the result.
86+
87+
---
88+
89+
##### Prompting Tips
90+
91+
<!-- prettier-ignore-start -->
92+
93+
- When referencing other columns, it is recommended to separate them using XML tags or Markdown headings. For example:
94+
95+
> &lt;user-query>
96+
> <span class="column-variable input-col">Input</span>
97+
> &lt;/user-query>
98+
>
99+
> Translate user query into Italian.
100+
101+
<br>
102+
103+
> \# User Query
104+
> <span class="column-variable input-col">Input</span>
105+
>
106+
> \# Instruction
107+
> Translate user query into Italian.
108+
109+
- Repeated references will be not be de-duplicated. For example:
110+
111+
> <span class="column-variable input-col">Input</span>
112+
>
113+
> Translate "<span class="column-variable input-col">Input</span>" into Italian:
114+
115+
will result in
116+
117+
> Good morning
118+
>
119+
> Translate "Good morning" into Italian:
120+
121+
<!-- prettier-ignore-end -->

services/app/src/lib/components/tables/(sub)/guides/python.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
### Basic Concept
1+
##### Basic Concept
22

3-
The **Python Column** in a **Generative Table** lets you generate or transform cell values using custom Python code, so you can build image, audio, and general-purpose transformations directly in your table.
3+
The **Python Column** in a Generative Table lets you generate or transform cell values using custom Python code, so you can build image, audio, and general-purpose transformations directly in your table.
44

55
All upstream columns (columns to the left) are passed to your code as a dictionary named `row` in the global context.
66

@@ -31,7 +31,7 @@ Consider using `try/except` blocks and writing fallback value when needed.
3131

3232
---
3333

34-
### Preinstalled Libraries
34+
##### Preinstalled Libraries
3535

3636
The following libraries are available:
3737

@@ -57,7 +57,7 @@ The following libraries are available:
5757

5858
---
5959

60-
### Working with Images
60+
##### Working with Images
6161

6262
When an upstream column contains an image, its value in `row` is **raw binary data** (`bytes`).
6363

@@ -66,7 +66,7 @@ To output an image, make sure:
6666
- The Python Column has data type `image`.
6767
- The output image is one of: `.jpeg`, `.jpg`, `.png`, `.gif`, `.webp`.
6868

69-
#### Usage Pattern
69+
Usage pattern:
7070

7171
1. Read image bytes from `row`.
7272
2. Perform your image operations (for example, using a library such as Pillow / `PIL`).
@@ -96,7 +96,7 @@ with Image.open(io.BytesIO(image_bytes)) as img:
9696

9797
---
9898

99-
### Working with Audios
99+
##### Working with Audios
100100

101101
When an upstream column contains audio, its value in `row` is also **raw binary data** (`bytes`).
102102

@@ -105,7 +105,7 @@ To output an audio, make sure:
105105
- The Python Column has data type `audio`.
106106
- The output audio is one of: `.mp3`, `.wav`.
107107

108-
#### Usage Pattern
108+
Usage pattern:
109109

110110
1. Read audio bytes from `row`.
111111
2. Perform your audio processing (for example, using a library such as `soundfile`).
@@ -134,7 +134,7 @@ row["Python Column Name"] = output_buffer.getvalue()
134134

135135
---
136136

137-
### Making Web Requests
137+
##### Making Web Requests
138138

139139
You can use `httpx` to make web requests. By using the appropriate column data type, you can fetch images and audios and save them in the table.
140140

0 commit comments

Comments
 (0)