v1.0.176: classify_input + elements_json в промежуточных результатах
This commit is contained in:
@@ -36,13 +36,13 @@ def delete(doc_id):
|
||||
return execute("DELETE FROM documents WHERE id = %s", (doc_id,))
|
||||
|
||||
|
||||
def set_classification(doc_id, doc_type, own_number, parent_number, doc_date, counterparty, classify_raw=None):
|
||||
"""Store LLM classification results + raw response."""
|
||||
def set_classification(doc_id, doc_type, own_number, parent_number, doc_date, counterparty, classify_raw=None, classify_input=None):
|
||||
"""Store LLM classification results + raw response + input text."""
|
||||
return execute(
|
||||
"""UPDATE documents SET doc_type=%s, own_number=%s, parent_number=%s,
|
||||
doc_date=%s, counterparty=%s, classify_status='classified', classify_raw=%s
|
||||
doc_date=%s, counterparty=%s, classify_status='classified', classify_raw=%s, classify_input=%s
|
||||
WHERE id=%s""",
|
||||
(doc_type, own_number, parent_number, doc_date, counterparty, classify_raw, doc_id),
|
||||
(doc_type, own_number, parent_number, doc_date, counterparty, classify_raw, classify_input, doc_id),
|
||||
)
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ def list_by_batch(batch_id):
|
||||
"""All documents in a batch with classification fields."""
|
||||
return query(
|
||||
"""SELECT id, filename, status, doc_type, own_number, parent_number,
|
||||
doc_date, counterparty, classify_status, error_message, classify_raw
|
||||
doc_date, counterparty, classify_status, error_message, classify_raw, classify_input
|
||||
FROM documents WHERE batch_id=%s ORDER BY created_at""",
|
||||
(batch_id,),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user