update
This commit is contained in:
@@ -377,6 +377,8 @@ mutable struct yiemAgent <: agent # High-level agent wrapper
|
||||
# Convert preprocessContext()'s new Vector{agentMessage} to LLM message format
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user