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

View File

@@ -86,8 +86,8 @@ end
julia> score = grading(agent, guideline, shorttermMemory)
```
"""
function winestock(a::agentReflex, actorResult::NamedTuple)
query = JSON3.write(actorResult[:toolinput])
function winestock(a::agentReflex, input::NamedTuple)
query = JSON3.write(input[:toolinput])
@show query
prompt =
"""
@@ -105,9 +105,9 @@ function winestock(a::agentReflex, actorResult::NamedTuple)
Fortified = table for wine type "fortified"
Intensity level:
intensity = 1, light bodied
intensity = 2, light-medium bodied
intensity = 2, semi-light bodied
intensity = 3, medium bodied
intensity = 4, medium-full bodied
intensity = 4, semi-full bodied
intensity = 5, full bodied
Sweetness level:
sweetness = 1, dry
@@ -117,15 +117,15 @@ function winestock(a::agentReflex, actorResult::NamedTuple)
sweetness = 5, very sweet
Tannin level:
tannin = 1, low tannin
tannin = 2, low-medium tannin
tannin = 2, semi-low tannin
tannin = 3, medium tannin
tannin = 4, medium-high tannin
tannin = 4, semi-high tannin
tannin = 5, high tannin
Acidity level:
acidity = 1, low acidity
acidity = 2, low-medium acidity
acidity = 2, semi-low acidity
acidity = 3, medium acidity
acidity = 4, medium-high acidity
acidity = 4, semi-high acidity
acidity = 5, high acidity
</You have the following conversion table>
<Your job>