From 82707a2cc05e13055626f365d4d621ae08f680e9 Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Mon, 9 Dec 2024 22:41:17 +0700 Subject: [PATCH] update --- Manifest.toml | 2 +- Project.toml | 2 ++ src/interface.jl | 5 ++++- test/config.json | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ test/runtest.jl | 6 ++++-- 5 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 test/config.json diff --git a/Manifest.toml b/Manifest.toml index f387806..c0973e6 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.11.2" manifest_format = "2.0" -project_hash = "740be7f99ee05ce085f66341096fd207ac1a9bce" +project_hash = "b483014657ef9f0fde60d7258585b291d6f0eeca" [[deps.AliasTables]] deps = ["PtrArrays", "Random"] diff --git a/Project.toml b/Project.toml index ab9f8c3..1fbfd03 100644 --- a/Project.toml +++ b/Project.toml @@ -4,6 +4,7 @@ authors = ["narawat lamaiin "] version = "0.1.0" [deps] +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" GeneralUtils = "c6c72f09-b708-4ac8-ac7c-2084d70108fe" @@ -20,6 +21,7 @@ URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [compat] +DataFrames = "1.7.0" GeneralUtils = "0.1.0" LLMMCTS = "0.1.2" SQLLLM = "0.2.0" diff --git a/src/interface.jl b/src/interface.jl index 4b7efbe..69b7fb8 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -813,7 +813,10 @@ function think(a::T)::NamedTuple{(:actionname, :result),Tuple{String,String}} wh else a.memory[:state][:wine_presented_to_user] *= ", $winename" end - delete!(a.memory[:shortmem], :available_wine) + + # [WORKING] instead of present wine then delete shortmem, we can present just found wine and leave previous wine in shortmem. + # so agent can use wine data later + delete!(a.memory[:shortmem], :available_wine) end elseif actionname == "CHECKINVENTORY" diff --git a/test/config.json b/test/config.json new file mode 100644 index 0000000..7bf19e8 --- /dev/null +++ b/test/config.json @@ -0,0 +1,56 @@ +{ + "mqttServerInfo": { + "description": "mqtt server info", + "port": 1883, + "broker": "mqtt.yiem.cc" + }, + "testingOrProduction": { + "value": "testing", + "description": "agent status, couldbe testing or production" + }, + "agentid": { + "value": "2b74b87a-5413-4fe2-a4d3-405891051680", + "description": "a unique id for this agent" + }, + "agentCentralConfigTopic": { + "mqtttopic": "/yiem_branch_1/agent/sommelier/backend/config/api/v1.1", + "description": "a central agent server's topic to get this agent config" + }, + "servicetopic": { + "mqtttopic": [ + "/yiem/hq/agent/sommelier/backend/prompt/api_v1/testing" + ], + "description": "a topic this agent are waiting for service request" + }, + "role": { + "value": "sommelier", + "description": "agent role" + }, + "organization": { + "value": "yiem_hq", + "description": "organization name" + }, + "externalservice": { + "text2textinstruct": { + "mqtttopic": "/loadbalancer/requestingservice", + "description": "text to text service with instruct LLM", + "llminfo": { + "name": "llama3instruct" + } + }, + "virtualWineCustomer_1": { + "mqtttopic": "/virtualenvironment/winecustomer", + "description": "text to text service with instruct LLM that act as wine customer", + "llminfo": { + "name": "llama3instruct" + } + }, + "text2textchat": { + "mqtttopic": "/loadbalancer/requestingservice", + "description": "text to text service with instruct LLM", + "llminfo": { + "name": "llama3instruct" + } + } + } +} \ No newline at end of file diff --git a/test/runtest.jl b/test/runtest.jl index 0ac5002..c646701 100644 --- a/test/runtest.jl +++ b/test/runtest.jl @@ -1,5 +1,5 @@ using Revise -using JSON, JSON3, MQTTClient, Dates, UUIDs, PrettyPrinting, LibPQ, Base64, DataFrames +using JSON, JSON3, Dates, UUIDs, PrettyPrinting, LibPQ, Base64, DataFrames using YiemAgent, GeneralUtils using Base.Threads @@ -8,7 +8,9 @@ using Base.Threads # load config -config = copy(JSON3.read("../mountvolume/config.json")) +config = JSON3.read("./test/config.json") +# config = copy(JSON3.read("../mountvolume/config.json")) + function executeSQL(sql::T) where {T<:AbstractString} DBconnection = LibPQ.Connection("host=192.168.88.12 port=10201 dbname=wineDB user=yiemtechnologies password=yiemtechnologies@Postgres_0.0")