update
This commit is contained in:
+17
-29
@@ -13,6 +13,21 @@ struct Usage
|
||||
outputTokens::Int64
|
||||
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 #
|
||||
@@ -128,22 +143,6 @@ function toolResultMessage(; role="tool", toolCallId="", toolName="",
|
||||
return toolResultMessage(role, toolCallId, toolName, content, details, usage, addedToolNames, isError, timestamp)
|
||||
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 #
|
||||
# ------------------------------------------------------------------------------------------------ #
|
||||
@@ -158,7 +157,7 @@ A tool available to the agent.
|
||||
- `parameters::TParameters`: Tool parameters schema (JSON schema)
|
||||
- `execute::Function`: Tool execution function
|
||||
- `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
|
||||
- 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)
|
||||
execute::Function # Tool execution function
|
||||
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
|
||||
|
||||
|
||||
@@ -346,17 +345,6 @@ struct agentToolResult
|
||||
terminate::Bool
|
||||
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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user