update
This commit is contained in:
+6
-1
@@ -375,7 +375,9 @@ mutable struct yiemAgent <: agent # High-level agent wrapper
|
|||||||
preprocessContext ::Union{Function, Nothing}
|
preprocessContext ::Union{Function, Nothing}
|
||||||
|
|
||||||
# Convert preprocessContext()'s new Vector{agentMessage} to LLM message format
|
# 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..)
|
# Callback invoked before executing a tool call (ask for user permission/confirmation/abort, etc..)
|
||||||
beforeToolCall::Union{Function, Nothing}
|
beforeToolCall::Union{Function, Nothing}
|
||||||
@@ -402,6 +404,7 @@ on `inputChannel` and `followUpChannel` channels concurrently.
|
|||||||
- `tools::Vector{agentTool}`: Available tools (default: empty)
|
- `tools::Vector{agentTool}`: Available tools (default: empty)
|
||||||
- `messages::Vector{agentMessage}`: Initial conversation messages (default: empty)
|
- `messages::Vector{agentMessage}`: Initial conversation messages (default: empty)
|
||||||
- `formatMsgForLLM::Function`: Convert agent messages to LLM message format (default: `defaultformatMsgForLLM`)
|
- `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`)
|
- `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`)
|
- `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`)
|
- `afterToolCall::Union{Function, Nothing}`: Callback invoked after executing a tool call (default: `nothing`)
|
||||||
@@ -427,6 +430,7 @@ function yiemAgent(
|
|||||||
messages::Vector{agentMessage}=agentMessage[],
|
messages::Vector{agentMessage}=agentMessage[],
|
||||||
preprocessContext::Union{Function, Nothing}=nothing,
|
preprocessContext::Union{Function, Nothing}=nothing,
|
||||||
formatMsgForLLM::Function=defaultformatMsgForLLM,
|
formatMsgForLLM::Function=defaultformatMsgForLLM,
|
||||||
|
llmCall::Function,
|
||||||
beforeToolCall::Union{Function, Nothing}=nothing,
|
beforeToolCall::Union{Function, Nothing}=nothing,
|
||||||
afterToolCall::Union{Function, Nothing}=nothing,
|
afterToolCall::Union{Function, Nothing}=nothing,
|
||||||
prepareNextTurn::Union{Function, Nothing}=nothing,
|
prepareNextTurn::Union{Function, Nothing}=nothing,
|
||||||
@@ -449,6 +453,7 @@ function yiemAgent(
|
|||||||
nothing, # placeholder — replaced below
|
nothing, # placeholder — replaced below
|
||||||
preprocessContext,
|
preprocessContext,
|
||||||
formatMsgForLLM,
|
formatMsgForLLM,
|
||||||
|
llmCall,
|
||||||
beforeToolCall,
|
beforeToolCall,
|
||||||
afterToolCall,
|
afterToolCall,
|
||||||
prepareNextTurn,
|
prepareNextTurn,
|
||||||
|
|||||||
Reference in New Issue
Block a user