update
This commit is contained in:
@@ -632,7 +632,7 @@ function evaluator(state::T1, text2textInstructLLM::Function;
|
|||||||
|
|
||||||
systemmsg =
|
systemmsg =
|
||||||
"""
|
"""
|
||||||
You are a helpful assistant that analyzes agent's trajectories to find solutions and observations (i.e., the results of actions) to answer the user's questions.
|
You are a helpful assistant that analyzes agent's trajectory to find solutions and observations (i.e., the results of actions) to answer the user's questions.
|
||||||
|
|
||||||
Definitions:
|
Definitions:
|
||||||
"question" is the user's question
|
"question" is the user's question
|
||||||
@@ -647,7 +647,7 @@ function evaluator(state::T1, text2textInstructLLM::Function;
|
|||||||
|
|
||||||
At each round of conversation, the user will give you:
|
At each round of conversation, the user will give you:
|
||||||
Context: ...
|
Context: ...
|
||||||
Trajectories: ...
|
Trajectory: ...
|
||||||
|
|
||||||
You should then respond to the user with:
|
You should then respond to the user with:
|
||||||
1) Trajectory_evaluation: Analyze the trajectory of a solution to answer the user's original question.
|
1) Trajectory_evaluation: Analyze the trajectory of a solution to answer the user's original question.
|
||||||
@@ -666,8 +666,11 @@ function evaluator(state::T1, text2textInstructLLM::Function;
|
|||||||
question: Find cars with a stereo.
|
question: Find cars with a stereo.
|
||||||
observation: There are 1 cars in the table. 1) brand: Toyota, model: yaris, color: black.
|
observation: There are 1 cars in the table. 1) brand: Toyota, model: yaris, color: black.
|
||||||
4) Score: Correctness score s where s is a single integer between 0 to 9.
|
4) Score: Correctness score s where s is a single integer between 0 to 9.
|
||||||
- 0 (the trajectories are incorrect.)
|
Score guideline:
|
||||||
- 9 (the trajectories are correct, and the observation's content directly answers the question.)
|
- 0 indicates that both the trajectory is incorrect, failed or errors and the observation is incorrect or failed
|
||||||
|
- 4 indicates that the trajectory are correct but the observation is incorrect or failed
|
||||||
|
- 8 indicates that both the trajectory are correct, and the observation's content directly answers the question.
|
||||||
|
- 9 indicates a perfect perfomance. Both the trajectory are correct, and the observation's content directly answers the question, surpassing your expectations.
|
||||||
5) Suggestion: if accepted_as_answer is "No", provide suggestion.
|
5) Suggestion: if accepted_as_answer is "No", provide suggestion.
|
||||||
|
|
||||||
You should only respond in format as described below:
|
You should only respond in format as described below:
|
||||||
@@ -689,7 +692,7 @@ function evaluator(state::T1, text2textInstructLLM::Function;
|
|||||||
for attempt in 1:5
|
for attempt in 1:5
|
||||||
usermsg =
|
usermsg =
|
||||||
"""
|
"""
|
||||||
Trajectories: $thoughthistory
|
Trajectory: $thoughthistory
|
||||||
$noise
|
$noise
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -722,7 +725,7 @@ function evaluator(state::T1, text2textInstructLLM::Function;
|
|||||||
accepted_as_answer::AbstractString = responsedict[:accepted_as_answer]
|
accepted_as_answer::AbstractString = responsedict[:accepted_as_answer]
|
||||||
suggestion::AbstractString = responsedict[:suggestion]
|
suggestion::AbstractString = responsedict[:suggestion]
|
||||||
|
|
||||||
if accepted_as_answer ∉ ["Yes", "No"]
|
if accepted_as_answer ∉ ["Yes", "No"] # [WORKING] add errornote into the prompt
|
||||||
error("generated accepted_as_answer has wrong format")
|
error("generated accepted_as_answer has wrong format")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1277,7 +1280,7 @@ function generatequestion(state::T1, context, text2textInstructLLM::Function;
|
|||||||
["Understanding", "Q1"],
|
["Understanding", "Q1"],
|
||||||
rightmarker=":", symbolkey=true; lowercasekey=true)
|
rightmarker=":", symbolkey=true; lowercasekey=true)
|
||||||
response = "Q1: " * responsedict[:q1]
|
response = "Q1: " * responsedict[:q1]
|
||||||
println("--> SQLLLM generatequestion ", @__FILE__, " ", @__LINE__)
|
println("\n~~~ SQLLLM generatequestion() ", @__FILE__, " ", @__LINE__)
|
||||||
pprintln(Dict(responsedict))
|
pprintln(Dict(responsedict))
|
||||||
return response
|
return response
|
||||||
catch e
|
catch e
|
||||||
|
|||||||
@@ -642,7 +642,7 @@ function SQLexecution(executeSQL::Function, sql::T
|
|||||||
sql = sql[1:end-1] * " ORDER BY RANDOM() LIMIT 2;"
|
sql = sql[1:end-1] * " ORDER BY RANDOM() LIMIT 2;"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
error("Error, SQL execution failed because it does not ended with ';'")
|
sql = sql * ";"
|
||||||
end
|
end
|
||||||
println("\n~~~ SQLexecution() SQL: ", @__FILE__, " ", @__LINE__)
|
println("\n~~~ SQLexecution() SQL: ", @__FILE__, " ", @__LINE__)
|
||||||
println(sql)
|
println(sql)
|
||||||
|
|||||||
Reference in New Issue
Block a user