MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / applyJsonModeIfEnabled

Function applyJsonModeIfEnabled

packages/baseai/src/dev/llms/utils.ts:21–30  ·  view source on GitHub ↗
(modelParams: ModelParams, pipe: Pipe)

Source from the content-addressed store, hash-verified

19}
20
21export function applyJsonModeIfEnabled(modelParams: ModelParams, pipe: Pipe) {
22 const hasJsonMode = isJsonModeOn({
23 currentModel: modelParams.model as string,
24 jsonMode: pipe.json || false
25 });
26
27 if (hasJsonMode) {
28 modelParams.response_format = { type: 'json_object' };
29 }
30}
31
32export function applyJsonModeIfEnabledForGoogle(
33 transformedRequestParams: any,

Callers 3

callGroqFunction · 0.90
callOpenAIFunction · 0.90
callTogetherFunction · 0.90

Calls 1

isJsonModeOnFunction · 0.90

Tested by

no test coverage detected