MentorAgent Docs
Menu

Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.

ReferencePackage: Novior.MentorAgent

MentorRagRequest class

What a search is for: the user's message and the context it was asked in. Passed to IMentorRagSource.SearchAsync before every turn when UseRag is on.

On this page

A source that only needs the text keeps implementing IMentorRagSource.SearchAsync: the default implementation of the request overload calls it with MentorRagRequest.Query and MentorRagRequest.MaxResults. A source that filters by user, page or conversation implements this one.

A class with init-only properties rather than a parameter list, so that what a search can know can grow — a tenant, for one — without breaking a source that already implements it.

Namespace: Novior.MentorAgent.Rag. Package: Novior.MentorAgent.

public sealed class MentorRagRequest

Terminal
dotnet add package Novior.MentorAgent

public MentorRagRequest()

public int MaxResults { get; init; }

Maximum number of documents to return (RagResultCount).

public IReadOnlyDictionary<string, object?> PageData { get; init; }

The data the current page put in context with IMentorPageContext.Set — the same entries the model is shown. Empty when no page has set any.

public string? PageName { get; init; }

The current page's name, as the page set it with IMentorPageContext.SetPageName.

public required string Query { get; init; }

The user's message for this turn.

public IReadOnlyList<ChatMessage> RecentMessages { get; init; }

The conversation before this message, oldest first: the user's messages and the assistant's replies of the last turns in this session, text only (up to six messages). Empty on the first turn, after a reset, and after a session is restored. Lets a source resolve "and the second one?" against what was said before.

public ClaimsPrincipal? User { get; init; }

Who is asking: the caller of the hub, of /mentor/chat or of an A2A request, and in a Blazor circuit the user the host's AuthenticationStateProvider reports. null when the host has no authentication at all. An anonymous visitor, or a peer agent that did not authenticate, has an unauthenticated principal. A source that applies per-user permissions should treat both as "no access to anything restricted".