RequestBase
Object Hierarchy:
Description:
public abstract class RequestBase : Object, Serializable
Abstract base class for tool request execution.
Request objects handle all execution concerns: reading parameters, building permission questions, requesting permissions, and executing
the actual work. Tools are stateless and create Request objects when execute() is called.
Request objects are deserialized from the function call parameters JSON, so parameter properties should match the parameter names from
the tool's function definition.
Content:
Properties:
- public Interface? agent { get; set; }
Reference to the agent for this tool request.
- public bool is_wrapped { get; set; }
Whether this request is from a wrapped tool.
- public bool one_time_only { get; protected set; }
Whether this permission request should only show "Allow" and "Deny"
buttons (no "Always" options). When true, the permission widget will only show one-time approval buttons. Default: false (shows all
buttons including "Always" options).
- public Operation permission_operation { get; protected set; }
Operation type for permission checking.
- public string permission_question { get; protected set; }
Permission question text.
- public string permission_target_path { get; protected set; }
Target path/resource for permission checking.
- public int request_id { get; set; }
- public BaseTool tool { get; set; }
Reference to the tool that created this request.
Creation methods:
Methods:
- protected abstract bool build_perm_question ()
Abstract method for requests to build permission information.
- public virtual bool deserialize_property (string property_name, out Value value, ParamSpec pspec, Node property_node)
- public virtual async string execute ()
Public method that handles permission checking before execution.
- protected abstract async string execute_request () throws Error
Abstract method for requests to implement their actual execution
logic.
- public unowned ParamSpec? find_property (string name)
- public Value get_property (ParamSpec pspec)
- protected virtual string normalize_file_path (string in_path)
Normalizes a file path using the permission provider's normalization
logic.
- public virtual void on_message_completed (Chat response)
Virtual callback method called when a message is completed.
- public virtual void on_stream_chunk (string new_text, bool is_thinking, Chat response)
Virtual callback method called when a streaming chunk is received.
- public void send_ui (string type, string title, string body)
Send a UI message in standardized codeblock format.
- public void set_property (ParamSpec pspec, Value value)
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 Json.Serializable
- default_deserialize_property
- default_serialize_property
- deserialize_property
- find_property
- get_property
- list_properties
- serialize_property
- set_property