fix: handle empty ticker in MinIO storage paths, clean up debug log
This commit is contained in:
@@ -234,6 +234,12 @@ class OllamaClient:
|
||||
# the model to output plain text instead of valid JSON.
|
||||
# Omitting "think" lets the model use thinking mode (slightly
|
||||
# slower but structured output actually works).
|
||||
"options": {
|
||||
# Ollama defaults num_predict to 4096 which is consumed
|
||||
# entirely by thinking tokens, leaving nothing for content.
|
||||
# Set high enough for thinking + JSON output.
|
||||
"num_predict": self._config.max_tokens,
|
||||
},
|
||||
}
|
||||
|
||||
url = f"{self._config.base_url}/api/chat"
|
||||
|
||||
@@ -267,8 +267,9 @@ def upload_extraction_prompt(
|
||||
Stores under extraction/{ticker}/{yyyy}/{mm}/{dd}/{document_id}/prompt.json
|
||||
"""
|
||||
ts = timestamp or datetime.now(timezone.utc)
|
||||
safe_ticker = ticker or "_unknown"
|
||||
path = (
|
||||
f"extraction/{ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"extraction/{safe_ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"{document_id}/prompt.json"
|
||||
)
|
||||
return upload_artifact(
|
||||
@@ -291,8 +292,9 @@ def upload_extraction_raw_output(
|
||||
Stores under extraction/{ticker}/{yyyy}/{mm}/{dd}/{document_id}/raw_output_{attempt}.json
|
||||
"""
|
||||
ts = timestamp or datetime.now(timezone.utc)
|
||||
safe_ticker = ticker or "_unknown"
|
||||
path = (
|
||||
f"extraction/{ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"extraction/{safe_ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"{document_id}/raw_output_{attempt_index}.json"
|
||||
)
|
||||
return upload_artifact(
|
||||
@@ -314,8 +316,9 @@ def upload_extraction_validation(
|
||||
Stores under extraction/{ticker}/{yyyy}/{mm}/{dd}/{document_id}/validation.json
|
||||
"""
|
||||
ts = timestamp or datetime.now(timezone.utc)
|
||||
safe_ticker = ticker or "_unknown"
|
||||
path = (
|
||||
f"extraction/{ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"extraction/{safe_ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"{document_id}/validation.json"
|
||||
)
|
||||
return upload_artifact(
|
||||
@@ -337,8 +340,9 @@ def upload_extraction_intelligence(
|
||||
Stores under extraction/{ticker}/{yyyy}/{mm}/{dd}/{document_id}/intelligence.json
|
||||
"""
|
||||
ts = timestamp or datetime.now(timezone.utc)
|
||||
safe_ticker = ticker or "_unknown"
|
||||
path = (
|
||||
f"extraction/{ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"extraction/{safe_ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"{document_id}/intelligence.json"
|
||||
)
|
||||
return upload_artifact(
|
||||
|
||||
Reference in New Issue
Block a user