-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EventFormattingAgent: Provide access to upstream agent #410
Conversation
With this enhancement you can, for example, embed the site URL in an event created by WebsiteAgent by interpolating like "{{agent.options.url}}", or add a message prefix depending on the type of upstream agent using the "case" construct of Liquid.
It is now possible to include an agent name without the special flag just by putting `"agent" => "{{agent.type}}"` in "instructions". This commit includes automatic migration.
Very interesting @knu! Do you think we should have specs on AgentDrop itself? |
Sure, added! |
Awesome, thanks. Do you think we should expose this anywhere we use |
Probably having an EventDrop that returns the payload + .agent for interpolation is the way to go. Let me try. |
To implement this, EventDrop is introduced to represent an Event object in interpolation.
@cantino It's done! I'll be working on a hover-help for Options to explain Liquid interpolation. |
@cantino I think this is now in a good shape for merge, thanks for looking! |
Thanks @knu, this looks great. I'll review closely this weekend, deploy to my setup, and merge. |
EventFormattingAgent: Provide access to upstream agent
Merged @knu, thanks! Can you update the wiki in the Liquid article about this? |
(Also, did you get the email I sent you to knu@idaemons.org?) |
@cantino Thanks for merging it! I guess skip_created_at also can be deprecated after adding created_at to EventDrop, so I'll try that later. |
@cantino I'm yet to locate your mail. Could you give me any of Message-Id/Date/From? |
Odd. I'm happy to send it again. It's from andrew at andrewcantino.
|
I successfully received the mail, for the record. |
@cantino I updated the wiki page, review appreciated! |
Looks good! Would you mind adding an example configuration that shows accessing a property from the event and agent? Something like " |
Excerpt from the commit log of e55bb4a:
I believe user cannot do harm via AgentDrop, but let me know if I'm missing something.