From 1ef696f2066559a2dc7ce62cbce67f2cc23c6a80 Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Tue, 16 Jul 2024 17:47:21 +0700 Subject: [PATCH] update --- src/interface.jl | 6 +----- test/runtest.jl | 28 +++++++++++++--------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index 4c49978..7e9b5de 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -289,8 +289,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent} error("DecisionMaker has more than one key per categories") end end - println("--> 1") - pprintln(responsedict) + return responsedict catch e io = IOBuffer() @@ -1158,9 +1157,6 @@ function generatechat(a::T) where {T<:agent} result = responsedict[:chat] - #[WORKING] delete chat - a.memory[:chatbox] = "" - return result catch e io = IOBuffer() diff --git a/test/runtest.jl b/test/runtest.jl index 0ffb537..ca98b5d 100644 --- a/test/runtest.jl +++ b/test/runtest.jl @@ -64,26 +64,24 @@ end # response = YiemAgent.conversation(a, Dict(:text=> "newtopic",) ) -response = YiemAgent.conversation(a, Dict(:text=> "Hello, I would like a get a bottle of wine.")) -println("---> YiemAgent: ", response) - -response = YiemAgent.conversation(a, Dict(:text=> "I'm having a graduation party this evening. I'll pay at most 30 bucks.")) -response = YiemAgent.conversation(a, Dict(:text=> "What type of wine do you recommend for a celebration?")) - - - -println("---> YiemAgent: ", response) - - - - -dummyinput = "price below 50, full-bodied red wine with sweetness level 2, low tannin level and medium acidity level, Thai dishes" -response = YiemAgent.winestock(a, dummyinput) +# response = YiemAgent.conversation(a, Dict(:text=> "Hello, I would like a get a bottle of wine.")) +# println("---> YiemAgent: ", response) +# response = YiemAgent.conversation(a, Dict(:text=> "I'm having a graduation party this evening. I'll pay at most 30 bucks.")) +function main() + userinput = "Hello, I would like a get a bottle of wine." + for i in 1:10 + response = YiemAgent.conversation(a, Dict(:text=> userinput)) + println("--> assistant response: \n", response) + println("--> user input:") + userinput = readline() + end +end +main()