This commit is contained in:
narawat lamaiin
2024-07-25 20:27:12 +07:00
parent 5d368a0f73
commit d042c1d9c3
3 changed files with 11 additions and 8 deletions

View File

@@ -220,7 +220,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
Context: ...
Your earlier conversation with the user: ...
You should follow the following DO guidelines:
You must follow the following DO guidelines:
- If the user interrupts, prioritize the user then get back to the guidelines.
- 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

View File

@@ -366,6 +366,10 @@ function winestock(a::T1, input::T2
)::Union{Tuple{String, Number, Number, Bool}, Tuple{String, Nothing, Number, Bool}} where {T1<:agent, T2<:AbstractString}
wineattributes = extractWineAttributes(a, input)
# replace because SQLLLM didn't know what food_paired means
result = replace(wineattributes, "food_pairing" => "food_to_be_paired_with_wine")
result = SQLLLM.query(Dict(:text=> wineattributes), a.executeSQL, a.text2textInstructLLM)
return result
end
@@ -439,7 +443,7 @@ function extractWineAttributes(a::T1, input::T2
- wine_type: Can be one of: red, white, sparkling, rose, dessert or fortified
- price: ...
- occasion: ...
- food_paired: food that will be served with wine
- food_pairing: food that will be served with wine
- country: wine's country of origin
- grape_variety: ...
- tasting_notes: wine's flavors
@@ -453,7 +457,7 @@ function extractWineAttributes(a::T1, input::T2
wine_type: ...
price: ...
occasion: ...
food_paired: ...
food_pairing: ...
country: ...
grape_variety: ...
tasting_notes: ...
@@ -492,7 +496,7 @@ function extractWineAttributes(a::T1, input::T2
<|start_header_id|>assistant<|end_header_id|>
"""
attributes = ["repeat", "wine_type", "price", "occasion", "food_paired", "country", "grape_variety", "sweetness", "acidity", "tannin", "intensity"]
attributes = ["repeat", "wine_type", "price", "occasion", "food_pairing", "country", "grape_variety", "sweetness", "acidity", "tannin", "intensity"]
for attempt in 1:5
try
@@ -522,9 +526,6 @@ function extractWineAttributes(a::T1, input::T2
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
catch e
io = IOBuffer()