AssistantService

Core assistant logic, separated from CLI wiring for testability. Handles one-shot and interactive modes.

public class AssistantService

1. Constructors

1.1. AssistantService(IAssistantClient, IConsoleReader, ILogger)

public AssistantService(IAssistantClient client, IConsoleReader consoleReader, ILogger logger)
Table 1. Parameters
Name Type Description

client

IAssistantClient

consoleReader

IConsoleReader

logger

ILogger

2. Methods

2.1. BuildSystemPrompt(ISystemHost, string, string)

Builds the system prompt from the host and config context.

public static string BuildSystemPrompt(ISystemHost host, string configSummary, string version)
Table 2. Parameters
Name Type Description

host

ISystemHost

configSummary

string

version

string

Returns: string

2.2. ExecuteInteractiveAsync(string, string)

Executes the interactive REPL loop. Returns the conversation history when the loop terminates.

public Task<List<(string Role, string Content)>> ExecuteInteractiveAsync(string model, string systemPrompt)
Table 3. Parameters
Name Type Description

model

string

systemPrompt

string

Returns: Task<List<(string Role, string Content)>>

2.3. ExecuteOneShotAsync(string, string, string)

Executes a one-shot assistant query.

public Task<string> ExecuteOneShotAsync(string model, string systemPrompt, string userPrompt)
Table 4. Parameters
Name Type Description

model

string

systemPrompt

string

userPrompt

string

Returns: Task<string>