mirror of
https://github.com/mendableai/firecrawl.git
synced 2025-09-25 16:29:43 +00:00
Nick: fixed /extract without a schema
This commit is contained in:
parent
e485ea7e40
commit
eb2e51e50b
@ -162,7 +162,7 @@ export async function generateOpenAICompletions(logger: Logger, options: Extract
|
||||
extract = JSON.parse(jsonCompletion.choices[0].message.content);
|
||||
} else {
|
||||
const extractData = JSON.parse(jsonCompletion.choices[0].message.content);
|
||||
extract = extractData.data.extract;
|
||||
extract = options.schema ? extractData.data.extract : extractData;
|
||||
}
|
||||
} catch (e) {
|
||||
logger.error("Failed to parse returned JSON, no schema specified.", { error: e });
|
||||
|
Loading…
x
Reference in New Issue
Block a user