feat: add dir
This commit is contained in:
1 parent
ba27d7c095
commit
ded26ce300
8 files changed
+67
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Echo memory after_turn hook — demo plugin.
|
||||
|
||||
Logs the number of messages in the conversation after each turn.
|
||||
|
||||
Receives via stdin:
|
||||
{"type": "after_turn", "agent_id": "...", "messages": [...]}
|
||||
|
||||
Prints to stdout:
|
||||
{"type": "ok"}
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
request = json.loads(sys.stdin.read())
|
||||
agent_id = request.get("agent_id", "unknown")
|
||||
messages = request.get("messages", [])
|
||||
|
||||
# In a real plugin you might update an index or persist state here.
|
||||
# For this demo we just acknowledge.
|
||||
print(json.dumps({"type": "ok"}), flush=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user