update
This commit is contained in:
@@ -238,7 +238,9 @@ 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.
|
- 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:
|
- 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.
|
||||||
|
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
|
- action_input: input to the action
|
||||||
- observation: result of the action.
|
- observation: result of the action.
|
||||||
|
|
||||||
|
|||||||
@@ -426,38 +426,90 @@ function extractWineAttributes(a::T1, input::T2
|
|||||||
Level 5: May correspond to "high acidity" or a similar description.
|
Level 5: May correspond to "high acidity" or a similar description.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# systemmsg =
|
||||||
|
# """
|
||||||
|
# As an attentive sommelier, your task is to determine the user's wine preferred levels of sweetness, intensity, tannin, acidity and other criteria based on the user query.
|
||||||
|
|
||||||
|
# At each round of conversation, the user will give you the current situation:
|
||||||
|
# Conversion Table: ...
|
||||||
|
# Query: ...
|
||||||
|
|
||||||
|
# You must follow the following guidelines:
|
||||||
|
# 1) If specific information is not available in the query, use "NA" to indicate this. Also words like "any" or "unlimited" means no information available.
|
||||||
|
# 2) Use converstion table to convert sweetness, acidity, tannin, intensity describing word into an integer.
|
||||||
|
# 3) Do not generate other comments.
|
||||||
|
|
||||||
|
# You should then respond to the user with the following points:
|
||||||
|
# - wine_type: Can be one of: red, white, sparkling, rose, dessert or fortified
|
||||||
|
# - price: ...
|
||||||
|
# - occasion: ...
|
||||||
|
# - food_pairing: food that will be served with wine
|
||||||
|
# - country: wine's country of origin
|
||||||
|
# - grape_variety: ...
|
||||||
|
# - tasting_notes: wine's flavors
|
||||||
|
# - sweetness: S where S is an integer indicating sweetness level
|
||||||
|
# - acidity: A where A is an integer indicating acidity level
|
||||||
|
# - tannin: T where T is an integer indicating tannin level
|
||||||
|
# - intensity: I where I is an integer indicating intensity level
|
||||||
|
|
||||||
|
# You should only respond in format as described below:
|
||||||
|
# repeat: repeat the user's query
|
||||||
|
# wine_type: ...
|
||||||
|
# price: ...
|
||||||
|
# occasion: ...
|
||||||
|
# food_pairing: ...
|
||||||
|
# country: ...
|
||||||
|
# grape_variety: ...
|
||||||
|
# tasting_notes: ...
|
||||||
|
# sweetness:
|
||||||
|
# acidity: ...
|
||||||
|
# tannin: ...
|
||||||
|
# intensity: ...
|
||||||
|
|
||||||
|
# Here are some examples:
|
||||||
|
|
||||||
|
# user: "price < 25, for wedding party, full-bodied white wine with sweetness level 2, apple and honey notes, low tannin level and medium acidity level, Pizza, France, Riesling"
|
||||||
|
# assistant: repeat: ... \n wine_type: white\n price: less than 25\n occasion: wedding party\n food_pairing: Pizza\n country: France\n grape_variety: Riesling\n tasting_notes: apple, honey\n sweetness: 2\n acidity: 3\n tannin: 1\n intensity: 5
|
||||||
|
|
||||||
|
# user: body=full-bodied, dry, acidity=medium and low tannin
|
||||||
|
# assistant: repeat: ... \n wine_type: NA\n price: NA\n occasion: NA\n food_pairing: NA\n country: NA\n grape_variety: NA\n tasting_notes: NA\n sweetness: 1\n acidity: 3\n tannin: 1\n intensity: 5
|
||||||
|
|
||||||
|
# Let's begin!
|
||||||
|
# """
|
||||||
|
|
||||||
systemmsg =
|
systemmsg =
|
||||||
"""
|
"""
|
||||||
As an attentive sommelier, your task is to determine the user's wine preferred levels of sweetness, intensity, tannin, acidity and other criteria based on the user query.
|
As an attentive sommelier, your task is to fillout the form based on the user query. The form is about the user's wine preference.
|
||||||
|
|
||||||
At each round of conversation, the user will give you the current situation:
|
At each round of conversation, the user will give you the current situation:
|
||||||
Conversion Table: ...
|
Conversion Table: ...
|
||||||
Query: ...
|
Query: ...
|
||||||
|
|
||||||
You must follow the following guidelines:
|
You must follow the following guidelines:
|
||||||
1) If specific information is not available in the query, use "NA" to indicate this. Also words like "any" or "unlimited" means no information available.
|
1) Use the conversion table to convert the descriptive word level of sweetness, intensity, tannin, and acidity into a corresponding integer.
|
||||||
2) Use converstion table to convert sweetness, acidity, tannin, intensity describing word into an integer.
|
2) If specific information required in the form is not available in the query, use 'NA' to indicate this. Additionally, words like 'any' or 'unlimited' mean no information is available.
|
||||||
3) Do not generate other comments.
|
3) Do not generate other comments.
|
||||||
|
|
||||||
You should then respond to the user with the following points:
|
You should then respond to the user with the following points:
|
||||||
- wine_type: Can be one of: red, white, sparkling, rose, dessert or fortified
|
1) reasoning: State your reasoning about the current situation.
|
||||||
- price: ...
|
2) wine_type: Can be one of: red, white, sparkling, rose, dessert or fortified
|
||||||
- occasion: ...
|
3) price: ...
|
||||||
- food_pairing: food that will be served with wine
|
4) occasion: ...
|
||||||
- country: wine's country of origin
|
5) food_to_be_paired_with_wine: food that will be served with wine
|
||||||
- grape_variety: ...
|
6) country: wine's country of origin
|
||||||
- tasting_notes: wine's flavors
|
7) grape_variety: ...
|
||||||
- sweetness: S where S is an integer indicating sweetness level
|
8) tasting_notes: wine's flavors
|
||||||
- acidity: A where A is an integer indicating acidity level
|
9) sweetness: S where S is an integer indicating sweetness level
|
||||||
- tannin: T where T is an integer indicating tannin level
|
10) acidity: A where A is an integer indicating acidity level
|
||||||
- intensity: I where I is an integer indicating intensity level
|
11) tannin: T where T is an integer indicating tannin level
|
||||||
|
12) intensity: I where I is an integer indicating intensity level
|
||||||
|
|
||||||
You should only respond in format as described below:
|
You should only respond in format as described below:
|
||||||
repeat: repeat the user's query
|
reasoning: ...
|
||||||
wine_type: ...
|
wine_type: ...
|
||||||
price: ...
|
price: ...
|
||||||
occasion: ...
|
occasion: ...
|
||||||
food_pairing: ...
|
food_to_be_paired_with_wine: ...
|
||||||
country: ...
|
country: ...
|
||||||
grape_variety: ...
|
grape_variety: ...
|
||||||
tasting_notes: ...
|
tasting_notes: ...
|
||||||
@@ -468,11 +520,11 @@ function extractWineAttributes(a::T1, input::T2
|
|||||||
|
|
||||||
Here are some examples:
|
Here are some examples:
|
||||||
|
|
||||||
user: "price < 25, for wedding party, full-bodied white wine with sweetness level 2, apple and honey notes, low tannin level and medium acidity level, Pizza, France, Riesling"
|
user: price < 25, for wedding party, full-bodied white wine with sweetness level 2, apple and honey notes, low tannin level and medium acidity level, Pizza, France, Riesling
|
||||||
assistant: repeat: ... \n wine_type: white\n price: less than 25\n occasion: wedding party\n food_pairing: Pizza\n country: France\n grape_variety: Riesling\n tasting_notes: apple, honey\n sweetness: 2\n acidity: 3\n tannin: 1\n intensity: 5
|
assistant: reasoning: ... \n wine_type: white\n price: less than 25\n occasion: wedding party\n food_to_be_paired_with_wine: Pizza\n country: France\n grape_variety: Riesling\n tasting_notes: apple, honey\n sweetness: 2\n acidity: 3\n tannin: 1\n intensity: 5
|
||||||
|
|
||||||
user: body=full-bodied, dry, acidity=medium and low tannin
|
user: body=full-bodied, dry, acidity=medium and low tannin
|
||||||
assistant: repeat: ... \n wine_type: NA\n price: NA\n occasion: NA\n food_pairing: NA\n country: NA\n grape_variety: NA\n tasting_notes: NA\n sweetness: 1\n acidity: 3\n tannin: 1\n intensity: 5
|
assistant: reasoning: ... \n wine_type: NA\n price: NA\n occasion: NA\n food_to_be_paired_with_wine: NA\n country: NA\n grape_variety: NA\n tasting_notes: NA\n sweetness: 1\n acidity: 3\n tannin: 1\n intensity: 5
|
||||||
|
|
||||||
Let's begin!
|
Let's begin!
|
||||||
"""
|
"""
|
||||||
@@ -496,7 +548,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 = ["reasoning", "wine_type", "price", "occasion", "food_to_be_paired_with_wine", "country", "grape_variety", "sweetness", "acidity", "tannin", "intensity"]
|
||||||
|
|
||||||
for attempt in 1:5
|
for attempt in 1:5
|
||||||
try
|
try
|
||||||
@@ -519,7 +571,7 @@ function extractWineAttributes(a::T1, input::T2
|
|||||||
|
|
||||||
result = ""
|
result = ""
|
||||||
for (k, v) in responsedict
|
for (k, v) in responsedict
|
||||||
if k != :repeat && !occursin("NA", v)
|
if k != :reasoning && !occursin("NA", v)
|
||||||
result *= "$k: $v, "
|
result *= "$k: $v, "
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ end
|
|||||||
main()
|
main()
|
||||||
|
|
||||||
# """
|
# """
|
||||||
# I'm having a graduation party this evening. So I think a bootle of wine would be nice.
|
# I'm having a graduation party this evening. So I think a bottle of wine would be nice.
|
||||||
# I have no idea. The party will be formal. What type of wine people usually get for this occasion?
|
# I have no idea. The party will be formal. What type of wine people usually get for this occasion?
|
||||||
# What about sparkling Rose?
|
# What about sparkling Rose?
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user