ManualChatClient<T>
Models & Types · AiDotNet.Agentic.Models.Connectors
An IChatClient that asks a person, by writing each prompt to a queue directory.
Implements: IChatClient<T>
For Beginners
Point this at an empty folder and start a run. A file appears there containing the
question; write your reply into a file with the same name but ending .answer.json, and the run continues.
This is the “I am the model” mode.
How It Works
Every request becomes a JSON file in a directory, and the client waits for a matching answer file to appear beside it. A person, a script, or a different tool writes that answer. It is how a whole evolution run can be driven by hand: useful for building a golden trajectory to replay later, for reviewing exactly what the search asks a model at each step, and for running an evolution against a model that has no API at all.
One request writes <id>.task.json holding the conversation and the per-call settings, and waits for
<id>.answer.json holding {"text": "..."}. Plain text in the answer file is accepted too, so a
person can reply without writing JSON. Both files are removed once the answer is read, so the directory shows
only what is still outstanding. Waiting is bounded by Timeout when one is
set and otherwise continues until the request is cancelled, which is the reference implementation’s behaviour.
A stale answer from a previous run would be served instantly and silently as if it answered the new prompt, so the constructor clears the queue directory unless asked not to.
Constructors
| Constructor | Summary |
|---|---|
ManualChatClient(string queueDirectory, ManualChatClientOptions options) |
Initializes a client over a queue directory, creating it when it does not exist. |
Properties
| Property | Summary |
|---|---|
long Requests { get; } |
Gets how many requests this client has written. |
string ModelId { get; } |
|
string QueueDirectory { get; } |
Gets the directory task and answer files are exchanged in. |
Methods
| Method | Summary |
|---|---|
IAsyncEnumerable<ChatResponseUpdate> GetStreamingResponseAsync(IReadOnlyList<ChatMessage> messages, ChatOptions options, CancellationToken cancellationToken) |
|
Task<ChatResponse> GetResponseAsync(IReadOnlyList<ChatMessage> messages, ChatOptions options, CancellationToken cancellationToken) |
|
int ClearQueue() |
Removes every task and answer file left behind by an earlier run. |
Fields
| Field | Summary |
|---|---|
string AnswerExtension |
The extension of the file this client waits for. |
string TaskExtension |
The extension of the file this client writes for each request. |