update
This commit is contained in:
+1
-2
@@ -202,7 +202,6 @@ function _process_message(agent::yiemAgent)::assistantMessage
|
|||||||
push!(agent._state.messages, user_msg)
|
push!(agent._state.messages, user_msg)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# call agent.prepareContext()
|
# call agent.prepareContext()
|
||||||
preparedContext = agent.prepareContext(agent._state)
|
preparedContext = agent.prepareContext(agent._state)
|
||||||
|
|
||||||
@@ -998,7 +997,7 @@ function executeToolCalls(
|
|||||||
hasSequential = false
|
hasSequential = false
|
||||||
for tc in toolCalls
|
for tc in toolCalls
|
||||||
for t in context.tools
|
for t in context.tools
|
||||||
if t.name == tc.name && get(t.executionMode, "parallel") == "sequential"
|
if t.name == tc.name && !t.parallelToolExecute
|
||||||
hasSequential = true
|
hasSequential = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|||||||
+17
-29
@@ -13,6 +13,21 @@ struct Usage
|
|||||||
outputTokens::Int64
|
outputTokens::Int64
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------------------------ #
|
||||||
|
# Message content types #
|
||||||
|
# ------------------------------------------------------------------------------------------------ #
|
||||||
|
|
||||||
|
abstract type messageContent end # Base type for message content
|
||||||
|
|
||||||
|
struct textContent <: messageContent # Plain text message content
|
||||||
|
text::String # The text content
|
||||||
|
end
|
||||||
|
|
||||||
|
struct imageContent <: messageContent # Image message content
|
||||||
|
data::String # Base64-encoded image data
|
||||||
|
mimeType::String # MIME type (e.g., "image/png")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------------------------ #
|
# ------------------------------------------------------------------------------------------------ #
|
||||||
# Message types #
|
# Message types #
|
||||||
@@ -128,22 +143,6 @@ function toolResultMessage(; role="tool", toolCallId="", toolName="",
|
|||||||
return toolResultMessage(role, toolCallId, toolName, content, details, usage, addedToolNames, isError, timestamp)
|
return toolResultMessage(role, toolCallId, toolName, content, details, usage, addedToolNames, isError, timestamp)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------------------------ #
|
|
||||||
# Message content types #
|
|
||||||
# ------------------------------------------------------------------------------------------------ #
|
|
||||||
|
|
||||||
abstract type messageContent end # Base type for message content
|
|
||||||
|
|
||||||
struct textContent <: messageContent # Plain text message content
|
|
||||||
text::String # The text content
|
|
||||||
end
|
|
||||||
|
|
||||||
struct imageContent <: messageContent # Image message content
|
|
||||||
data::String # Base64-encoded image data
|
|
||||||
mimeType::String # MIME type (e.g., "image/png")
|
|
||||||
end
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------------------------ #
|
# ------------------------------------------------------------------------------------------------ #
|
||||||
# Tool types #
|
# Tool types #
|
||||||
# ------------------------------------------------------------------------------------------------ #
|
# ------------------------------------------------------------------------------------------------ #
|
||||||
@@ -158,7 +157,7 @@ A tool available to the agent.
|
|||||||
- `parameters::TParameters`: Tool parameters schema (JSON schema)
|
- `parameters::TParameters`: Tool parameters schema (JSON schema)
|
||||||
- `execute::Function`: Tool execution function
|
- `execute::Function`: Tool execution function
|
||||||
- `prepareArguments::Union{Function, Nothing}`: Optional argument preparation callback
|
- `prepareArguments::Union{Function, Nothing}`: Optional argument preparation callback
|
||||||
- `parallelExecute::Union{toolparallelExecute, Nothing}`: Override: run tool calls sequentially or in parallel
|
- `parallelToolExecute::Bool`: Override: run tool calls sequentially or in parallel
|
||||||
|
|
||||||
# Returns
|
# Returns
|
||||||
- A new `agentTool` instance
|
- A new `agentTool` instance
|
||||||
@@ -170,7 +169,7 @@ struct agentTool{TParameters, TDetails} # A tool available to the agent
|
|||||||
parameters::TParameters # Tool parameters schema (JSON schema)
|
parameters::TParameters # Tool parameters schema (JSON schema)
|
||||||
execute::Function # Tool execution function
|
execute::Function # Tool execution function
|
||||||
prepareArguments::Union{Function, Nothing} # Optional argument preparation callback
|
prepareArguments::Union{Function, Nothing} # Optional argument preparation callback
|
||||||
parallelExecute::Union{toolparallelExecute, Nothing} # Override: run tool calls sequentially or in parallel
|
parallelToolExecute::Bool # Override: run tool calls sequentially or in parallel
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -346,17 +345,6 @@ struct agentToolResult
|
|||||||
terminate::Bool
|
terminate::Bool
|
||||||
end
|
end
|
||||||
|
|
||||||
"""
|
|
||||||
Function type for parallel execution override on a tool.
|
|
||||||
|
|
||||||
# Arguments
|
|
||||||
- Context for parallel execution
|
|
||||||
|
|
||||||
# Returns
|
|
||||||
- `agentToolCallBatch`: The result batch from parallel execution
|
|
||||||
"""
|
|
||||||
const toolparallelExecute = Function
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Context passed to the `beforeToolCall` hook.
|
Context passed to the `beforeToolCall` hook.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user