This commit is contained in:
narawat lamaiin
2024-07-29 15:28:47 +07:00
parent 7e0f8fa6f0
commit 689bca3805
3 changed files with 30 additions and 31 deletions

View File

@@ -197,7 +197,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
# - plan: Based on the current situation, what would you do to complete the task? Be specific.
# - action (Must be aligned with your plan): Can be one of the following functions:
# 1) CHATBOX[text], which you can use to talk with the user. "text" is in verbal English.
# 2) WINESTOCK[query], which you can use to find info about wine in your inventory. "query" is a search term in verbal English.
# 2) CHECKINVENTORY[query], which you can use to find info about wine in your inventory. "query" is a search term in verbal English.
# - observation: result of the action.
# You should only respond in format as described below:
@@ -222,15 +222,12 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
You must follow the following DO guidelines:
- If the user interrupts, prioritize the user then get back to the guidelines.
- Check your inventory before mentioning any specific wine.
- Get to know how much the user willing to spend
- Get to know type of wine the user is looking for e.g. red, white, sparkling, rose, dessert, fortified
- Get to know what occasion the user is buying wine for
- Get to know what characteristics of wine the user is looking for e.g. tannin, sweetness, intensity, acidity
- Get to know what food will be served with wine
You must follow the following DON'T guidelines:
- Don't mention any specific wine until you've checked your inventory.
- Check your inventory before recommending any specific wine.
You should then respond to the user with interleaving Thought, Plan, Action and Observation:
- thought:
@@ -238,7 +235,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
- plan: Based on the current situation, state a complete plan to complete the task. Be specific.
- action_name (Must be aligned with your plan): Can be one of the following functions:
1) CHATBOX[text], which you can use to talk with the user. "text" is in verbal English.
2) WINESTOCK[query], which you can use to find info about wine in your inventory. "query" is a search term in verbal English.
2) CHECKINVENTORY[query], which you can use to find info about wine in your inventory. "query" is a search term in verbal English.
Good query example: black car with a stereo, 200 mile range and an electric motor.
Good query example: How many car brand are from Asia?
- action_input: input to the action
@@ -280,7 +277,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
["thought", "plan", "action_name", "action_input", "observation"],
rightmarker=":", symbolkey=true)
if responsedict[:action_name] ["CHATBOX", "WINESTOCK"]
if responsedict[:action_name] ["CHATBOX", "CHECKINVENTORY"]
error("decisionMaker didn't use the given functions ", @__LINE__)
end
@@ -493,9 +490,8 @@ function evaluator(config::T1, state::T2
Analyze the trajectories of a solution to a question answering task. The trajectories are
labeled by environmental observations about the situation, thoughts that can reason about
the current situation and actions that can be three types:
1) winestock[query], which you can use to find wine in your inventory.
2) chatbox[text], which you can use to interact with the user.
3) recommendbox[answer], which returns your wine recommendation to the user.
1) CHECKINVENTORY[query], which you can use to find wine in your inventory.
2) CHATBOX[text], which you can use to interact with the user.
Given a question and a trajectory, evaluate its correctness and provide your reasoning and
analysis in detail. Focus on the latest thought, action, and observation. Incomplete trajectories
@@ -1056,8 +1052,8 @@ function think(a::T) where {T<:agent}
response =
if actionname == "CHATBOX"
(result=actioninput, errormsg=nothing, success=true)
elseif actionname == "WINESTOCK"
winestock(a, actioninput)
elseif actionname == "CHECKINVENTORY"
checkinventory(a, actioninput)
else
error("undefined LLM function. Requesting $actionname")
end