1313from askui .container import telemetry
1414from askui .locators .locators import Locator
1515from askui .models .shared .agent_message_param import MessageParam
16- from askui .models .shared .agent_on_message_cb import OnMessageCb
1716from askui .models .shared .conversation import Conversation , Speakers
1817from askui .models .shared .settings import (
1918 ActSettings ,
@@ -109,13 +108,12 @@ def __init__(
109108 self .locate_settings = LocateSettings ()
110109 self .caching_settings = CachingSettings ()
111110
112- @telemetry .record_call (exclude = {"goal" , "on_message" , " act_settings" , "tools" })
111+ @telemetry .record_call (exclude = {"goal" , "act_settings" , "tools" })
113112 @validate_call (config = ConfigDict (arbitrary_types_allowed = True ))
114113 def act (
115114 self ,
116115 goal : Annotated [str | list [MessageParam ], Field (min_length = 1 )],
117116 act_settings : ActSettings | None = None ,
118- on_message : OnMessageCb | None = None ,
119117 tools : list [Tool ] | ToolCollection | None = None ,
120118 caching_settings : CachingSettings | None = None ,
121119 ) -> None :
@@ -134,9 +132,6 @@ def act(
134132 act_model (ActModel | None, optional): Model to use for this act
135133 execution.
136134 Overrides the agent's default model if provided.
137- on_message (OnMessageCb | None, optional): Callback for new messages. If
138- it returns `None`, stops and does not add the message. Cannot be used
139- with caching_settings strategy "record" or "both".
140135 tools (list[Tool] | ToolCollection | None, optional): The tools for the
141136 agent. Defaults to default tools depending on the selected model.
142137 caching_settings (CachingSettings | None, optional): The caching settings
@@ -153,8 +148,6 @@ def act(
153148 MaxTokensExceededError: If the model reaches the maximum token limit
154149 defined in the agent settings.
155150 ModelRefusalError: If the model refuses to process the request.
156- ValueError: If on_message callback is provided with caching strategy
157- "record" or "both".
158151
159152 Example:
160153 Basic usage without caching:
@@ -248,9 +241,8 @@ def act(
248241 self ._conversation .cache_manager = cache_manager
249242
250243 # Use conversation-based architecture for execution
251- self ._conversation .start (
244+ self ._conversation .execute_conversation (
252245 messages = messages ,
253- on_message = on_message ,
254246 tools = _tools ,
255247 settings = _act_settings ,
256248 )
0 commit comments