ModelVerbalizer
relationalai.agent.cortex.verbalize
ModelVerbalizer(model: relationalai.semantics.Model)Default verbalizer that returns relationship readings from a RAI Model.
Extracts relationship readings from a RAI Model and returns them as sorted, newline-separated text. This provides a concise overview of the model’s semantic relationships.
Parameters
Section titled “Parameters”
(modelModel) - RAI Model to verbalize.
Examples
Section titled “Examples”>>> model = rai.Model("jaffle")>>> verbalizer = ModelVerbalizer(model)>>> print(verbalizer.explain_model())Customer has many OrdersOrder has one CustomerMethods
Section titled “Methods”.explain_model()
Section titled “.explain_model()”ModelVerbalizer.explain_model() -> strReturn sorted, newline-separated relationship readings from the model.
Returns:
str- Sorted relationship readings, one per line.
.explain_concept()
Section titled “.explain_concept()”ModelVerbalizer.explain_concept(concept: str) -> strReturn a generic message since all concepts are explained at the model level.
Parameters:
(conceptstr) - The name of the concept to explain.
Returns:
str- A message indicating that concepts are explained in the model verbalization.
Inheritance Hierarchy
Section titled “Inheritance Hierarchy”Subclassed By
Section titled “Subclassed By”agent > cortex > verbalize └── SourceCodeVerbalizer