This commit is contained in:
2026-08-12 04:00:09 +07:00
parent 2ad3d1df38
commit 06d51c1ee9
3 changed files with 297 additions and 376 deletions
+5 -5
View File
@@ -5,7 +5,7 @@ export yiemAgent, _agent_loop, OpenAiToUserMessage
using JSON, DataStructures, Dates, UUIDs, HTTP, Random, PrettyPrinting, Serialization,
DataFrames, Base.Threads
using GeneralUtils
using ..type, ..utils
using ..type, ..utils, ..toolRegistry
# ---------------------------------------------- 100 --------------------------------------------- #
@@ -85,7 +85,7 @@ on `inputChannel` and `followUpChannel` channels concurrently.
"""
function yiemAgent(
toolsFolderPath::String,
llmCall::Function,
llmCall,
;
systemPrompt::String="You are helpful assistant.",
model=nothing,
@@ -107,12 +107,12 @@ function yiemAgent(
outputChannel = Channel(16)
# load tools from toolsFolderPath
toolStore = YiemAgent.toolStore(name="myagent")
loadTools(toolStore, toolsFolderPath)
toolStore1 = toolStore(name="myagent")
loadTools(toolStore1, toolsFolderPath)
# Create struct with a placeholder task, then spawn and replace it
agent = yiemAgent(
agentState(systemPrompt, model, getTools(toolStore), messages),
agentState(systemPrompt, model, getTools(toolStore1), messages),
inputChannel,
followUp,
outputChannel,