1
0

feat: Introduce a pluggable LLM provider system with token extraction, pricing, and updated setup configuration.

This commit is contained in:
2026-03-05 22:02:22 +01:00
parent 4476cc7f15
commit c7e7976d9d
12 changed files with 499 additions and 28 deletions

View File

@@ -0,0 +1,25 @@
using System.Net.Http.Headers;
namespace AnchorCli.Providers;
/// <summary>
/// Interface for extracting token usage from provider responses.
/// </summary>
internal interface ITokenExtractor
{
/// <summary>
/// Extracts token usage from response headers and/or body.
/// Returns (inputTokens, outputTokens) or null if unavailable.
/// </summary>
(int inputTokens, int outputTokens)? ExtractTokens(HttpResponseHeaders headers, string? responseBody);
/// <summary>
/// Gets the latency from response headers (in ms).
/// </summary>
int? ExtractLatency(HttpResponseHeaders headers);
/// <summary>
/// Gets the provider name for display purposes.
/// </summary>
string ProviderName { get; }
}