update
This commit is contained in:
+12
-12
@@ -5,7 +5,7 @@ export _agent_loop, OpenAiToUserMessage
|
||||
using JSON, DataStructures, Dates, UUIDs, HTTP, Random, PrettyPrinting, Serialization,
|
||||
DataFrames, Serde, Base.Threads
|
||||
using GeneralUtils
|
||||
using ..type, ..utils, ..llmfunction
|
||||
using ..type, ..utils
|
||||
|
||||
# ---------------------------------------------- 100 --------------------------------------------- #
|
||||
|
||||
@@ -406,7 +406,7 @@ julia> shouldTerminate([finalizedOutcome(tc, agentToolResult([], dict{any,any}()
|
||||
true
|
||||
```
|
||||
"""
|
||||
function shouldTerminate(batches::vector{finalizedOutcome})::bool
|
||||
function shouldTerminate(batches::Vector{finalizedOutcome})::Bool
|
||||
return !isempty(batches) && all(b -> b.result.terminate, batches)
|
||||
end
|
||||
|
||||
@@ -513,8 +513,8 @@ function prepareToolCall(
|
||||
assistantMsg::assistantMessage,
|
||||
toolCall::agentToolCall,
|
||||
config::agentLoopConfig,
|
||||
signal::union{nothing,abortSignal},
|
||||
)::union{preparedToolCall,immediateOutcome}
|
||||
signal::Union{Nothing, abortSignal},
|
||||
)::Union{preparedToolCall,immediateOutcome}
|
||||
|
||||
tool = find(t -> t.name == toolCall.name, context.tools)
|
||||
if tool === nothing
|
||||
@@ -588,7 +588,7 @@ executePreparedToolCall(prep, nothing, emit)
|
||||
"""
|
||||
function executePreparedToolCall(
|
||||
prep::preparedToolCall,
|
||||
signal::union{nothing,abortSignal},
|
||||
signal::Union{Nothing,abortSignal},
|
||||
emit::Function,
|
||||
)::executedOutcome
|
||||
|
||||
@@ -678,7 +678,7 @@ function finalizeExecutedToolCall(
|
||||
prep::preparedToolCall,
|
||||
executed::executedOutcome,
|
||||
config::agentLoopConfig,
|
||||
signal::union{nothing,abortSignal},
|
||||
signal::Union{Nothing,abortSignal},
|
||||
)::finalizedOutcome
|
||||
|
||||
result = executed.result
|
||||
@@ -795,9 +795,9 @@ executeToolCallsSequential(ctx, msg, [deployTc], config, nothing, emit)
|
||||
function executeToolCallsSequential(
|
||||
context::agentContext,
|
||||
assistantMsg::assistantMessage,
|
||||
toolCalls::vector{agentToolCall},
|
||||
toolCalls::Vector{agentToolCall},
|
||||
config::agentLoopConfig,
|
||||
signal::union{nothing,abortSignal},
|
||||
signal::Union{Nothing,abortSignal},
|
||||
emit::Function,
|
||||
)::agentToolCallBatch
|
||||
|
||||
@@ -888,9 +888,9 @@ executeToolCallsParallel(ctx, msg, [tc1, tc2, tc3], config, abortedSignal, emit)
|
||||
function executeToolCallsParallel(
|
||||
context::agentContext,
|
||||
assistantMsg::assistantMessage,
|
||||
toolCalls::vector{agentToolCall},
|
||||
toolCalls::Vector{agentToolCall},
|
||||
config::agentLoopConfig,
|
||||
signal::union{nothing,abortSignal},
|
||||
signal::Union{Nothing,abortSignal},
|
||||
emit::Function,
|
||||
)::agentToolCallBatch
|
||||
|
||||
@@ -988,9 +988,9 @@ executeToolCalls(ctx, msg, [searchTc, fetchTc], configSequential, nothing, emit)
|
||||
function executeToolCalls(
|
||||
context::agentContext,
|
||||
assistantMsg::assistantMessage,
|
||||
toolCalls::vector{agentToolCall},
|
||||
toolCalls::Vector{agentToolCall},
|
||||
config::agentLoopConfig,
|
||||
signal::union{nothing,abortSignal},
|
||||
signal::Union{Nothing,abortSignal},
|
||||
emit::Function,
|
||||
)::agentToolCallBatch
|
||||
|
||||
|
||||
Reference in New Issue
Block a user