Menu

How I validate cited answers in an ASP.NET Core 8 assistant
📰

How I validate cited answers in an ASP.NET Core 8 assistant

DEV Community: dotnet·Martin Pisacreta·about 5 hours ago
#bUguSml8
#devtodotnet#devto#dev#answer#model
Reading 0:00
15s threshold

I built a small ASP.NET Core 8 assistant around three synthetic cooking lessons. I wanted to make its answer path easy to inspect. Before asking a model anything, my application selects a passage. Before accepting a generated answer, it checks the source identifiers against that passage.

The sample has a deterministic mode and an optional OpenAI-compatible chat adapter. The deterministic mode returns the selected lesson directly. The HTTP adapter can generate wording, but its response must pass a citation check.

This distinction matters. I can verify that a citation names the supplied passage. I cannot conclude from that identifier alone that every sentence is supported. My sample enforces a source-reference rule, not a guarantee of factual correctness.

I retrieve before generating

My lesson library uses fixed files with stable identifiers such as pasta-water . A question cannot choose an arbitrary file path.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.