fix: provider test FK error, model pull white screen, RECOMMENDED badge
Some checks failed
Auto Tag / auto-tag (push) Successful in 4s
Test / rust-fmt-check (push) Failing after 1m1s
Release / build-macos-arm64 (push) Successful in 3m2s
Test / rust-clippy (push) Successful in 7m16s
Test / frontend-typecheck (push) Has been cancelled
Test / frontend-tests (push) Has been cancelled
Test / rust-tests (push) Has been cancelled
Release / build-linux-amd64 (push) Has been cancelled
Release / build-windows-amd64 (push) Has been cancelled
Release / build-linux-arm64 (push) Has been cancelled
Some checks failed
Auto Tag / auto-tag (push) Successful in 4s
Test / rust-fmt-check (push) Failing after 1m1s
Release / build-macos-arm64 (push) Successful in 3m2s
Test / rust-clippy (push) Successful in 7m16s
Test / frontend-typecheck (push) Has been cancelled
Test / frontend-tests (push) Has been cancelled
Test / rust-tests (push) Has been cancelled
Release / build-linux-amd64 (push) Has been cancelled
Release / build-windows-amd64 (push) Has been cancelled
Release / build-linux-arm64 (push) Has been cancelled
This commit is contained in:
parent
56e52ee09c
commit
652418017c
@ -259,6 +259,21 @@ pub async fn chat_message(
|
||||
Ok(response)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn test_provider_connection(
|
||||
provider_config: ProviderConfig,
|
||||
) -> Result<ChatResponse, String> {
|
||||
let provider = create_provider(&provider_config);
|
||||
let messages = vec![Message {
|
||||
role: "user".into(),
|
||||
content: "Reply with exactly: TFTSR connection test successful.".into(),
|
||||
}];
|
||||
provider
|
||||
.chat(messages, &provider_config)
|
||||
.await
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn list_providers() -> Result<Vec<ProviderInfo>, String> {
|
||||
Ok(vec![
|
||||
|
||||
@ -70,6 +70,7 @@ pub fn run() {
|
||||
// AI
|
||||
commands::ai::analyze_logs,
|
||||
commands::ai::chat_message,
|
||||
commands::ai::test_provider_connection,
|
||||
commands::ai::list_providers,
|
||||
// Docs
|
||||
commands::docs::generate_rca,
|
||||
|
||||
@ -57,7 +57,7 @@ pub async fn pull_model(app_handle: tauri::AppHandle, model_name: &str) -> anyho
|
||||
"status": status,
|
||||
"total": total,
|
||||
"completed": completed,
|
||||
"percent": percent,
|
||||
"progress": percent,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ export function HardwareReport({ hardware, recommendations }: HardwareReportProp
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
{rec.recommended && (
|
||||
<Badge className="bg-green-600 text-white">RECOMMENDED</Badge>
|
||||
<Badge variant="success">RECOMMENDED</Badge>
|
||||
)}
|
||||
<div>
|
||||
<p className="text-sm font-medium">{rec.name}</p>
|
||||
|
||||
@ -280,6 +280,7 @@ const badgeVariants = cva(
|
||||
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
||||
destructive: "border-transparent bg-destructive text-destructive-foreground",
|
||||
outline: "text-foreground",
|
||||
success: "border-transparent bg-green-600 text-white",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
|
||||
@ -265,6 +265,9 @@ export const applyRedactionsCmd = (logFileId: string, approvedSpanIds: string[])
|
||||
|
||||
// ─── Issue CRUD ───────────────────────────────────────────────────────────────
|
||||
|
||||
export const testProviderConnectionCmd = (providerConfig: ProviderConfig) =>
|
||||
invoke<ChatResponse>("test_provider_connection", { providerConfig });
|
||||
|
||||
export const createIssueCmd = (newIssue: NewIssue) =>
|
||||
invoke<Issue>("create_issue", {
|
||||
title: newIssue.title,
|
||||
|
||||
@ -17,7 +17,7 @@ import {
|
||||
Separator,
|
||||
} from "@/components/ui";
|
||||
import { useSettingsStore } from "@/stores/settingsStore";
|
||||
import { chatMessageCmd, type ProviderConfig, type Message } from "@/lib/tauriCommands";
|
||||
import { testProviderConnectionCmd, type ProviderConfig } from "@/lib/tauriCommands";
|
||||
|
||||
const emptyProvider: ProviderConfig = {
|
||||
name: "",
|
||||
@ -82,10 +82,7 @@ export default function AIProviders() {
|
||||
setIsTesting(true);
|
||||
setTestResult(null);
|
||||
try {
|
||||
const testMessages: Message[] = [
|
||||
{ role: "user", content: "Reply with exactly: TFTSR connection test successful." },
|
||||
];
|
||||
const response = await chatMessageCmd("test-connection", "Test connection", form);
|
||||
const response = await testProviderConnectionCmd(form);
|
||||
setTestResult({ success: true, message: `OK: ${response.content.slice(0, 100)}` });
|
||||
} catch (err) {
|
||||
setTestResult({ success: false, message: String(err) });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user