This commit is contained in:
2023-12-28 15:22:08 +00:00
parent 0f62a0d96b
commit 6d41efa243
2 changed files with 34 additions and 35 deletions

View File

@@ -186,13 +186,14 @@ function planner_mistral_openorca(a::agentReflex)
<|system|>
$(a.roles[a.role])
Required info you need for wine recommendation:
- food that will be served with wine: ask the user
- occasion: ask the user
- type of wine (Rose, White, Red and Sparkling): ask the user
- user's personal taste of wine characteristic: ask the user
- wine price range: ask the user
- ambient temperature at the serving location: ask the user
- wines we have in stock: use winestock tool
- occasion: ask the user
- type of food that will be served with wine: ask the user
- ambient temperature at the serving location: ask the user
- type of wine (Rose, White, Red and Sparkling): ask the user
- user's personal taste of wine characteristic: ask the user
- tasting notes: ask the user
- wine price range: ask the user
- wines we have in stock: use winestock tool
You have access to the following tools:
$toollines
@@ -236,12 +237,12 @@ function updatePlan(a::agentReflex)
<|system|>
$(a.roles[a.role])
The required info you need for wine recommendation:
- wine price range: ask the user
- user's personal taste of wine: ask the user
- type of food: ask the user
- occasion: ask the user
- ambient temperature at the serving location: ask the user
- wines we have in stock
- occasion: ask the user
- type of food: ask the user
- user's personal taste of wine: ask the user
- ambient temperature at the serving location: ask the user
- wine price range: ask the user
- wines we have in stock
You provide a personalized recommendation of up to two wines based on the user's info above, and you describe the benefits of each wine in detail.
You have access to the following tools:
@@ -343,7 +344,8 @@ function actor_mistral_openorca(a::agentReflex, taskrecap="")
start = "Self-awareness"
# aware = "Self-awareness: based on the recap, assess your progress against the plan then identify areas where you need to address."
# aware = "Self-awareness: based on the recap and the plan, state your current understanding of the matter in details then identify areas where you need to address."
aware = "Self-awareness: based on earlier conversation with the user, check your progress against the plan then state incomplete tasks and what you already have. (focus on your actions and their results)"
# aware = "Self-awareness: Based on Obs, review your progress against the plan. Then, describe in detail the results you have achieved so far. Finally, describe in detail what you are missing. (focus on your actions and their results)"
aware = "Self-awareness: Based on Obs, check your progress against the plan. Then, repeat all the details of what you have been gathered. Finally, describe in detail what you are missing."
thought = "Thought: you should always think about what to do according to self-awareness (1. let's think a single step. 2. focus on incomplete task 3. pay attention to correct numeral calculation and commonsense.)"
end
@@ -371,8 +373,8 @@ function actor_mistral_openorca(a::agentReflex, taskrecap="")
Use the following format:
$aware
$thought
Act: an action you intend, must be one of [{toolnames}]
Actinput: your input to the action based on your thought (pay attention to the tool's input)
Act: an action you intend to do according to your thought, must be one of [{toolnames}].
Actinput: your input to the action (pay attention to the tool's input)
Obs: observed result of the action
</Your job>
</s>
@@ -1017,26 +1019,21 @@ function grading(a, guideline::T, text::T) where {T<:AbstractString}
1. Evaluate your response using the evaluation guideline and an example response.
2. Give yourself a score out of 9 for your response.
</Your job>
<Example>
Evaluate: The response does not directly address user needs. It does not include price into account and other user mentioned factors. Score: 6/9.
</Example>
<Example in JSON format>
{"Evaluate": "The response does not directly address user needs. It does not include price into account and other user mentioned factors", "Score": 6}
</Example in JSON format>
<|im_end|>
<assistant>
Evaluate:
"""
println("")
prompt_grading = prompt
@show prompt_grading
response = sendReceivePrompt(a, prompt)
println("")
response_grading = response
@show response_grading
response = split(response, "\n\n")[1]
_score = split(response[end-5:end], "/")[1]
_score = split(_score, " ")[end]
score = parse(Int, _score)
response = sendReceivePrompt(a, prompt)
@show response = JSON3.read(response)
score = response["Score"]
return score
end

View File

@@ -92,18 +92,20 @@ function winestock(a::agentReflex, phrase::T) where {T<:AbstractString}
I found the following wines
{
1: {
wine name: Louis Latou - Corton-Charlamagne,
variety: chardonnay,
Chateau: Louis Latou
name: Corton-Charlamagne,
grape variety: chardonnay,
year: 2014,
price: 55 USD,
ID: ws-114
stock ID: ws-114
},
2: {
wine name: Chateau de Beaucastel Hommage Jacques Perrin Chateauneuf-du-Pape,
variety: riesling,
Chateau: Catena Zapata
name: Malbec Argentino,
grape variety: riesling,
year: 2016,
price: 39 USD,
ID: ed-23
stock ID: ed-23
}
}
"""