fix(audit): trim api key before sending to avoid missing auth header error
This commit is contained in:
@@ -28,6 +28,7 @@ export async function runLLMAudit(
|
|||||||
userPrompt: string,
|
userPrompt: string,
|
||||||
onProgress?: (msg: string) => void,
|
onProgress?: (msg: string) => void,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
|
config = { ...config, apiKey: config.apiKey?.trim() || '' };
|
||||||
if (config.provider === 'openai') {
|
if (config.provider === 'openai') {
|
||||||
return callOpenAI(config, systemPrompt, userPrompt, onProgress);
|
return callOpenAI(config, systemPrompt, userPrompt, onProgress);
|
||||||
} else if (config.provider === 'anthropic') {
|
} else if (config.provider === 'anthropic') {
|
||||||
|
|||||||
Reference in New Issue
Block a user