fix: TempoMapEditor crash on missing count_in + registry URL + Ollama schema
- Defensive default for count_in in TempoMapEditor prevents crash when AI omits field - Fix hardcoded GitHub registry URL → git.avezzano.io/the_og/clicktrack-registry - Add response_format json_schema to Ollama provider so count_in is always required Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import 'server-only';
|
||||
|
||||
import type { CTPDocument } from "@/lib/ctp/schema";
|
||||
import type { AnalysisInput, AnalysisProvider } from "@/lib/analysis/providers";
|
||||
import { SYSTEM_PROMPT } from "./anthropic";
|
||||
import { SYSTEM_PROMPT, CTP_SCHEMA } from "./anthropic";
|
||||
|
||||
function getBaseUrl(): string {
|
||||
return process.env.OLLAMA_BASE_URL ?? "http://localhost:11434";
|
||||
@@ -44,6 +44,13 @@ async function callOllama(model: string, userMessage: string): Promise<string> {
|
||||
"\n\nRespond with valid JSON only. Do not add any explanation or markdown. Your entire response must be a single valid JSON object matching the schema.",
|
||||
},
|
||||
],
|
||||
response_format: {
|
||||
type: "json_schema",
|
||||
json_schema: {
|
||||
name: "CTPDocument",
|
||||
schema: CTP_SCHEMA,
|
||||
},
|
||||
},
|
||||
stream: false,
|
||||
}),
|
||||
signal: AbortSignal.timeout(120000), // 2-minute timeout for slow local models
|
||||
|
||||
Reference in New Issue
Block a user