fix(confidence-engine): supply focused deconstruction schema
This commit is contained in:
+4
-4
@@ -96,7 +96,7 @@ function extractOpenAIResponseText(data) {
|
||||
}
|
||||
|
||||
let _chatSupported = null;
|
||||
const reconstructionJsonSchema = z.toJSONSchema(reconstructionV2Schema);
|
||||
export const reconstructionJsonSchema = z.toJSONSchema(reconstructionV2Schema);
|
||||
const openAIReconstructionJsonSchema = createOpenAIStrictSchema(
|
||||
reconstructionJsonSchema,
|
||||
reconstructionV2Schema,
|
||||
@@ -251,7 +251,7 @@ async function detectChatSupport(baseUrl, modelName) {
|
||||
}
|
||||
|
||||
class OllamaLlmProvider {
|
||||
async generateReconstruction(scenario, modelName) {
|
||||
async generateReconstruction(scenario, modelName, outputSchema) {
|
||||
// scenario is ALREADY a fully-built prompt text (built by analyseScenario).
|
||||
// Do NOT call buildPrompt() again — that would double-wrap the prompt.
|
||||
const prompt = scenario;
|
||||
@@ -279,7 +279,7 @@ class OllamaLlmProvider {
|
||||
providerExecution.chatCapabilityDetected = chatSupported;
|
||||
|
||||
// ================================================================
|
||||
// Step 2: Try /api/chat if supported with the reconstruction schema
|
||||
// Step 2: Try /api/chat if supported with the supplied or reconstruction schema
|
||||
// ================================================================
|
||||
if (chatSupported) {
|
||||
try {
|
||||
@@ -295,7 +295,7 @@ class OllamaLlmProvider {
|
||||
model: modelName,
|
||||
messages: [{ role: "user", content: prompt }],
|
||||
stream: false,
|
||||
format: reconstructionJsonSchema,
|
||||
format: outputSchema ?? reconstructionJsonSchema,
|
||||
}),
|
||||
signal: controller.signal,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user