update
This commit is contained in:
@@ -240,12 +240,13 @@ function genPrompt_mistral_openorca(a::agentReflex, usermsg::String)
|
||||
|
||||
prompt = replace(prompt, "{context}" => context)
|
||||
|
||||
prompt = replace(prompt, "{usermsg}" => "Question: $usermsg")
|
||||
prompt = replace(prompt, "{usermsg}" => "Request: $usermsg")
|
||||
|
||||
return prompt
|
||||
end
|
||||
|
||||
function genPrompt_planning_mistral_openorca(a::agentReflex, usermsg::String) #WORKING
|
||||
#WORKING
|
||||
function genPrompt_planning_mistral_openorca(a::agentReflex, usermsg::String)
|
||||
"""
|
||||
general prompt format:
|
||||
|
||||
@@ -298,16 +299,21 @@ function genPrompt_planning_mistral_openorca(a::agentReflex, usermsg::String) #W
|
||||
end
|
||||
prompt = replace(prompt, "{toolnames}" => toolnames)
|
||||
prompt = replace(prompt, "{tools}" => "You have access to the following tools:\n$toollines")
|
||||
|
||||
context =
|
||||
|
||||
|
||||
|
||||
prompt = replace(prompt, "{context}" => a.context)
|
||||
|
||||
prompt *= "<|im_start|>user\nQuestion: " * usermsg * "\n<|im_end|>\n"
|
||||
prompt *= "<|im_start|>assistant\n"
|
||||
|
||||
context =
|
||||
"""
|
||||
{earlierConversation}
|
||||
{current status}
|
||||
{longterm memory}
|
||||
"""
|
||||
context = replace(context, "{earlierConversation}" => "My earlier talk with the user:\n$(a.earlierConversation)")
|
||||
context = replace(context, "{current status}" => "")
|
||||
context = replace(context, "{longterm memory}" => "")
|
||||
|
||||
prompt = replace(prompt, "{context}" => context)
|
||||
|
||||
prompt = replace(prompt, "{usermsg}" => "Request: $usermsg")
|
||||
|
||||
return prompt
|
||||
end
|
||||
|
||||
@@ -536,22 +542,25 @@ function work(a::agentReflex, usermsg::String)
|
||||
else
|
||||
error("undefined condition thinkingmode = $thinkingmode")
|
||||
end
|
||||
error("work done")
|
||||
|
||||
while true
|
||||
# plan
|
||||
a.thinkinground += 1
|
||||
@show a.thinkinground
|
||||
toolname = nothing
|
||||
toolinput = nothing
|
||||
plan = genPrompt_planning_mistral_openorca(a, prompt)
|
||||
@show plan
|
||||
# for
|
||||
# # execute
|
||||
# end
|
||||
prompt = genPrompt_planning_mistral_openorca(a, usermsg)
|
||||
@show prompt
|
||||
respond = sendReceivePrompt(a, prompt)
|
||||
respond = split(respond, "<|im_end|>")[1]
|
||||
@show respond
|
||||
for
|
||||
# execute
|
||||
end
|
||||
# evaluate
|
||||
#
|
||||
|
||||
|
||||
|
||||
error("work done")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user