Refine Groq model selection fallback and provider card layout constants

Agent-Logs-Url: https://github.com/AkhilKonduru1/Atoll/sessions/d40c666d-f589-48ca-9539-1fd33c799962

Co-authored-by: AkhilKonduru1 <210101196+AkhilKonduru1@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-15 03:15:36 +00:00 • committed by GitHub
commit 5c2ab19614
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View file

@ -358,6 +358,7 @@ struct ModelSelectionView: View {
// MARK: - Provider Card
struct ProviderCard: View {
private let wideCardMinHeight: CGFloat = 110
let provider: AIModelProvider
let isSelected: Bool
let onSelect: () -> Void
@ -402,7 +403,7 @@ struct ProviderCard: View {
onSelect()
}
.animation(.easeInOut(duration: 0.2), value: isSelected)
.frame(maxWidth: .infinity, minHeight: isWide ? 110 : nil)
.frame(maxWidth: .infinity, minHeight: isWide ? wideCardMinHeight : nil)
}
private func iconForProvider(_ provider: AIModelProvider) -> String {

View file

@ -459,9 +459,13 @@ class ScreenAssistantManager: NSObject, ObservableObject {
// Get selected model or default to llama-3.3-70b-versatile
let selectedModel = Defaults[.selectedAIModel]
let modelId = selectedModel?.id.flatMap { selectedId in
AIModelProvider.groq.supportedModels.contains(where: { $0.id == selectedId }) ? selectedId : nil
} ?? "llama-3.3-70b-versatile"
let modelId: String
if let selectedId = selectedModel?.id,
AIModelProvider.groq.supportedModels.contains(where: { $0.id == selectedId }) {
modelId = selectedId
} else {
modelId = "llama-3.3-70b-versatile"
}
guard let url = URL(string: "https://api.groq.com/openai/v1/chat/completions") else {
print("❌ ScreenAssistant: Invalid Groq API URL")