Merge pull request #19576 from BerriAI/litellm_cicd_fix_yj_010

[Infra] CI/CD - Fix UI Build + MyPy Linting
This commit is contained in:
yuneng-jiang 2026-01-22 09:39:21 -08:00 committed by GitHub
commit 84f75b37c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 10 deletions

View file

@ -25,6 +25,7 @@ from litellm.litellm_core_utils.llm_response_utils.convert_dict_to_response impo
_handle_invalid_parallel_tool_calls,
_should_convert_tool_call_to_json_mode,
)
from litellm.litellm_core_utils.core_helpers import map_finish_reason
from litellm.litellm_core_utils.prompt_templates.common_utils import get_tool_call_names
from litellm.litellm_core_utils.prompt_templates.image_handling import (
async_convert_url_to_base64,
@ -586,8 +587,10 @@ class OpenAIGPTConfig(BaseLLMModelInfo, BaseConfig):
enhancements=None,
)
translated_choice.finish_reason = self._get_finish_reason(
translated_message, choice["finish_reason"]
translated_choice.finish_reason = map_finish_reason(
self._get_finish_reason(
translated_message, choice["finish_reason"]
)
)
transformed_choices.append(translated_choice)

View file

@ -181,7 +181,7 @@ const MultiCostResults: React.FC<MultiCostResultsProps> = ({ multiResult, timePe
title: "Model",
dataIndex: "model",
key: "model",
render: (text: string, record: { id: string; provider?: string | null; error?: string | null; loading?: boolean; hasZeroCost?: boolean }) => (
render: (text: string, record: { id: string; provider?: string | null; error?: string | null; loading?: boolean; hasZeroCost?: boolean | null }) => (
<div className="flex flex-col gap-1">
<div className="flex items-center gap-2">
<span className="font-medium text-sm">{text}</span>

View file

@ -33,7 +33,7 @@ export async function makeOpenAIChatCompletionRequest(
// base url should be the current base_url
const isLocal = process.env.NODE_ENV === "development";
if (isLocal !== true) {
console.log = function () {};
console.log = function () { };
}
console.log("isLocal:", isLocal);
const proxyBaseUrl = customBaseUrl || getProxyBaseUrl();
@ -58,7 +58,7 @@ export async function makeOpenAIChatCompletionRequest(
// For collecting complete response text
let fullResponseContent = "";
let fullReasoningContent = "";
// Track MCP metadata from final chunk
let mcpMetadata: {
mcp_list_tools?: any[];
@ -224,15 +224,15 @@ export async function makeOpenAIChatCompletionRequest(
}
// Convert mcp_tool_calls and mcp_call_results to MCPEvent[]
if (mcpMetadata.mcp_tool_calls && mcpMetadata.mcp_tool_calls.length > 0) {
mcpMetadata.mcp_tool_calls.forEach((toolCall: any, index: number) => {
if (mcpMetadata?.mcp_tool_calls && mcpMetadata?.mcp_tool_calls.length > 0) {
mcpMetadata?.mcp_tool_calls.forEach((toolCall: any, index: number) => {
const functionName = toolCall.function?.name || toolCall.name || "";
const functionArgs = toolCall.function?.arguments || toolCall.arguments || "{}";
// Find corresponding result
const result = mcpMetadata.mcp_call_results?.find(
const result = mcpMetadata?.mcp_call_results?.find(
(r: any) => r.tool_call_id === toolCall.id || r.tool_call_id === toolCall.call_id
) || mcpMetadata.mcp_call_results?.[index];
) || mcpMetadata?.mcp_call_results?.[index];
const callEvent: MCPEvent = {
type: "response.output_item.done",