Skip to content

Commit 18cc2d4

Browse files
committed
[#19] Reword XML Documentation Comments
1 parent 5385723 commit 18cc2d4

11 files changed

Lines changed: 243 additions & 164 deletions

File tree

src/MaIN.Core/Hub/Contexts/Interfaces/AgentContext/IAgentActions.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ namespace MaIN.Core.Hub.Contexts.Interfaces.AgentContext;
77
public interface IAgentActions
88
{
99
/// <summary>
10-
/// Gets the unique identifier (GUID) of the current Agent.
10+
/// Retrieves the unique identifier for the agent.
1111
/// </summary>
12-
/// <returns>The Agent's ID as a string.</returns>
12+
/// <returns>A string representing the agent's unique identifier.</returns>
1313
string GetAgentId();
1414

1515
/// <summary>
16-
/// Retrieves the full Agent entity with its current configuration and state.
16+
/// Fetches the current agent instance.
1717
/// </summary>
18-
/// <returns>An <see cref="Agent"/> object.</returns>
18+
/// <returns>The <see cref="Agent"/> object containing all the properties and data for the current agent.</returns>
1919
Agent GetAgent();
2020

2121
/// <summary>
@@ -25,21 +25,21 @@ public interface IAgentActions
2525
Knowledge? GetKnowledge();
2626

2727
/// <summary>
28-
/// Retrieves the current chat session associated with this Agent.
28+
/// Retrieves the chat session associated with the current agent.
2929
/// </summary>
30-
/// <returns>A task representing the asynchronous operation, containing the <see cref="Chat"/>.</returns>
30+
/// <returns>A <see cref="Chat"/> object representing the chat session associated with the agent.</returns>
3131
Task<Chat> GetChat();
3232

3333
/// <summary>
34-
/// Clears the conversation history and restarts the chat session for this Agent.
34+
/// Restarts the chat session associated with the current agent, typically resetting the conversation state.
3535
/// </summary>
36-
/// <returns>A task representing the asynchronous operation, containing a new <see cref="Chat"/>.</returns>
36+
/// <returns>A <see cref="Chat"/> object representing the restarted chat session.</returns>
3737
Task<Chat> RestartChat();
3838

3939
/// <summary>
40-
/// Lists all agents available in the system.
40+
/// Fetches all agents managed by the underlying agent service.
4141
/// </summary>
42-
/// <returns>A task containing a list of <see cref="Agent"/> objects.</returns>
42+
/// <returns>A list of <see cref="Agent"/> objects representing all agents.</returns>
4343
Task<List<Agent>> GetAllAgents();
4444

4545
/// <summary>
@@ -50,13 +50,13 @@ public interface IAgentActions
5050
Task<Agent?> GetAgentById(string id);
5151

5252
/// <summary>
53-
/// Permanently deletes the current Agent and all associated data.
53+
/// Deletes the current agent from the system.
5454
/// </summary>
5555
Task Delete();
5656

5757
/// <summary>
58-
/// Checks if an agent with the current identifier exists in the system.
58+
/// Checks if the current agent exists in the system.
5959
/// </summary>
60-
/// <returns>True if the agent exists, otherwise false.</returns>
60+
/// <returns>A boolean indicating whether the agent exists.</returns>
6161
Task<bool> Exists();
6262
}

src/MaIN.Core/Hub/Contexts/Interfaces/AgentContext/IAgentBuilderEntryPoint.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@
33
public interface IAgentBuilderEntryPoint : IAgentActions
44
{
55
/// <summary>
6-
/// Sets the LLM model to be used by the Agent.
6+
/// Sets the AI model for the agent to use during its interactions.
77
/// </summary>
8-
/// <param name="model">The name or identifier of the model (e.g., "llama3.2").</param>
8+
/// <param name="model">The name or identifier of the AI model to be used.</param>
9+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
910
IAgentConfigurationBuilder WithModel(string model);
1011

1112
/// <summary>
12-
/// Configures a custom model from a specific local path.
13+
/// Specifies a custom model along with its file path for use by the agent. This allows using locally stored models in addition to predefined ones.
1314
/// </summary>
14-
/// <param name="model">A custom name for the model.</param>
15-
/// <param name="path">The file system path to the model files.</param>
15+
/// <param name="model">The name of the custom model.</param>
16+
/// <param name="path">The path to the custom model’s file.</param>
1617
/// <param name="mmProject">Optional multi-modal project identifier.</param>
18+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
1719
IAgentConfigurationBuilder WithCustomModel(string model, string path, string? mmProject = null);
1820

1921
/// <summary>
20-
/// Loads an existing Agent from the database.
22+
/// Fetches an existing agent by its ID, allowing you to create a new <see cref="AgentContext"/> from an already existing agent.
2123
/// </summary>
2224
/// <param name="agentId">The unique identifier of the Agent to load.</param>
23-
/// <returns>An execution interface ready for processing messages.</returns>
25+
/// <returns>The context instance implementing <see cref="IAgentContextExecutor"/> for method chaining.</returns>
2426
Task<IAgentContextExecutor> FromExisting(string agentId);
2527
}

src/MaIN.Core/Hub/Contexts/Interfaces/AgentContext/IAgentConfigurationBuilder.cs

Lines changed: 59 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,119 +10,147 @@ namespace MaIN.Core.Hub.Contexts.Interfaces.AgentContext;
1010
public interface IAgentConfigurationBuilder : IAgentActions
1111
{
1212
/// <summary>
13-
/// Sets the system-level instruction or persona for the Agent. This prompt defines how the Agent should behave and respond.
13+
/// Sets the initial prompt for the agent. This prompt serves as an instruction or context that guides the agent's behavior during its execution.
1414
/// </summary>
15-
/// <param name="prompt">The text content of the system instructions or Agent persona.</param>
15+
/// <param name="prompt"> The initial prompt or instruction for the agent.</param>
16+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
1617
IAgentConfigurationBuilder WithInitialPrompt(string prompt);
1718

1819
/// <summary>
19-
/// Sets a custom unique identifier for the Agent.
20+
/// Assigns a unique identifier to the agent.
2021
/// </summary>
21-
/// <param name="id">The new Agent ID.</param>
22+
/// <param name="id">he unique identifier for the agent.</param>
23+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
2224
IAgentConfigurationBuilder WithId(string id);
2325

2426
/// <summary>
25-
/// Sets the Agent's execution order (relevant in multi-agent flows).
27+
/// Sets the order of the agent. This can be used in scenarios where agents need to be prioritized or sequenced.
2628
/// </summary>
27-
/// <param name="order">The sequence number.</param>
29+
/// <param name="order">The order value to assign to the agent.</param>
30+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
2831
IAgentConfigurationBuilder WithOrder(int order);
2932

3033
/// <summary>
31-
/// Disables the caching mechanism for this Agent's requests.
34+
/// Each time we run inference, we need to load model into memory, this takes time and memory. This method allows us to save some
35+
/// more of GPU/RAM resources at the cost of time, because model weights are no longer cached.
3236
/// </summary>
37+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
3338
IAgentConfigurationBuilder DisableCache();
3439

3540
/// <summary>
36-
/// Defines the data source from which the Agent derives its identity or knowledge.
41+
/// Sets the source of the agent’s context, including information related to the agent's source and its type.
3742
/// </summary>
38-
/// <param name="source">The implementation of the agent source.</param>
39-
/// <param name="type">The type of source (e.g., PDF, Web).</param>
43+
/// <param name="source">The <see cref="IAgentSource"/> source instance providing the agent’s context.</param>
44+
/// <param name="type">The <see cref="AgentSourceType"/> - type of source (e.g., API, SQL, Web).</param>
45+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
4046
IAgentConfigurationBuilder WithSource(IAgentSource source, AgentSourceType type);
4147

4248
/// <summary>
4349
/// Sets a friendly display name for the Agent.
4450
/// </summary>
4551
/// <param name="name">The name of the Agent.</param>
52+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
4653
IAgentConfigurationBuilder WithName(string name);
4754

4855
/// <summary>
49-
/// Selects a specific processing engine (Backend) for LLM requests.
56+
/// Defines backend that will be used for model inference.
5057
/// </summary>
51-
/// <param name="backendType">The backend type.</param>
58+
/// <param name="backendType">The <see cref="BackendType"/> - an enum that defines which AI backend to use.</param>
59+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
5260
IAgentConfigurationBuilder WithBackend(BackendType backendType);
5361

5462
/// <summary>
5563
/// Configures integration with the Model Context Protocol (MCP).
5664
/// </summary>
57-
/// <param name="mcpConfig">The MCP configuration object.</param>
65+
/// <param name="mcpConfig">The <see cref="Mcp"/> configuration object.</param>
66+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
5867
IAgentConfigurationBuilder WithMcpConfig(Mcp mcpConfig);
5968

6069
/// <summary>
61-
/// Sets inference parameters such as temperature, top-p, or max tokens.
70+
/// Sets the inference parameters for the chat session, allowing you to customize how the AI processes and generates responses
71+
/// based on specific parameters. Inference parameters can influence various aspects of the chat, such as response length,
72+
/// temperature, and other model-specific settings.
6273
/// </summary>
63-
/// <param name="inferenceParams">An object containing LLM technical settings.</param>
74+
/// <param name="inferenceParams">An <see cref="InferenceParams"/> object that holds the parameters for inference, such as Temperature, MaxTokens,
75+
/// TopP, etc. These parameters control the generation behavior of the agent.</param>
76+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
6477
IAgentConfigurationBuilder WithInferenceParams(InferenceParams inferenceParams);
6578

6679
/// <summary>
67-
/// Configures memory and context window settings for the Agent.
80+
/// Sets the memory parameters for the chat session, allowing you to customize how the AI accesses and uses its memory
81+
/// for generating responses. Memory parameters influence aspects such as context size, memory search depth,
82+
/// and token allocation for responses.
6883
/// </summary>
69-
/// <param name="memoryParams">Memory management settings.</param>
84+
/// <param name="memoryParams">A <see cref="MemoryParams"/> object that holds the parameters for memory management, such as
85+
/// ContextSize, MaxMatchesCount, AnswerTokens, etc. These parameters control how agent uses memory for response generation.</param>
86+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
7087
IAgentConfigurationBuilder WithMemoryParams(MemoryParams memoryParams);
7188

7289
/// <summary>
73-
/// Defines a sequence of steps (pipeline) that the Agent must execute for each request.
90+
/// Configures the steps that the agent will follow during its interaction. Each step is a task or action that
91+
/// the agent will execute sequentially.
7492
/// </summary>
75-
/// <param name="steps">A list of step names.</param>
93+
/// <param name="steps">A list of strings representing the steps the agent should follow.</param>
94+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
7695
IAgentConfigurationBuilder WithSteps(List<string>? steps);
7796

7897
/// <summary>
7998
/// Assigns tools (functions) that the Agent can autonomously invoke.
8099
/// </summary>
81-
/// <param name="toolsConfiguration">The configuration for available tools.</param>
100+
/// <param name="toolsConfiguration">The <see cref="ToolsConfiguration"/> for available tools.</param>
101+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
82102
IAgentConfigurationBuilder WithTools(ToolsConfiguration toolsConfiguration);
83103

84104
/// <summary>
85105
/// Configures the Agent's knowledge base using a configuration delegate.
86106
/// </summary>
87107
/// <param name="knowledgeConfig">A function to configure the knowledge builder.</param>
108+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
88109
IAgentConfigurationBuilder WithKnowledge(Func<KnowledgeBuilder, KnowledgeBuilder> knowledgeConfig);
89110

90111
/// <summary>
91112
/// Initializes the knowledge base using a pre-configured builder.
92113
/// </summary>
93-
/// <param name="knowledge">The knowledge builder instance.</param>
114+
/// <param name="knowledge">The <see cref="KnowledgeBuilder"/> instance.</param>
115+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
94116
IAgentConfigurationBuilder WithKnowledge(KnowledgeBuilder knowledge);
95117

96118
/// <summary>
97119
/// Assigns a pre-built knowledge base object to the Agent.
98120
/// </summary>
99-
/// <param name="knowledge">The knowledge instance.</param>
121+
/// <param name="knowledge">The <see cref="Knowledge"/> instance.</param>
122+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
100123
IAgentConfigurationBuilder WithKnowledge(Knowledge knowledge);
101124

102125
/// <summary>
103-
/// Creates a volatile knowledge base stored only in memory (not persisted to disk).
126+
/// Creates a volatile knowledge base stored only in memory.
104127
/// </summary>
105128
/// <param name="knowledgeConfig">A function to configure the in-memory knowledge builder.</param>
129+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
106130
IAgentConfigurationBuilder WithInMemoryKnowledge(Func<KnowledgeBuilder, KnowledgeBuilder> knowledgeConfig);
107131

108132
/// <summary>
109-
/// Defines a specific personality or task (Behavior) under a unique name.
133+
/// Defines a behavior for the agent, specifying an action or task the agent should perform based on the provided name and instruction.
110134
/// </summary>
111135
/// <param name="name">The name of the behavior.</param>
112-
/// <param name="instruction">The system instructions for this behavior.</param>
136+
/// <param name="instruction">The instruction associated with the behavior.</param>
137+
/// <returns>The context instance implementing <see cref="IAgentConfigurationBuilder"/> for method chaining.</returns>
113138
IAgentConfigurationBuilder WithBehaviour(string name, string instruction);
114139

115140
/// <summary>
116-
/// Finalizes the build process and creates the Agent in the system synchronously.
141+
/// Synchronously creates the agent in the system.
117142
/// </summary>
118-
/// <param name="flow">Indicates if the Agent is part of a larger flow.</param>
119-
/// <param name="interactiveResponse">Specifies if responses should be streamed.</param>
143+
/// <param name="flow">A flag indicating whether the agent should be part of an agent flow.</param>
144+
/// <param name="interactiveResponse">A flag indicating whether the agent should generate interactive responses.</param>
145+
/// <returns>The context instance implementing <see cref="IAgentContextExecutor"/> for method chaining.</returns>
120146
IAgentContextExecutor Create(bool flow = false, bool interactiveResponse = false);
121147

122148
/// <summary>
123-
/// Finalizes the build process and creates the Agent in the system asynchronously.
149+
/// Asynchronously creates the agent in the system. This method integrates the agent into the underlying agent service,
150+
/// making it ready for use.
124151
/// </summary>
125-
/// <param name="flow">Indicates if the Agent is part of a larger flow.</param>
126-
/// <param name="interactiveResponse">Specifies if responses should be interactive.</param>
152+
/// <param name="flow">A flag indicating whether the agent should be part of an agent flow.</param>
153+
/// <param name="interactiveResponse">A flag indicating whether the agent should generate interactive responses.</param>
154+
/// <returns>The context instance implementing <see cref="IAgentContextExecutor"/> for method chaining.</returns>
127155
Task<IAgentContextExecutor> CreateAsync(bool flow = false, bool interactiveResponse = false);
128156
}

0 commit comments

Comments
 (0)