From 2aa0ee6a74ef5dde4c1f08e59e7ce6d929f8e98a Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Sun, 18 Aug 2024 19:11:18 +0700 Subject: [PATCH] update --- src/interface.jl | 12 ++++++------ src/llmfunction.jl | 8 ++++---- test/runtest.jl | 20 ++++++++++---------- test/test_1.jl | 2 ++ 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index e67e196..e5d62d4 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -295,7 +295,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent} ] # put in model format - prompt = GeneralUtils.formatLLMtext(_prompt, "llama3instruct") + prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct") prompt *= """ <|start_header_id|>assistant<|end_header_id|> @@ -1210,7 +1210,7 @@ function thinkCheckInventory(a::T)::Dict{Symbol, Any} where {T<:agent} ] # put in model format - prompt = GeneralUtils.formatLLMtext(_prompt, "llama3instruct") + prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct") prompt *= """ <|start_header_id|>assistant<|end_header_id|> @@ -1334,7 +1334,7 @@ function generatechat(memory::Dict, chathistory::Vector, text2textInstructLLM::F ] # put in model format - prompt = GeneralUtils.formatLLMtext(_prompt, "llama3instruct") + prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct") prompt *= """ <|start_header_id|>assistant<|end_header_id|> @@ -1521,7 +1521,7 @@ function generatequestion(a, text2textInstructLLM::Function)::String ] # put in model format - prompt = GeneralUtils.formatLLMtext(_prompt, "llama3instruct") + prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct") prompt *= """ <|start_header_id|>assistant<|end_header_id|> @@ -1624,7 +1624,7 @@ function generateSituationReport(a, text2textInstructLLM::Function)::Dict ] # put in model format - prompt = GeneralUtils.formatLLMtext(_prompt, "llama3instruct") + prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct") prompt *= """ <|start_header_id|>assistant<|end_header_id|> @@ -1720,7 +1720,7 @@ end # ] # # put in model format -# prompt = GeneralUtils.formatLLMtext(_prompt, "llama3instruct") +# prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct") # prompt *= # """ # <|start_header_id|>assistant<|end_header_id|> diff --git a/src/llmfunction.jl b/src/llmfunction.jl index bbe3983..22671aa 100644 --- a/src/llmfunction.jl +++ b/src/llmfunction.jl @@ -393,7 +393,7 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2< ] # put in model format - prompt = GeneralUtils.formatLLMtext(_prompt, "llama3instruct") + prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct") prompt *= """ <|start_header_id|>assistant<|end_header_id|> @@ -584,7 +584,7 @@ function extractWineAttributes_2(a::T1, input::T2)::String where {T1<:agent, T2< ] # put in model format - prompt = GeneralUtils.formatLLMtext(_prompt, "llama3instruct") + prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct") prompt *= """ <|start_header_id|>assistant<|end_header_id|> @@ -722,7 +722,7 @@ end # ] # # put in model format -# prompt = GeneralUtils.formatLLMtext(_prompt, "llama3instruct") +# prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct") # prompt *= # """ # <|start_header_id|>assistant<|end_header_id|> @@ -958,7 +958,7 @@ end # ] # # put in model format -# prompt = GeneralUtils.formatLLMtext(_prompt, "llama3instruct") +# prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct") # prompt *= # """ # <|start_header_id|>assistant<|end_header_id|> diff --git a/test/runtest.jl b/test/runtest.jl index 5a00f72..55e83ed 100644 --- a/test/runtest.jl +++ b/test/runtest.jl @@ -6,18 +6,18 @@ using Base.Threads config = copy(JSON3.read("config.json")) -instanceInternalTopic = config[:serviceInternalTopic][:mqtttopic] * "/1" +# instanceInternalTopic = config[:serviceInternalTopic][:mqtttopic] * "/1" -client, connection = MakeConnection(config[:mqttServerInfo][:broker], - config[:mqttServerInfo][:port]) +# client, connection = MakeConnection(config[:mqttServerInfo][:broker], +# config[:mqttServerInfo][:port]) receiveUserMsgChannel = Channel{Dict}(4) -receiveInternalMsgChannel = Channel{Dict}(4) -println(typeof(connection)) -msgMeta = GeneralUtils.generate_msgMeta( - "N/A", - replyTopic = config[:servicetopic][:mqtttopic] # ask frontend reply to this instance_chat_topic - ) +# receiveInternalMsgChannel = Channel{Dict}(4) +# println(typeof(connection)) +# msgMeta = GeneralUtils.generate_msgMeta( +# "N/A", +# replyTopic = config[:servicetopic][:mqtttopic] # ask frontend reply to this instance_chat_topic +# ) function executeSQL(sql::T) where {T<:AbstractString} DBconnection = LibPQ.Connection("host=192.168.88.12 port=5432 dbname=yiem_wine_assistant user=yiem password=yiem@Postgres_0.0") @@ -77,7 +77,7 @@ end main() """ - I'm joining a graduation party this evening. I want a bottle of full bodied, dry white wine from the U.S. and I'm ok with all price range. + I'm joining a graduation party this evening. I want a bottle of full bodied, dry white wine from the United States. I'm ok with all price range. Well, the party is small casual with close friends and no food serving. I'm open to suggestion since I have no specific idea about wine. diff --git a/test/test_1.jl b/test/test_1.jl index 2f05c65..0428ebd 100644 --- a/test/test_1.jl +++ b/test/test_1.jl @@ -188,3 +188,5 @@ outgoingMsg = Dict( result = GeneralUtils.sendMqttMsg(outgoingMsg) + +