Repository navigation
v1.5.0
This release addresses the request related issues brought up here regarding the use of multiple "meta" id's and the semantics of automatic responses to messages. Shoutout to @wwj718 for the great feedback for these updates!
Since this includes breaking changes, the version has been bumped to 1.5.0.
Summary:
-
All messages now populate the
meta.idfield with a UUID by default. Agents may set their own custommeta.idupon sending to overwrite the generated ID.In addition,
Agent.send()now returns themeta.idof the sent message. This way you may store the generated ID for your own purposes. -
Removed the use of
meta.response_idandmeta.request_id. These have been replaced bymeta.parent_id. I think the term "parent" is clearer. This choice is inspired by the Jupyter messaging docs.To be clear,
meta.parent_idif set, refers to themeta.idof the original message which the current message is responding to.To illustrate, the following would be typical meta fields in a send/response pair:
# send { "meta": { "id": "123", # the message ID here }, ... } # response { "meta": { "id": "456", # response has its own unique meta.id "parent_id": "123", # refers to the prior message }, ... }
-
All messages will now result in a
[response]message like the above, returning the return value or error result from the message's action. These messages (unless using therequest()method) will invoke thehandle_action_value()andhandle_action_error()methods appropriately.One might want to filter these messages from view in a user interface. The demo Gradio app has been updated to demonstrate this. See the
_should_render()andget_chatbot_message()methods for an example. -
Agent.original_message()has been renamed toAgent.parent_message(). Additionallyparent_message()takes a message as a parameter, allowing you to traverse a chain of messages in reverse. -
Internally renamed
Agent._pending_responsestoAgent._pending_requestswhich I think is clearer. -
The logger has been updated to provide colorization of output for easier reading. You may change the default "monokai" pygments style used for object output, by setting the
LOG_PYGMENTS_STYLEenvironment variable. -
Log "warning" messages for unimplemented
handle_action_valueandhandle_action_errormethods have been updated to only print once per session, in order to reduce logging noise in the default setting. -
Tests and documentation updated.