feat: Introduce an OpenAI-compatible client to replace the Groq-specific client and enable multiple LLM providers.
This commit is contained in:
@@ -42,7 +42,7 @@ public static class LatencyTestCommand
|
||||
return;
|
||||
}
|
||||
|
||||
var groq = new GroqApiClient(config.GroqApiKey);
|
||||
var client = new OpenAiCompatibleClient(config.GroqApiKey);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -51,13 +51,13 @@ public static class LatencyTestCommand
|
||||
{
|
||||
ctx.Status("Testing STT (Whisper)...");
|
||||
var sttWatch = Stopwatch.StartNew();
|
||||
var transcript = await groq.TranscribeAsync(testWavPath, config.WhisperLanguage, config.WhisperModel);
|
||||
var transcript = await client.TranscribeAsync(testWavPath, config.WhisperLanguage, config.WhisperModel);
|
||||
sttWatch.Stop();
|
||||
|
||||
ctx.Status("Testing LLM (Llama)...");
|
||||
var systemPrompt = PromptBuilder.BuildPrompt(config);
|
||||
var llmWatch = Stopwatch.StartNew();
|
||||
var refinedText = await groq.RefineTextAsync("Hello world, this is a latency test.", systemPrompt, config.LlmModel);
|
||||
var refinedText = await client.RefineTextAsync("Hello world, this is a latency test.", systemPrompt, config.LlmModel);
|
||||
llmWatch.Stop();
|
||||
|
||||
var total = sttWatch.ElapsedMilliseconds + llmWatch.ElapsedMilliseconds;
|
||||
|
||||
Reference in New Issue
Block a user