fix: reorder elif chain so rawPredict is checked before predict

The generic "predict" in url_route check was shadowing the
"rawPredict" branch because "predict" is a substring of "rawPredict".
This made the meta publisher detection and partner model config
routing dead code for rawPredict URLs.

Reorder: predictLongRunning → generateContent → rawPredict → predict

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Harshit28j 2026-03-07 04:28:13 +05:30
parent aeae28bda3
commit 1339513f8b

View file

@ -130,13 +130,6 @@ class VertexPassthroughLoggingHandler:
"kwargs": kwargs,
}
elif "predict" in url_route:
return VertexPassthroughLoggingHandler._handle_predict_response(
httpx_response=httpx_response,
logging_obj=logging_obj,
url_route=url_route,
kwargs=kwargs,
)
elif "rawPredict" in url_route or "streamRawPredict" in url_route:
from litellm.llms.vertex_ai.vertex_ai_partner_models import (
get_vertex_ai_partner_model_config,
@ -191,6 +184,13 @@ class VertexPassthroughLoggingHandler:
"result": litellm_prediction_response,
"kwargs": kwargs,
}
elif "predict" in url_route:
return VertexPassthroughLoggingHandler._handle_predict_response(
httpx_response=httpx_response,
logging_obj=logging_obj,
url_route=url_route,
kwargs=kwargs,
)
elif "search" in url_route:
litellm_vs_response = (