update docstring

This commit is contained in:
2026-06-25 08:19:25 +07:00
parent 57dd6df942
commit 299a485e4e
2 changed files with 43 additions and 21 deletions
+10 -13
View File
@@ -129,12 +129,13 @@ function decisionMaker(a::T; recentevents::Integer=20, maxattempt=10
context =
"""
<internal_context_for_LLM>
<internal_context_for_assistant>
$(a.memory["scratchpad"])
</internal_context_for_LLM>
</internal_context_for_assistant>
"""
#WORKING add context to the latest message (in the front)
#WORKING add context to text of the latest message (in the front).
# use for loop because in openai format, each msg may contain both text and image.
for d in enumerate(a.chathistory[end]["content"])
if d["type"] == "text"
d["text"] = context * d["text"]
@@ -149,17 +150,13 @@ function decisionMaker(a::T; recentevents::Integer=20, maxattempt=10
if attempt > 1
println("\nYiemAgent decisionMaker() attempt $attempt/$maxattempt ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
end
unformatPrompt =
[
Dict("name" => "system", "text" => systemmsg),
]
unformatPrompt = vcat(unformatPrompt, recentEvents)
# put in model format
prompt = GeneralUtils.formatLLMtext(unformatPrompt, a.llmFormatName)
# add info
prompt = prompt * context
openai_msg = Dict(
"model" => "gemma-4-E4B-it-UD-Q4_K_XL",
"messages" => a.chathistory,
"temperature" => 0.7
)
response = a.context.text2textInstructLLM(prompt; senderId=a.id)
response = GeneralUtils.deFormatLLMtext(response, a.llmFormatName)