V0.8.0 async think loop #40

Merged
ton merged 50 commits from v0.8.0-async_think_loop into v0.8.0 2026-08-08 04:13:05 +00:00
Showing only changes of commit 2c0f25189b - Show all commits
+6 -1
View File
@@ -375,7 +375,9 @@ mutable struct yiemAgent <: agent # High-level agent wrapper
preprocessContext ::Union{Function, Nothing}
# Convert preprocessContext()'s new Vector{agentMessage} to LLM message format
formatMsgForLLM::Function
formatMsgForLLM::Function
llmCall::Function # Actually invoke the LLM to get a completion response
# Callback invoked before executing a tool call (ask for user permission/confirmation/abort, etc..)
beforeToolCall::Union{Function, Nothing}
@@ -402,6 +404,7 @@ on `inputChannel` and `followUpChannel` channels concurrently.
- `tools::Vector{agentTool}`: Available tools (default: empty)
- `messages::Vector{agentMessage}`: Initial conversation messages (default: empty)
- `formatMsgForLLM::Function`: Convert agent messages to LLM message format (default: `defaultformatMsgForLLM`)
- `llmCall::Function`: Function to invoke the LLM (required)
- `preprocessContext::Union{Function, Nothing}`: Preprocess/transform messages before sending to LLM (default: `nothing`)
- `beforeToolCall::Union{Function, Nothing}`: Callback invoked before executing a tool call (default: `nothing`)
- `afterToolCall::Union{Function, Nothing}`: Callback invoked after executing a tool call (default: `nothing`)
@@ -427,6 +430,7 @@ function yiemAgent(
messages::Vector{agentMessage}=agentMessage[],
preprocessContext::Union{Function, Nothing}=nothing,
formatMsgForLLM::Function=defaultformatMsgForLLM,
llmCall::Function,
beforeToolCall::Union{Function, Nothing}=nothing,
afterToolCall::Union{Function, Nothing}=nothing,
prepareNextTurn::Union{Function, Nothing}=nothing,
@@ -449,6 +453,7 @@ function yiemAgent(
nothing, # placeholder — replaced below
preprocessContext,
formatMsgForLLM,
llmCall,
beforeToolCall,
afterToolCall,
prepareNextTurn,