update
This commit is contained in:
+507
-627
File diff suppressed because it is too large
Load Diff
+6
-6
@@ -518,8 +518,8 @@ function SQLexecution(executeSQL::Function, sql::T
|
||||
row, column = tablesize
|
||||
if row == 0
|
||||
error("\nThe resulting table has 0 row. Please try again.")
|
||||
elseif column > 30
|
||||
error("\nSQL execution failed. An unexpected error occurred. Please try again.")
|
||||
elseif column > 50
|
||||
error("\nSQL execution success but there are more than 50 rows Please be more specific.")
|
||||
end
|
||||
|
||||
df1 =
|
||||
@@ -821,7 +821,7 @@ julia>
|
||||
|
||||
# Notes
|
||||
- The function makes up to 10 attempts to get a valid response from the LLM
|
||||
- Each state in highValueStateList should contain a thoughtHistory with action_input and observation
|
||||
- Each state in highValueStateList should contain a action_history with action_input and observation
|
||||
- The LLM evaluates attempts based on accuracy and relevance to the original question
|
||||
"""
|
||||
function compareState(question::String, highValueStateList::Vector{T},
|
||||
@@ -866,14 +866,14 @@ potentialSolution = []
|
||||
keys = ["action_input", "observation"]
|
||||
# extract the last action_name, action_input, observation of each state in highValueStateList and store them in a dictionary then push into potentialSolution
|
||||
for state in highValueStateList
|
||||
thoughtHistory = state["thoughtHistory"]
|
||||
action_history = state["action_history"]
|
||||
_, currentstate_latestIndice =
|
||||
GeneralUtils.findHighestIndexKey(thoughtHistory, keys[1])
|
||||
GeneralUtils.findHighestIndexKey(action_history, keys[1])
|
||||
latestKeys = makekey.(keys, currentstate_latestIndice)
|
||||
d = Dict()
|
||||
# get the last action_name, action_input, observation of currentstate
|
||||
for (i,v) in enumerate(keys)
|
||||
d[v] = thoughtHistory[latestKeys[i]]
|
||||
d[v] = action_history[latestKeys[i]]
|
||||
end
|
||||
push!(potentialSolution, d)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user