update
This commit is contained in:
@@ -220,7 +220,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
|
|||||||
Context: ...
|
Context: ...
|
||||||
Your earlier conversation with the user: ...
|
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.
|
- 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 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 type of wine the user is looking for e.g. red, white, sparkling, rose, dessert, fortified
|
||||||
|
|||||||
@@ -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}
|
)::Union{Tuple{String, Number, Number, Bool}, Tuple{String, Nothing, Number, Bool}} where {T1<:agent, T2<:AbstractString}
|
||||||
|
|
||||||
wineattributes = extractWineAttributes(a, input)
|
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)
|
result = SQLLLM.query(Dict(:text=> wineattributes), a.executeSQL, a.text2textInstructLLM)
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
@@ -439,7 +443,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_paired: food that will be served with wine
|
- food_pairing: 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 +457,7 @@ function extractWineAttributes(a::T1, input::T2
|
|||||||
wine_type: ...
|
wine_type: ...
|
||||||
price: ...
|
price: ...
|
||||||
occasion: ...
|
occasion: ...
|
||||||
food_paired: ...
|
food_pairing: ...
|
||||||
country: ...
|
country: ...
|
||||||
grape_variety: ...
|
grape_variety: ...
|
||||||
tasting_notes: ...
|
tasting_notes: ...
|
||||||
@@ -492,7 +496,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_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
|
for attempt in 1:5
|
||||||
try
|
try
|
||||||
@@ -522,9 +526,6 @@ 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()
|
||||||
|
|||||||
@@ -94,7 +94,9 @@ end
|
|||||||
# main()
|
# main()
|
||||||
|
|
||||||
|
|
||||||
input = "query=\"off dry, medium tannin, French Rosé\""
|
|
||||||
|
|
||||||
|
# input = "query=\"off dry, medium tannin, French Rosé\""
|
||||||
input = "wine_type: rose, country: France, sweetness: 2, tannin: 3"
|
input = "wine_type: rose, country: France, sweetness: 2, tannin: 3"
|
||||||
YiemAgent.winestock(a, input)
|
YiemAgent.winestock(a, input)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user