mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 19:51:02 +02:00
Fixed Term evaluation in messaging translation
This commit is contained in:
parent
bc3c3178d6
commit
7769b29203
2 changed files with 13 additions and 3 deletions
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Term type constants
|
||||
|
|
@ -40,7 +38,7 @@ class Term:
|
|||
language: str = "" # Language tag (mutually exclusive with datatype)
|
||||
|
||||
# For quoted triples (type == TRIPLE)
|
||||
triple: Triple | None = None
|
||||
triple: "Triple | None" = None
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
|
|||
|
|
@ -378,6 +378,17 @@ class Processor(AsyncProcessor):
|
|||
|
||||
logger.info(f"Handling librarian input {id}...")
|
||||
|
||||
# Debug: log types of nested objects
|
||||
if hasattr(v, 'document_metadata') and v.document_metadata:
|
||||
dm = v.document_metadata
|
||||
logger.debug(f"document_metadata type: {type(dm)}")
|
||||
if hasattr(dm, 'metadata'):
|
||||
logger.debug(f"metadata type: {type(dm.metadata)}")
|
||||
if dm.metadata:
|
||||
logger.debug(f"first triple type: {type(dm.metadata[0])}")
|
||||
if hasattr(dm.metadata[0], 's'):
|
||||
logger.debug(f"triple.s type: {type(dm.metadata[0].s)}")
|
||||
|
||||
try:
|
||||
|
||||
resp = await self.process_request(v)
|
||||
|
|
@ -402,6 +413,7 @@ class Processor(AsyncProcessor):
|
|||
|
||||
return
|
||||
except Exception as e:
|
||||
logger.error(f"Unexpected error processing request: {e}", exc_info=True)
|
||||
resp = LibrarianResponse(
|
||||
error = Error(
|
||||
type = "unexpected-error",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue