feat: use managed model capabilities for reasoning and image input
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
import { parseManagedReasoningChoice } from '../../../shared/managed-model-capabilities';
|
||||
import type { ConversationInteractionResponse } from '../../coding-runtime/contracts';
|
||||
import { CodingConversationServiceError } from '../../coding-runtime/conversation-service';
|
||||
import { normalizeProductModelRef } from '../../coding-projects/project-config';
|
||||
@@ -182,12 +183,15 @@ export async function handleCodingConversationRoutes(
|
||||
return true;
|
||||
}
|
||||
if (action === 'thinking' && req.method === 'POST') {
|
||||
const body = await parseJsonBody<{ thinkingLevel?: unknown }>(req);
|
||||
const body = await parseJsonBody<{ thinkingLevel?: unknown; reasoningChoice?: unknown }>(req);
|
||||
const reasoningChoice = body.reasoningChoice === undefined ? undefined : parseManagedReasoningChoice(body.reasoningChoice);
|
||||
if (reasoningChoice === null) invalidRequest('Reasoning choice is invalid');
|
||||
if (!THINKING_LEVELS.has(String(body.thinkingLevel))) invalidRequest('Thinking level is invalid');
|
||||
sendJson(res, 200, {
|
||||
model: await service.setThinking(
|
||||
conversationId,
|
||||
body.thinkingLevel as 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'max',
|
||||
reasoningChoice ?? undefined,
|
||||
),
|
||||
});
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user