Base
Object Hierarchy:
Description:
public class Base :
Object,
Interface
Base handler for agent requests.
Created per message/request and manages the lifecycle of a single request. Wraps the client and handles signal relaying for that specific
request.
This is the default handler for simple agents (like JustAsk) that don't need special system message handling. For agents that need system
message regeneration (like CodeAssistant), use a specialized handler.
Content:
Creation methods:
Methods:
- public void add_message (Message message)
Add a UI message to the conversation.
- public Chat chat ()
Get the chat instance for this agent.
- public Config2 config ()
Get the configuration instance for tool execution.
- public virtual async ArrayList<Message> execute_tools (ArrayList<ToolCall> tool_calls)
Executes all tool calls and returns tool reply messages.
- protected virtual async void fill_model ()
Set chat_call.model from session; customize if model_obj is set. On
customize failure, add ui-warning message and use default model. Override in subclasses (e.g. Skill Runner).
- public Provider get_permission_provider ()
Get the permission provider for tool execution.
- public virtual void handle_stream_chunk (string new_text, bool is_thinking, Chat response)
Called by Chat when a streaming chunk is received. Agent handler
should relay to Session.
- public virtual void handle_stream_started ()
Called by Chat when streaming starts. Agent handler should relay to
Session.
- public virtual void handle_tool_message (Message message)
Called by Chat when a tool sends a status message. Agent handler
should relay to Session.
- public void rebuild_tools ()
Rebuilds tools for this agent's Chat instance.
- public void register_tool_monitoring (int request_id, RequestBase request)
Register a tool request for monitoring streaming chunks and message
completion.
- public void replace_chat (Chat new_chat)
Replace the chat instance with a new one.
- public virtual async void send_async (Message message, Cancellable? cancellable = null) throws Error
Sends a Message object asynchronously with streaming support.
- public void unregister_tool (int request_id)
Unregister a tool request from monitoring.
Signals:
- public signal void chat_send (Chat chat_call)
Signal emitted when a chat request is sent to the server.
- public signal void message_completed (Chat response)
Signal emitted when a message is completed. Used by tools to know when
message is done and they can process/finalize.
- public signal void stream_chunk (string new_text, bool is_thinking, Chat response)
Signal emitted when a streaming chunk is received.
- public signal void stream_content (string new_text, Chat response)
Signal emitted when streaming content (not thinking) is received.
- public signal void stream_start ()
Signal emitted when streaming starts.
Fields:
- protected Chat chat_call
Chat instance created in constructor and reused for all requests. Can
be updated if model, options, or other properties change.
- protected Connection connection
Connection for this request (obtained from manager.base_client).
- protected Factory factory
The factory that created this agent.
- public SessionBase session
Reference to Session for accessing Manager and tools (Phase 3: tools
stored on Manager).
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref
All known members inherited from interface OLLMchat.Agent.Interface