This commit is contained in:
2024-02-06 01:45:38 +00:00
parent 3a6140087e
commit f2e2be2e55
2 changed files with 17 additions and 15 deletions

View File

@@ -805,8 +805,6 @@ function actor_mistral_openorca(a::agentReflex, selfaware=nothing)
winestocksearchresult = "\n"
end
#WORKING I need a llm json read function
# prompt =
# """
# <|system|>
@@ -864,7 +862,7 @@ function actor_mistral_openorca(a::agentReflex, selfaware=nothing)
</You have access to the following tools>
<Your job>
Use the following format:
Thought: considering what you know about the user and your plan thoroughly then you should think about what to do next by prioritize what you don't know first. (PS. 1. let's think a single step. 2. pay attention to correct numeral calculation and commonsense.)
Thought: considering what you know about the user and your plan thoroughly then you should think about what to do next by prioritize what you don't know (null means don't know) first. (PS. 1. let's think a single step. 2. pay attention to correct numeral calculation and commonsense.)
Act: based on your thought what action to choose?, must be one of [{toolnames}].
Actinput: your input to the action (pay attention to the tool's input)
Obs: observed result of the action
@@ -1024,15 +1022,19 @@ function actor_mistral_openorca(a::agentReflex, selfaware=nothing)
# because tools has JSON input but sometime LLM output is not JSON, we need to check.
if occursin("{", toolinput)
if occursin("{", toolinput) #WORKING
act = GeneralUtils.getStringBetweenCharacters(response, '{', '}', endCharLocation="end")
act = copy(JSON3.read(act))
chunkedtext["Actinput $latestTask:"] = JSON3.write(act[Symbol(toolname)])
toolinput = act[Symbol(toolname)]
println("")
@show act
act = GeneralUtils.JSON3read_stringKey(act) #copy(JSON3.read(act))
chunkedtext["Actinput $latestTask:"] = JSON3.write(act[toolname])
toolinput = act[toolname]
end
chunkedtext["Act $latestTask:"] = toolname
return (toolname=toolname, toolinput=toolinput, chunkedtext=chunkedtext, selfaware=selfaware)
end