fix(history): add emit fn to transports that appends to chat history#558
Conversation
dkolas
left a comment
There was a problem hiding this comment.
Looks good, this seems like a solid improvement on the current.
Non-blocking question though: Should it be the Transport's job to append output to the history, or could that be factored into the Agent itself?
| else: | ||
| # Do nothing here; this could be a message we intentionally don't want to respond to (ex. an image or file upload) | ||
| pass | ||
| self.agent_service.run_agent(self.agent_service.get_default_agent(), context) |
There was a problem hiding this comment.
Is the response from run_agent always None? Otherwise it seems like this deletes the call to self.send.
There was a problem hiding this comment.
Yeah, run_agent doesn't return anything.
I couldn't convince myself that the Maybe we start here, and see how we can refactor in a bit? |
897d020 to
21da088
Compare
| from steamship.invocable import PackageService, post | ||
|
|
||
|
|
||
| def build_context_appending_emit_func( |
|
This fixed my issue with the widget transport not remembering things between calls. Thank you Doug. |
Existing transports were not appending messages sent back to users to the
ChatHistory. This PR attempts to fix that by introducing a builder for an emit function that will do that directly.