MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / parseResponseFormat

Function parseResponseFormat

out/cli.cjs:81746–81758  ·  view source on GitHub ↗
(params, content)

Source from the content-addressed store, hash-verified

81744 ...choice.message,
81745 tool_calls: choice.message.tool_calls?.map((toolCall) => parseToolCall(params, toolCall)) ?? [],
81746 parsed: choice.message.content && !choice.message.refusal ? parseResponseFormat(params, choice.message.content) : null
81747 }
81748 };
81749 });
81750 return { ...completion, choices };
81751}
81752function parseResponseFormat(params, content) {
81753 if (params.response_format?.type !== "json_schema") {
81754 return null;
81755 }
81756 if (params.response_format?.type === "json_schema") {
81757 if ("$parseRaw" in params.response_format) {
81758 const response_format = params.response_format;
81759 return response_format.$parseRaw(content);
81760 }
81761 return JSON.parse(content);

Callers 1

parseChatCompletionFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…