🐛 fix(process.py): add error handling for unknown langchain_object types
When processing the data graph, if the langchain_object is of an unknown type, a ValueError is now raised. This provides better error handling and helps identify any unexpected langchain_object types that may be encountered during processing.
This commit is contained in:
parent
7eeacfbb31
commit
f81a835001
1 changed files with 4 additions and 0 deletions
|
|
@ -107,6 +107,10 @@ def process_graph_cached(data_graph: Dict[str, Any], inputs: Optional[dict] = No
|
|||
elif isinstance(langchain_object, VectorStore):
|
||||
class_name = langchain_object.__class__.__name__
|
||||
result = {"message": f"Processed {class_name} successfully"}
|
||||
else:
|
||||
raise ValueError(
|
||||
f"Unknown langchain_object type: {type(langchain_object).__name__}"
|
||||
)
|
||||
return result
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue