globals
This commit is contained in:
@@ -46,33 +46,20 @@ export default function ValidationCard({
|
||||
setTestResult(null);
|
||||
|
||||
try {
|
||||
// Get saved settings to get API key and model
|
||||
// Get saved settings to get model
|
||||
// fetchAPI extracts data from unified format {success: true, data: {...}}
|
||||
// So settingsData IS the data object (config object)
|
||||
const settingsData = await fetchAPI(`/v1/system/settings/integrations/${integrationId}/`);
|
||||
|
||||
let apiKey = '';
|
||||
let model = 'gpt-4.1';
|
||||
let model = 'gpt-4o-mini';
|
||||
|
||||
if (settingsData && typeof settingsData === 'object') {
|
||||
apiKey = settingsData.apiKey || '';
|
||||
model = settingsData.model || 'gpt-4.1';
|
||||
model = settingsData.model || 'gpt-4o-mini';
|
||||
}
|
||||
|
||||
if (!apiKey) {
|
||||
setTestResult({
|
||||
success: false,
|
||||
message: 'API key not configured. Please configure your API key in settings first.',
|
||||
});
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Call test endpoint
|
||||
// Call test endpoint (uses platform API key - no apiKey parameter needed)
|
||||
// For Runware, we don't need with_response or model config
|
||||
const requestBody: any = {
|
||||
apiKey: apiKey,
|
||||
};
|
||||
const requestBody: any = {};
|
||||
|
||||
if (integrationId === 'openai') {
|
||||
requestBody.config = {
|
||||
|
||||
Reference in New Issue
Block a user