mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-02 02:11:58 +00:00
Fix Vertex streaming metadata from hidden params
This commit is contained in:
parent
5ffea2f1d7
commit
15507be90a
2 changed files with 6 additions and 2 deletions
|
|
@ -2268,7 +2268,12 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig):
|
|||
return value
|
||||
model_extra = chunk.get("model_extra")
|
||||
if isinstance(model_extra, dict):
|
||||
return model_extra.get(field_name)
|
||||
value = model_extra.get(field_name)
|
||||
if value is not None:
|
||||
return value
|
||||
hidden_params = chunk.get("_hidden_params")
|
||||
if isinstance(hidden_params, dict):
|
||||
return hidden_params.get(field_name)
|
||||
return None
|
||||
return getattr(chunk, field_name, None)
|
||||
|
||||
|
|
|
|||
|
|
@ -720,7 +720,6 @@ def test_stream_chunk_builder_propagates_vertex_ai_metadata_from_dict_chunks():
|
|||
)
|
||||
],
|
||||
).model_dump()
|
||||
chunk_dict["vertex_ai_grounding_metadata"] = [{"webSearchQueries": ["test query"]}]
|
||||
chunk_dict["_hidden_params"] = {
|
||||
"vertex_ai_grounding_metadata": [{"webSearchQueries": ["test query"]}]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue