mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
refactor(vertex_ai): keep yield outside the JSON decode guard
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
7e0714657b
commit
0b33da566a
1 changed files with 2 additions and 1 deletions
|
|
@ -642,12 +642,13 @@ def _iter_openai_jsonl_entries(
|
|||
) -> Iterator[dict[str, Any]]:
|
||||
for lineno, line in _iter_numbered_openai_jsonl_lines(openai_file_content):
|
||||
try:
|
||||
yield json.loads(line)
|
||||
entry: dict[str, Any] = json.loads(line)
|
||||
except json.JSONDecodeError as e:
|
||||
raise VertexAIError(
|
||||
status_code=400,
|
||||
message=f"Invalid JSON on line {lineno} of batch input file: {e.msg}",
|
||||
) from e
|
||||
yield entry
|
||||
|
||||
|
||||
def _parse_vertex_batch_output_row(line: str) -> _VertexBatchRow:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue