feat: Add configurable LLM and Whisper models with user selection and API integration.
This commit is contained in:
@@ -51,7 +51,7 @@ public class GroqApiClient
|
||||
_httpClient.BaseAddress = new Uri("https://api.groq.com/openai/v1/");
|
||||
}
|
||||
|
||||
public async Task<string> TranscribeAsync(string filePath, string language = "")
|
||||
public async Task<string> TranscribeAsync(string filePath, string language = "", string model = "whisper-large-v3-turbo")
|
||||
{
|
||||
using var content = new MultipartFormDataContent();
|
||||
using var fileStream = File.OpenRead(filePath);
|
||||
@@ -60,7 +60,7 @@ public class GroqApiClient
|
||||
streamContent.Headers.ContentType = new MediaTypeHeaderValue("audio/wav"); // or mpeg
|
||||
content.Add(streamContent, "file", Path.GetFileName(filePath));
|
||||
|
||||
string modelToUse = "whisper-large-v3-turbo";
|
||||
string modelToUse = string.IsNullOrWhiteSpace(model) ? "whisper-large-v3-turbo" : model;
|
||||
|
||||
// according to docs whisper-large-v3-turbo requires the language to be provided if it is to be translated later potentially or if we need the most accurate behavior
|
||||
// Actually, if we want language param, we can pass it to either model
|
||||
@@ -85,11 +85,11 @@ public class GroqApiClient
|
||||
return result?.Text ?? string.Empty;
|
||||
}
|
||||
|
||||
public async Task<string> RefineTextAsync(string rawTranscript, string systemPrompt)
|
||||
public async Task<string> RefineTextAsync(string rawTranscript, string systemPrompt, string model = "openai/gpt-oss-20b")
|
||||
{
|
||||
var requestBody = new LlamaRequest
|
||||
{
|
||||
Model = "openai/gpt-oss-20b",
|
||||
Model = string.IsNullOrWhiteSpace(model) ? "openai/gpt-oss-20b" : model,
|
||||
Temperature = 0.0,
|
||||
Messages = new[]
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user