Advanced Topics

Summarizing and Generating Text with GPAL.AI

Beyond classification, GPAL.AI can summarize long text, generate new text from a prompt, or augment existing data. The same WithProvider, WithTask, WithInputFrom, WithOutputTo chain, just with a different AITask.

Summarization

The summarization task condenses the input text into a configurable word count, with 100 words as the default. An optional flag asks the model to also call out key terms alongside the summary.

GPAL.AI

.WithProvider(AIProviderType.XAI)

.WithTask(AITask.Summarization)

.WithTaskConfig(new ClassificationConfig { MaxWords = 100, IncludeKeywords = true })

.WithInputFrom(GPAL.FileFor("meeting-notes.txt"))

.WithOutputTo(GPAL.FileFor("meeting-summary.txt"))

.Execute();

TIP

Results go to whatever output target was configured -- a file, a grid, or a form control -- the same way classification results do.

Text Generation and Data Augmentation

Text generation sends the input as a prompt and writes back whatever the model produces -- useful for drafting emails, descriptions, or other content from a short brief. Data augmentation is similar but framed around expanding or varying existing data, such as generating additional sample rows in the same style as an existing dataset.

GPAL.AI

.WithProvider(AIProviderType.XAI)

.WithTask(AITask.TextGeneration)

.WithTaskConfig(new ClassificationConfig { PromptTemplate = "Write a short product description for {0}" })

.WithInputFrom("a stainless steel insulated water bottle")

.WithOutputTo(out IGPALGrid<string> description)

.Execute();

TIP

Both tasks use a built-in default prompt and accept a custom prompt template when the default framing is not specific enough for the task.

AI Tasks with Form Controls

WithInputFrom and WithOutputTo accept GPALTextArea and other GPAL form controls directly, in addition to files and string values. The chain reads the control's current text when Execute runs and writes the result back into the output control -- no extra wiring needed on your end.

GPAL.AI

.WithProvider(AIProviderType.XAI)

.WithTask(AITask.Summarization)

.WithInputFrom(inputArea)

.WithOutputTo(outputArea)

.Execute();

TIP

To see a complete interactive AI form -- with a text area, a combobox, and results flowing back into the UI in real time -- see the next concept video: Building Live AI Forms with WithLiveInputFrom.