From e864cdb99a5b93afdab3307a5b7e52ffb25f1eb5 Mon Sep 17 00:00:00 2001 From: Maria-Aidarus Date: Mon, 27 Nov 2023 13:02:56 +0300 Subject: [PATCH] updated the paramters for the gpt function --- netlify/functions/handleMetadata.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netlify/functions/handleMetadata.js b/netlify/functions/handleMetadata.js index 7df26da..eff5401 100644 --- a/netlify/functions/handleMetadata.js +++ b/netlify/functions/handleMetadata.js @@ -43,11 +43,11 @@ function simplifyContent(content) { // Placeholder function to perform GPT analysis for media type and topics using Mistral-7b via OpenRouter -async function performGPTAnalysis(content) { +async function performGPTAnalysis(simplifiedContent, apiKey) { // Implement logic to send content to Mistral-7b via OpenRouter for GPT analysis // Send content and receive GPT analysis response // Placeholder code - const inferredMediaType = "article"; + const inferredMediaType = ["article"]; const extractedTopics = ["topic1", "topic2"]; return { inferredMediaType, extractedTopics }; } @@ -94,7 +94,7 @@ export async function handler(event) { const simplifiedContent = simplifyContent(fetchedContent); // Step 3: Perform GPT analysis for media type and topics - const { inferredMediaType, extractedTopics } = await performGPTAnalysis(simplifiedContent); + const { inferredMediaType, extractedTopics } = await performGPTAnalysis(simplifiedContent, apiKey); // Step 4: Map inferred values to predefined formats and topics const { predefinedMediaType, predefinedTopics } = mapInferredValues(inferredMediaType, extractedTopics);