@bitkyc08/opencodex
Version:
Universal provider proxy for OpenAI Codex & Claude Code — use any LLM with Codex CLI/App/SDK and Claude Code
14 lines (12 loc) • 777 B
text/typescript
import type { OcxRequestOptions } from "../../types";
/** Prompt fallback only; Cursor does not enforce JSON decoding or validate the response. */
export function cursorStructuredOutputInstructions(format: OcxRequestOptions["textFormat"]): string {
if (!format) return "";
const schema = format.type === "json_schema" && format.schema
? `\nYour final JSON must conform to this JSON Schema:\n${JSON.stringify(format.schema)}`
: "";
const kind = format.type === "json_object" ? "JSON object" : "JSON value";
return `[Final response format]\nWhen ready to answer, return only a valid ${kind}: no Markdown, no code fences, no headings or prose outside the JSON. `
+ "This requirement applies to your final answer, not intermediate tool calls."
+ schema;
}