This commit is contained in:
narawat lamaiin
2024-12-09 22:41:17 +07:00
parent 91d90c4928
commit 82707a2cc0
5 changed files with 67 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
julia_version = "1.11.2" julia_version = "1.11.2"
manifest_format = "2.0" manifest_format = "2.0"
project_hash = "740be7f99ee05ce085f66341096fd207ac1a9bce" project_hash = "b483014657ef9f0fde60d7258585b291d6f0eeca"
[[deps.AliasTables]] [[deps.AliasTables]]
deps = ["PtrArrays", "Random"] deps = ["PtrArrays", "Random"]

View File

@@ -4,6 +4,7 @@ authors = ["narawat lamaiin <narawat@outlook.com>"]
version = "0.1.0" version = "0.1.0"
[deps] [deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
GeneralUtils = "c6c72f09-b708-4ac8-ac7c-2084d70108fe" GeneralUtils = "c6c72f09-b708-4ac8-ac7c-2084d70108fe"
@@ -20,6 +21,7 @@ URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
[compat] [compat]
DataFrames = "1.7.0"
GeneralUtils = "0.1.0" GeneralUtils = "0.1.0"
LLMMCTS = "0.1.2" LLMMCTS = "0.1.2"
SQLLLM = "0.2.0" SQLLLM = "0.2.0"

View File

@@ -813,7 +813,10 @@ function think(a::T)::NamedTuple{(:actionname, :result),Tuple{String,String}} wh
else else
a.memory[:state][:wine_presented_to_user] *= ", $winename" a.memory[:state][:wine_presented_to_user] *= ", $winename"
end 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 end
elseif actionname == "CHECKINVENTORY" elseif actionname == "CHECKINVENTORY"

56
test/config.json Normal file
View File

@@ -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"
}
}
}
}

View File

@@ -1,5 +1,5 @@
using Revise 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 YiemAgent, GeneralUtils
using Base.Threads using Base.Threads
@@ -8,7 +8,9 @@ using Base.Threads
# load config # 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} 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") DBconnection = LibPQ.Connection("host=192.168.88.12 port=10201 dbname=wineDB user=yiemtechnologies password=yiemtechnologies@Postgres_0.0")