Tool
Object Hierarchy:
Description:
public class Tool :
Base,
ProgressItem
Parsed tool call (refinement) and/or one execution run.
Refinement: run_id == ""; stored in task.proposed_tools. Use parse(), validate(). Execution run: run_id set; references and optionally
tool_call. run() runs the tool (if any) then the LLM executor; result in summary and document.
See also:
Details
Content:
Properties:
- public Object? arguments { get; set; }
Parsed "arguments" object, or null if absent. Set by parse().
- public ListModel children { get; }
- public Document? document { get; set; }
Executor output document. Set by ResultParser.exec_extract() on
success.
- public Format? exam_reference { get; set; }
Primary document or code the executor must focus on.
- public string id { get; set; }
Execution run id (e.g. "tool-0", "ref-1", "exec"). Empty for
refinement-only.
- public ulong idx_notify_id { get; set; }
- public string issues { get; set; }
Validation or parse error messages; appended by parse() and
validate().
- public Message? message { get; set; }
- public string msg_idx_txt { owned get; }
- public string name { get; set; }
Tool name from parsed JSON (e.g. "write_file").
- public unowned Details parent { get; set; }
The task (Details) this tool belongs to.
- public ArrayList<Format> references { get; set; }
Shared reference links for this exec run.
- public PhaseEnum status { get; set; }
- public string status_str { owned get; }
- public Block? summary { get; set; }
Result summary heading block from executor (Result summary section).
Set by ResultParser.exec_extract(). Never store as text — always the Block.
- public string title { owned get; }
- public ToolCall? tool_call { get; set; }
ToolCall built from name and arguments; set by parse(), used in run()
when this run has a tool.
- public RequestBase? tool_request { get; set; }
- public string tool_run_result { get; set; }
Tool execution result from this run. Set in run() when this run has a
tool_call.
- public string tooltip_text { owned get; }
- public ArrayList<WriteChange> writes { get; set; }
Write operations parsed from the write executor output.
Creation methods:
Methods:
- protected override async void fill_model ()
Set chat_call.model from this task's skill definition when the skill
header has an optional model and it is available; otherwise use default.
- public bool parse (Block block)
Parses a fenced block: expects JSON with "name" and optional
"arguments". Sets this.name, this.arguments, and this.tool_call (uid is assigned by caller via assign_id). Appends to this.issues on
parse failures.
- public async void run () throws Error
Run the tool (if any), build reference content + tool output, combine
for executor input, send executor prompt, parse into summary and document. Up to 5 attempts; on failure appends to parent.issues and
throws.
- public bool validate ()
Validates that tool_call is set, the tool is registered on the
manager, and required arguments are present. Appends to this.issues for refine feedback.
Inherited Members:
All known members inherited from class OLLMchat.Agent.Base
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 OLLMcoder.Task.ProgressItem
All known members inherited from interface OLLMchat.Agent.Interface