feat: Add Native AOT compilation and source-generated JSON serialization, streamline CLI arguments, and remove translation functionality.
This commit is contained in:
@@ -81,7 +81,7 @@ public class GroqApiClient
|
||||
}
|
||||
|
||||
var json = await response.Content.ReadAsStringAsync();
|
||||
var result = JsonSerializer.Deserialize<WhisperResponse>(json);
|
||||
var result = JsonSerializer.Deserialize(json, AppJsonSerializerContext.Default.WhisperResponse);
|
||||
return result?.Text ?? string.Empty;
|
||||
}
|
||||
|
||||
@@ -98,8 +98,7 @@ public class GroqApiClient
|
||||
}
|
||||
};
|
||||
|
||||
var jsonOptions = new JsonSerializerOptions { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull };
|
||||
var jsonContent = new StringContent(JsonSerializer.Serialize(requestBody, jsonOptions), System.Text.Encoding.UTF8, "application/json");
|
||||
var jsonContent = new StringContent(JsonSerializer.Serialize(requestBody, AppJsonSerializerContext.Default.LlamaRequest), System.Text.Encoding.UTF8, "application/json");
|
||||
|
||||
var response = await _httpClient.PostAsync("chat/completions", jsonContent);
|
||||
|
||||
@@ -110,7 +109,7 @@ public class GroqApiClient
|
||||
}
|
||||
|
||||
var json = await response.Content.ReadAsStringAsync();
|
||||
var result = JsonSerializer.Deserialize<LlamaResponse>(json);
|
||||
var result = JsonSerializer.Deserialize(json, AppJsonSerializerContext.Default.LlamaResponse);
|
||||
|
||||
return result?.Choices?.FirstOrDefault()?.Message?.Content ?? string.Empty;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user