mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-27 02:45:24 +08:00
feat(processors): add explicitly bound plugin event processors
This commit is contained in:
@@ -10,6 +10,7 @@ from langbot_plugin.api.entities.builtin.agent_runner.result import (
|
||||
MessageCompletedPayload,
|
||||
MessageDeltaPayload,
|
||||
RunCompletedPayload,
|
||||
ProcessorLogPayload,
|
||||
RunFailedPayload,
|
||||
StateUpdatedPayload,
|
||||
ToolCallCompletedPayload,
|
||||
@@ -34,6 +35,7 @@ STRICT_RESULT_PAYLOADS: dict[str, type[pydantic.BaseModel]] = {
|
||||
'action.requested': ActionRequestedPayload,
|
||||
'run.completed': RunCompletedPayload,
|
||||
'run.failed': RunFailedPayload,
|
||||
'processor.log': ProcessorLogPayload,
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +116,9 @@ class AgentResultNormalizer:
|
||||
if not self.validate_payload(result_type, data, descriptor):
|
||||
return None
|
||||
|
||||
if result_type == 'processor.log':
|
||||
return None
|
||||
|
||||
if result_type == 'message.delta':
|
||||
return self._normalize_message_delta(data, descriptor)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user