fix: move json import to module scope in nodes.py
This commit is contained in:
parent
5702a7190b
commit
1cd9c5d455
1 changed files with 1 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ Module-level globals follow the set_config_dir() testability pattern from cforch
|
||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
@ -335,7 +336,6 @@ def pull_ollama_model(node_id: str, body: PullRequest) -> StreamingResponse:
|
||||||
if line:
|
if line:
|
||||||
yield f"data: {line}\n\n"
|
yield f"data: {line}\n\n"
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
import json
|
|
||||||
yield f"data: {json.dumps({'error': str(exc)})}\n\n"
|
yield f"data: {json.dumps({'error': str(exc)})}\n\n"
|
||||||
|
|
||||||
return StreamingResponse(stream(), media_type="text/event-stream")
|
return StreamingResponse(stream(), media_type="text/event-stream")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue