mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
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:
parent
e8b8ea5602
commit
5c2ab19614
2 changed files with 9 additions and 4 deletions
|
|
@ -358,6 +358,7 @@ struct ModelSelectionView: View {
|
||||||
|
|
||||||
// MARK: - Provider Card
|
// MARK: - Provider Card
|
||||||
struct ProviderCard: View {
|
struct ProviderCard: View {
|
||||||
|
private let wideCardMinHeight: CGFloat = 110
|
||||||
let provider: AIModelProvider
|
let provider: AIModelProvider
|
||||||
let isSelected: Bool
|
let isSelected: Bool
|
||||||
let onSelect: () -> Void
|
let onSelect: () -> Void
|
||||||
|
|
@ -402,7 +403,7 @@ struct ProviderCard: View {
|
||||||
onSelect()
|
onSelect()
|
||||||
}
|
}
|
||||||
.animation(.easeInOut(duration: 0.2), value: isSelected)
|
.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 {
|
private func iconForProvider(_ provider: AIModelProvider) -> String {
|
||||||
|
|
|
||||||
|
|
@ -459,9 +459,13 @@ class ScreenAssistantManager: NSObject, ObservableObject {
|
||||||
|
|
||||||
// Get selected model or default to llama-3.3-70b-versatile
|
// Get selected model or default to llama-3.3-70b-versatile
|
||||||
let selectedModel = Defaults[.selectedAIModel]
|
let selectedModel = Defaults[.selectedAIModel]
|
||||||
let modelId = selectedModel?.id.flatMap { selectedId in
|
let modelId: String
|
||||||
AIModelProvider.groq.supportedModels.contains(where: { $0.id == selectedId }) ? selectedId : nil
|
if let selectedId = selectedModel?.id,
|
||||||
} ?? "llama-3.3-70b-versatile"
|
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 {
|
guard let url = URL(string: "https://api.groq.com/openai/v1/chat/completions") else {
|
||||||
print("❌ ScreenAssistant: Invalid Groq API URL")
|
print("❌ ScreenAssistant: Invalid Groq API URL")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue