Added a way to read what the AI received from your sources (#1100)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
Paul KoudelkaandThorsten Sommer authored and GitHub committed 2026-10-26 10:00:01 +01:00
1 parent e0d8e18f34
commit cbc4ce5413
229 files changed
+12739 -1269

No files matched your search

@@ -155,7 +155,9 @@ public readonly record struct DataSourceERI_V1 : IERIDataSource
if(retrievalResponse is { Successful: true, Data: not null })
{
//
// Next, we have to transform the ERI context back to our generic retrieval context:
// Next, we have to transform the ERI context back to our generic retrieval context.
// The server writes the JSON, and a field it leaves out arrives as null, whatever the
// contract says. Everything after this point counts on texts and lists:
//
var genericRetrievalContexts = new List<IRetrievalContext>(retrievalResponse.Data.Count);
foreach (var eriContext in retrievalResponse.Data)
@@ -167,26 +169,26 @@ public readonly record struct DataSourceERI_V1 : IERIDataSource
{
Path = eriContext.Path ?? string.Empty,
Type = eriContext.ToRetrievalContentType(),
Links = eriContext.Links,
Links = eriContext.Links ?? [],
Category = eriContext.Type.ToRetrievalContentCategory(),
SourceCategory = eriContext.Category ?? string.Empty,
MatchedText = eriContext.MatchedContent,
DataSourceName = eriContext.Name,
SurroundingContent = eriContext.SurroundingContent,
MatchedText = eriContext.MatchedContent ?? string.Empty,
DataSourceName = eriContext.Name ?? string.Empty,
SurroundingContent = eriContext.SurroundingContent ?? [],
});
break;
case ContentType.IMAGE:
genericRetrievalContexts.Add(new RetrievalImageContext
{
Path = eriContext.Path ?? string.Empty,
Type = eriContext.ToRetrievalContentType(),
Links = eriContext.Links,
Source = eriContext.MatchedContent,
Links = eriContext.Links ?? [],
Source = eriContext.MatchedContent ?? string.Empty,
Category = eriContext.Type.ToRetrievalContentCategory(),
SourceCategory = eriContext.Category ?? string.Empty,
SourceType = ContentImageSource.BASE64,
DataSourceName = eriContext.Name,
DataSourceName = eriContext.Name ?? string.Empty,
});
break;