OpenRouter combined mode
+
+ This page calls chat() with
+ both tools and{' '}
+ outputSchema. Native combined
+ mode is working when the model calls{' '}
+ lookup_city_code, returns a
+ typed object, and{' '}
+ structuredOutputStream stays
+ at 0.
+
+ {isLoading + ? 'Waiting for the tool call and the typed object. This can take about 30 seconds.' + : nativeCombined + ? 'Native combined mode is on. structuredOutputStream stayed at 0.' + : combined + ? 'Legacy path ran. structuredOutputStream or the structuredOutput phase was used.' + : 'Ready. Use the sample prompt, then click Run combined test.'} +
+ + {error && ( +{error}
++ Tool calls +
+-
+ {toolCalls.map((part) => (
+
-
+
+ {part.name}{' '} + ({part.state}) +
++ {JSON.stringify( + { + input: part.input, + output: part.output, + }, + null, + 2, + )} ++
+ ))}
+
+ Typed object +
+-
+
- city +
- {result?.city ?? chat.partial.city ?? '…'} +
- code +
- + {result?.code ?? chat.partial.code ?? '…'} + +
- summary +
- {result?.summary ?? chat.partial.summary ?? '…'} +
+ {nativeCombined + ? 'Native combined mode' + : 'Legacy two-call path'} +
+| + Check + | ++ Value + | +
|---|---|
| + supportsCombinedToolsAndSchema + | +{combined.supportsCombined ? 'true' : 'false'} | +
| + chatStream calls + | +{combined.chatStreamCalls} | +
| + chatStream with outputSchema + | +{combined.chatStreamWithSchema} | +
| + structuredOutputStream calls + | +{combined.structuredOutputStreamCalls} | +
| + structuredOutput calls + | +{combined.structuredOutputCalls} | +
| + structuredOutput phase chunks + | +{structuredOutputPhase} | +
+ Two chatStream calls is the agent loop (tool, then
+ final answer). That is not the legacy extra call. The extra call
+ is structuredOutputStream and must stay at 0.
+
-
+ {Object.entries(phaseCounts).map(([phase, count]) => (
+
- + {phase} + {': '} + + {count} chunk{count === 1 ? '' : 's'} + + + ))} +