From ba13ccc4b9e43518e4ce4e4f75b63982d650cfaa Mon Sep 17 00:00:00 2001 From: narawat Date: Tue, 4 Aug 2026 23:17:13 +0700 Subject: [PATCH] update --- src/agentCore.jl | 17 ++++++++++------- src/type.jl | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/agentCore.jl b/src/agentCore.jl index 6cc94d2..c2656c2 100644 --- a/src/agentCore.jl +++ b/src/agentCore.jl @@ -176,18 +176,21 @@ julia> # Currently returns a placeholder echo response function _process_message(agent::yiemAgent, msg)::assistantMessage # WORKING - # take every messages from agent.inputChannel, convert them into userMessage - # and add them to agent._state.messages + # loop until LLM didn't use tool calls + while + # take every messages from agent.inputChannel, convert them into userMessage + # and add them to agent._state.messages - # call agent.preprocessContext() + # call agent.preprocessContext() - # Call agent.formatMsgForLLM(agent._state) to format for LLM + # Call agent.formatMsgForLLM(agent._state) to format for LLM - # Call the LLM (blocking — the task waits here) + # Call the LLM (blocking — the task waits here) - # call toolArgumentValidation() to make sure soon-to-call tools has valid arguments + # call toolArgumentValidation() to make sure soon-to-call tools has valid arguments - # If agent has tools, handle tool calls in a loop + # If agent has tools, handle tool calls in a loop, save tool + end # Build assistantMessage and return it diff --git a/src/type.jl b/src/type.jl index 3362e05..bf6e0ce 100644 --- a/src/type.jl +++ b/src/type.jl @@ -204,7 +204,7 @@ A tool available to the agent. - `parameters::TParameters`: Tool parameters schema (JSON schema) - `execute::Function`: Tool execution function - `prepareArguments::Union{Function, Nothing}`: Optional argument preparation callback -- `executionMode::Union{toolExecutionMode, Nothing}`: Override: run tool calls sequentially or in parallel +- `parallelExecute::Union{toolparallelExecute, Nothing}`: Override: run tool calls sequentially or in parallel # Returns - A new `agentTool` instance @@ -216,7 +216,7 @@ struct agentTool{TParameters, TDetails} # A tool available to the agent parameters::TParameters # Tool parameters schema (JSON schema) execute::Function # Tool execution function prepareArguments::Union{Function, Nothing} # Optional argument preparation callback - executionMode::Union{toolExecutionMode, Nothing} # Override: run tool calls sequentially or in parallel + parallelExecute::Union{toolparallelExecute, Nothing} # Override: run tool calls sequentially or in parallel end