Compare commits

..

4 Commits

Author SHA1 Message Date
ton 39cf9a72a1 Merge pull request 'v0.7.1-fix_single_items_info_frontend' (#26) from v0.7.1-fix_single_items_info_frontend into v0.7.1
Reviewed-on: #26
2026-07-17 03:28:06 +00:00
ton 1c829ad854 update 2026-07-17 10:14:13 +07:00
ton da98baddb6 update 2026-07-17 10:06:32 +07:00
ton c5fbaabf42 Merge pull request 'v0.7.0' (#25) from v0.7.0 into main
Reviewed-on: #25
2026-07-17 00:03:01 +00:00
+23 -4
View File
@@ -395,13 +395,19 @@ function conversation(a::sommelier; userinput::Union{Dict{String, Any}, JSON.Obj
addNewMessage(a, "assistant", assistant_response; maximumMsg=maximumMsg)
items_info = []
send_item_ind = [] # index of the item being send to frontend
if haskey(a.memory["shortmem"], "items_info")
for (i, item) in enumerate(a.memory["shortmem"]["items_info"])
if haskey(item, "wine_name") && occursin(item["wine_name"], thoughtdict["action_input"])
push!(items_info, item)
deleteat!(a.memory["shortmem"]["items_info"], i)
push!(items_info, deepcopy(item))
push!(send_item_ind, i)
end
end
# remove sent items
deleteat!(a.memory["shortmem"]["items_info"], send_item_ind)
end
response_to_frontend = Dict{String, Any}(
@@ -431,13 +437,19 @@ function conversation(a::sommelier; userinput::Union{Dict{String, Any}, JSON.Obj
addNewMessage(a, "assistant", assistant_response; maximumMsg=maximumMsg)
items_info = []
send_item_ind = [] # index of the item being send to frontend
if haskey(a.memory["shortmem"], "items_info")
for (i, item) in enumerate(a.memory["shortmem"]["items_info"])
if haskey(item, "wine_name") && occursin(item["wine_name"], thoughtdict["action_input"])
push!(items_info, item)
deleteat!(a.memory["shortmem"]["items_info"], i)
push!(items_info, deepcopy(item))
push!(send_item_ind, i)
end
end
# remove sent items
deleteat!(a.memory["shortmem"]["items_info"], send_item_ind)
end
response_to_frontend = Dict{String, Any}(
@@ -527,7 +539,14 @@ function think(a::T)::NamedTuple{(:thoughtdict, :result_raw), Tuple{OrderedDict,
result_raw = nothing
if thoughtdict["action_name"] ["CHAT_BOX"]
# sometime CHAT_BOX input is too short.
# if thoughtdict["action_input] < 20 character, use generatechat!()
if length(thoughtdict["action_input"]) < 20
thoughtdict, result_raw = generatechat!(a)
else
thoughtdict["action_result"] = "Action result is the next user dialogue."
result_raw = thoughtdict["action_input"]
end
elseif thoughtdict["action_name"] == "END_CONVER_GUIDELINE"