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