fix: single dispatch order
ref: N25B-429
This commit is contained in:
@@ -378,23 +378,23 @@ class AgentSpeakGenerator:
|
||||
def _(self, la: LLMAction) -> AstExpression:
|
||||
return AstLiteral("reply_with_goal", [AstString(la.goal)])
|
||||
|
||||
@staticmethod
|
||||
@singledispatchmethod
|
||||
@staticmethod
|
||||
def slugify(element: ProgramElement) -> str:
|
||||
raise NotImplementedError(f"Cannot convert element {element} to a slug.")
|
||||
|
||||
@staticmethod
|
||||
@slugify.register
|
||||
@staticmethod
|
||||
def _(sb: SemanticBelief) -> str:
|
||||
return f"semantic_{AgentSpeakGenerator._slugify_str(sb.name)}"
|
||||
|
||||
@staticmethod
|
||||
@slugify.register
|
||||
@staticmethod
|
||||
def _(g: Goal) -> str:
|
||||
return AgentSpeakGenerator._slugify_str(g.name)
|
||||
|
||||
@staticmethod
|
||||
@slugify.register
|
||||
@staticmethod
|
||||
def _(t: Trigger):
|
||||
return f"trigger_{AgentSpeakGenerator._slugify_str(t.name)}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user