Table of Contents

Class RagEnabledService

Namespace
Mythosia.AI.Rag
Assembly
Mythosia.AI.Rag.dll
public class RagEnabledService
Inheritance
RagEnabledService
Inherited Members

Properties

LastCitations

public IReadOnlyList<AICitation> LastCitations { get; }

Property Value

IReadOnlyList<AICitation>

LastProcessing

public IReadOnlyList<AIProcessingInfo> LastProcessing { get; }

Property Value

IReadOnlyList<AIProcessingInfo>

Methods

GetCompletionAsync(Message, RagQueryOptions?, CancellationToken)

public Task<string> GetCompletionAsync(Message message, RagQueryOptions? options, CancellationToken cancellationToken = default)

Parameters

message Message
options RagQueryOptions
cancellationToken CancellationToken

Returns

Task<string>

GetCompletionAsync(Message, CancellationToken)

public Task<string> GetCompletionAsync(Message message, CancellationToken cancellationToken = default)

Parameters

message Message
cancellationToken CancellationToken

Returns

Task<string>

GetCompletionAsync(string, RagQueryOptions?, CancellationToken)

public Task<string> GetCompletionAsync(string query, RagQueryOptions? options, CancellationToken cancellationToken = default)

Parameters

query string
options RagQueryOptions
cancellationToken CancellationToken

Returns

Task<string>

GetCompletionAsync(string, CancellationToken)

public Task<string> GetCompletionAsync(string query, CancellationToken cancellationToken = default)

Parameters

query string
cancellationToken CancellationToken

Returns

Task<string>

RetrieveAsync(string, RagQueryOptions?, CancellationToken)

public Task<RagProcessedQuery> RetrieveAsync(string query, RagQueryOptions? options, CancellationToken cancellationToken = default)

Parameters

query string
options RagQueryOptions
cancellationToken CancellationToken

Returns

Task<RagProcessedQuery>

RetrieveAsync(string, CancellationToken)

public Task<RagProcessedQuery> RetrieveAsync(string query, CancellationToken cancellationToken = default)

Parameters

query string
cancellationToken CancellationToken

Returns

Task<RagProcessedQuery>

StartRunAsync(Message, Action<string>?, RagQueryOptions?, StreamOptions?, CancellationToken)

public Task<AIRun> StartRunAsync(Message message, Action<string>? onText = null, RagQueryOptions? options = null, StreamOptions? streamOptions = null, CancellationToken cancellationToken = default)

Parameters

message Message
onText Action<string>
options RagQueryOptions
streamOptions StreamOptions
cancellationToken CancellationToken

Returns

Task<AIRun>

StartRunAsync(string, Action<string>?, RagQueryOptions?, StreamOptions?, CancellationToken)

public Task<AIRun> StartRunAsync(string query, Action<string>? onText = null, RagQueryOptions? options = null, StreamOptions? streamOptions = null, CancellationToken cancellationToken = default)

Parameters

query string
onText Action<string>
options RagQueryOptions
streamOptions StreamOptions
cancellationToken CancellationToken

Returns

Task<AIRun>

StreamAsync(string, RagQueryOptions?, CancellationToken)

public IAsyncEnumerable<string> StreamAsync(string prompt, RagQueryOptions? options, CancellationToken cancellationToken = default)

Parameters

prompt string
options RagQueryOptions
cancellationToken CancellationToken

Returns

IAsyncEnumerable<string>

StreamAsync(string, CancellationToken)

public IAsyncEnumerable<string> StreamAsync(string prompt, CancellationToken cancellationToken = default)

Parameters

prompt string
cancellationToken CancellationToken

Returns

IAsyncEnumerable<string>

StreamOnceAsync(string, RagQueryOptions?, CancellationToken)

public IAsyncEnumerable<string> StreamOnceAsync(string prompt, RagQueryOptions? options, CancellationToken cancellationToken = default)

Parameters

prompt string
options RagQueryOptions
cancellationToken CancellationToken

Returns

IAsyncEnumerable<string>

StreamOnceAsync(string, CancellationToken)

public IAsyncEnumerable<string> StreamOnceAsync(string prompt, CancellationToken cancellationToken = default)

Parameters

prompt string
cancellationToken CancellationToken

Returns

IAsyncEnumerable<string>

WithFileSearch(params FileSearchStore[])

public RagEnabledService WithFileSearch(params FileSearchStore[] stores)

Parameters

stores FileSearchStore[]

Returns

RagEnabledService

WithReasoning(ReasoningLevel, CachePreservation)

public RagEnabledService WithReasoning(ReasoningLevel level, CachePreservation cache = CachePreservation.None)

Parameters

level ReasoningLevel
cache CachePreservation

Returns

RagEnabledService

WithSpeed(InferenceSpeed)

public RagEnabledService WithSpeed(InferenceSpeed speed)

Parameters

speed InferenceSpeed

Returns

RagEnabledService

WithWebSearch(WebSearchOptions?)

public RagEnabledService WithWebSearch(WebSearchOptions? options = null)

Parameters

options WebSearchOptions

Returns

RagEnabledService

WithoutRag()

public IAIService WithoutRag()

Returns

IAIService