fix: Correct indentation for clarity in chatCore and claude-to-openai response handlers
This commit is contained in:
@@ -411,7 +411,7 @@ export async function handleChatCore({ body, modelInfo, credentials, log, onCred
|
|||||||
await onRequestSuccess();
|
await onRequestSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log usage for non-streaming responses
|
// Log usage for non-streaming responses
|
||||||
const usage = extractUsageFromResponse(responseBody, provider);
|
const usage = extractUsageFromResponse(responseBody, provider);
|
||||||
appendRequestLog({ model, provider, connectionId, tokens: usage, status: "200 OK" }).catch(() => { });
|
appendRequestLog({ model, provider, connectionId, tokens: usage, status: "200 OK" }).catch(() => { });
|
||||||
if (usage && typeof usage === 'object') {
|
if (usage && typeof usage === 'object') {
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export function claudeToOpenAIResponse(chunk, state) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case "message_stop": {
|
case "message_stop": {
|
||||||
if (!state.finishReasonSent) {
|
if (!state.finishReasonSent) {
|
||||||
const finishReason = state.finishReason || (state.toolCalls?.size > 0 ? "tool_calls" : "stop");
|
const finishReason = state.finishReason || (state.toolCalls?.size > 0 ? "tool_calls" : "stop");
|
||||||
const usageObj = (state.usage && typeof state.usage === 'object') ? {
|
const usageObj = (state.usage && typeof state.usage === 'object') ? {
|
||||||
|
|||||||
Reference in New Issue
Block a user