This commit is contained in:
narawat lamaiin
2024-07-25 17:50:22 +07:00
parent 197b1c3288
commit 5d368a0f73
2 changed files with 8 additions and 4 deletions

View File

@@ -236,9 +236,10 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
- thought: - thought:
1) State your reasoning about the current situation. 1) State your reasoning about the current situation.
- plan: Based on the current situation, state a complete plan to complete the task. Be specific. - plan: Based on the current situation, state a complete plan to complete the task. Be specific.
- action (Must be aligned with your plan): Can be one of the following functions: - 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. 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. The best query must includes "budget", "type of wine", "characteristics of wine" and "food pairing". 2) WINESTOCK[query], which you can use to find info about wine in your inventory. "query" is a search term in verbal English. The best query must includes "budget", "type of wine", "characteristics of wine" and "food pairing".
- action_input: input to the action
- observation: result of the action. - observation: result of the action.
You should only respond in format as described below: You should only respond in format as described below:

View File

@@ -439,7 +439,7 @@ function extractWineAttributes(a::T1, input::T2
- wine_type: Can be one of: red, white, sparkling, rose, dessert or fortified - wine_type: Can be one of: red, white, sparkling, rose, dessert or fortified
- price: ... - price: ...
- occasion: ... - occasion: ...
- food_pairing: food that will be served with wine - food_paired: food that will be served with wine
- country: wine's country of origin - country: wine's country of origin
- grape_variety: ... - grape_variety: ...
- tasting_notes: wine's flavors - tasting_notes: wine's flavors
@@ -453,7 +453,7 @@ function extractWineAttributes(a::T1, input::T2
wine_type: ... wine_type: ...
price: ... price: ...
occasion: ... occasion: ...
food_pairing: ... food_paired: ...
country: ... country: ...
grape_variety: ... grape_variety: ...
tasting_notes: ... tasting_notes: ...
@@ -492,7 +492,7 @@ function extractWineAttributes(a::T1, input::T2
<|start_header_id|>assistant<|end_header_id|> <|start_header_id|>assistant<|end_header_id|>
""" """
attributes = ["repeat", "wine_type", "price", "occasion", "food_pairing", "country", "grape_variety", "sweetness", "acidity", "tannin", "intensity"] attributes = ["repeat", "wine_type", "price", "occasion", "food_paired", "country", "grape_variety", "sweetness", "acidity", "tannin", "intensity"]
for attempt in 1:5 for attempt in 1:5
try try
@@ -522,6 +522,9 @@ function extractWineAttributes(a::T1, input::T2
result = result[1:end-2] # remove the ending ", " result = result[1:end-2] # remove the ending ", "
# replace because SQLLLM didn't know what food_paired means
result = replace(result, "food_paired" => "food_to_be_paired_with_wine")
return result return result
catch e catch e
io = IOBuffer() io = IOBuffer()