Added tool calling support (#731)

Co-authored-by: krut_ni <nils.kruthoff@dlr.de>
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-09-04 15:48:07 +02:00
1 parent b00c3f9ab3
commit 4d8d30e15e
266 files changed
+11186 -740

No files matched your search

@@ -0,0 +1,23 @@
using AIStudio.Provider;
namespace AIStudio.Tools.ToolCallingSystem.Harness;
/// <summary>
/// Drives a conversation in which a model may call tools before it answers.
/// </summary>
/// <remarks>
/// Resolved through dependency injection so that a different harness can take over later without
/// touching the providers: an agent mode needs more than "ask, execute, ask again", but it speaks
/// to providers through the same adapters.
/// </remarks>
public interface IToolCallingLoop
{
/// <summary>
/// Runs the conversation until the model answers, the limits are reached, or the request fails.
/// </summary>
/// <param name="adapter">The adapter for the provider API in use.</param>
/// <param name="context">The chat, tools, and UI state this run belongs to.</param>
/// <param name="token">The cancellation token.</param>
/// <returns>The model's final answer, with the sources the tools contributed.</returns>
public IAsyncEnumerable<ContentStreamChunk> RunAsync(IToolCallingProviderAdapter adapter, ToolCallingLoopContext context, CancellationToken token = default);
}