v3.1.5.5
New Feature:
-
[Agent Component: Session]
Added chat history manual management methods and settings:Methods:
.add_chat_history(role: str, cotnent: str)
.get_chat_history(*, is_shorten: bool=False)
.rewrite_chat_history(new_chat_history: list)
Settings:
strict_orders
:
Setting value is set asTrue
by default.
If this setting isTrue
, component will ensure chat history append in "User-Assistant-User-Assistant" orders and when the order is incorrect, manual management methods above will automatically help developers combining chat history content.
You can use.toggle_strict_orders(False)
to avoidstrict_orders
mode.manual_chat_history
:
Setting value is set asFalse
by default.
You can use.toggle_manual_chat_history(True)
to activemanual chat history management
mode.
If this setting isTrue
, component will stop automatically fetch and append chat history from agent request's response to allow developers to add chat history manually using methods above. Turn on this setting when.active_session()
is on will ensure manual managed chat history be passed to next agent request to enable manual managed multi-round chat.
Update:
[Tool]
Improved tool using prompt and improved the adaptation whentimelimit
argument is not inoptions
dict when using search tool;[Framework]
Updated agent alias info printer, now you can useagent.alias_manager.print_alias_info(group_by="agent_component")
to print alias group by component names;[Framework]
Updated JSON find and decode methods, import json5 lib and improved error report detail in debug mode;[Request: ERNIE]
Updated default model name to "ernie-4.0" to follow Baidu official model name updating.
Bug Fix:
[Framework]
Fixed event loop closed error when using tools or fixing json decode error;[Agent Component: Segment]
Fixed a bug that will cause segment main thread close too early before all async handlers finish their works;[Agent Component: Segment]
Fixed a bug that will cause segment can not overwrite prompt_output.