70 Commits

Author SHA1 Message Date
ton c4eeb99aba update 2026-07-12 10:48:01 +07:00
ton bd5022c8bc update compat 2026-07-05 17:37:41 +07:00
ton db84b1c398 update 2026-07-05 07:05:11 +07:00
ton f8f8410259 fix clean json 2026-07-04 09:09:56 +07:00
ton 956adf0b93 update 2026-07-03 20:54:16 +07:00
ton 0f2a33bcdd update 2026-07-03 20:30:24 +07:00
ton b8f84846bb update 2026-07-03 18:33:45 +07:00
ton adf6264061 fix dictify 2026-07-03 18:32:41 +07:00
ton 08f19f17a2 fix clean json response 2026-07-03 12:24:40 +07:00
ton 8a4e882dc1 add new func() 2026-06-30 22:02:17 +07:00
ton fb7942a965 add new function 2026-06-30 21:02:25 +07:00
ton e54454b099 update 2026-06-27 17:16:21 +07:00
ton dac98ab38c update 2026-06-27 17:15:36 +07:00
ton 1e8149aa6f update 2026-06-27 17:09:27 +07:00
ton 8f12c29a78 update 2026-06-27 16:53:55 +07:00
ton e3d09e6ebd update docs 2026-06-27 16:00:31 +07:00
ton f33f4f0790 up version 2026-06-24 12:55:40 +07:00
ton fcf2044dd9 Merge pull request 'update' (#7) from v0.4.0-dictify_key into main
Reviewed-on: #7
2026-06-24 05:33:31 +00:00
ton 05d8cb9c02 update 2026-06-24 12:29:01 +07:00
ton 13de2f90ff update 2026-06-07 17:22:24 +07:00
ton 22fe810f63 update 2026-06-07 17:20:52 +07:00
ton abdf6cf3b8 Merge pull request 'update' (#6) from add_generateupdateSQL into main
Reviewed-on: #6
2026-06-07 09:32:41 +00:00
ton f2ba243df0 update 2026-06-07 16:27:08 +07:00
ton bb2851332a Merge pull request 'update' (#5) from add_generateupdateSQL into main
Reviewed-on: #5
2026-06-07 09:20:55 +00:00
ton 00225f3a06 update 2026-06-07 16:16:52 +07:00
ton 7cb0bd077f Merge pull request 'update' (#4) from add_generateupdateSQL into main
Reviewed-on: #4
2026-06-07 09:04:33 +00:00
ton 0ba2aa310e update 2026-06-07 15:32:49 +07:00
ton 1916668c6e Merge pull request 'add_generateupdateSQL' (#3) from add_generateupdateSQL into main
Reviewed-on: #3
2026-06-07 06:57:28 +00:00
ton 919800da42 add generateUpdateSQL 2026-06-07 13:56:07 +07:00
ton 947580a2ec update 2026-06-07 13:46:04 +07:00
ton 688b9a22b6 add generateUpdateSQL 2026-06-07 13:43:47 +07:00
ton 76ce0fc54f Merge pull request 'usability' (#2) from usability into main
Reviewed-on: #2
2026-05-29 04:17:51 +00:00
ton b8bd06f386 update generateUpdateSQL 2026-05-29 11:16:34 +07:00
ton e08b6ab54d update 2026-02-28 11:40:35 +07:00
ton 830e9bcc5f update 2026-02-22 18:24:52 +07:00
ton 52d991bbf3 Merge pull request 'v0.3.1' (#1) from v0.3.1 into main
Reviewed-on: #1
2025-12-17 05:43:32 +00:00
ton 35c2b4c211 use JSON instead of JSON3 2025-12-17 12:39:18 +07:00
ton 170b0bad15 update 2025-11-22 10:45:08 +07:00
ton fbedd507fc update 2025-11-22 09:05:06 +07:00
ton 0e36b8db90 remove MQTT dependency 2025-08-01 06:04:17 +07:00
ton 13fcf06503 update 2025-07-23 07:10:28 +07:00
narawat lamaiin 066d72553f update 2025-07-18 07:54:50 +07:00
narawat lamaiin b3e8df7287 update 2025-07-17 11:48:16 +07:00
narawat lamaiin c5f3fda2ba update 2025-07-14 13:49:04 +07:00
narawat lamaiin adab61dca8 update 2025-07-14 08:54:46 +07:00
narawat lamaiin 09615a6909 mark new version 2025-06-10 10:49:11 +07:00
ton 92c5930e9a Merge pull request 'v0.3.0' (#6) from v0.3.0 into main
Reviewed-on: #6
2025-06-10 03:39:42 +00:00
narawat lamaiin 5b4c1c1471 update 2025-06-10 10:38:51 +07:00
narawat lamaiin fc3edd7b8f update 2025-06-10 10:29:57 +07:00
narawat lamaiin 93aa0ee1ac update 2025-06-10 10:16:31 +07:00
narawat lamaiin 42378714a0 mark new version 2025-06-10 09:31:00 +07:00
ton 759f022c98 Merge pull request 'v0.2.4' (#5) from v0.2.4 into main
Reviewed-on: #5
2025-06-10 02:27:09 +00:00
narawat lamaiin 5af4d481f2 update 2025-06-10 09:25:41 +07:00
narawat lamaiin 221bb5beb7 update 2025-06-09 06:34:29 +07:00
narawat lamaiin 5a89e86120 update 2025-06-03 10:08:40 +07:00
narawat lamaiin e351a92680 mark new version 2025-05-24 08:52:50 +07:00
ton 83cd0cfea3 Merge pull request 'v0.2.3' (#4) from v0.2.3 into main
Reviewed-on: #4
2025-05-24 01:47:53 +00:00
narawat lamaiin 9e29f611df update 2025-05-24 08:42:50 +07:00
narawat lamaiin d8ea4b70a9 update 2025-05-04 20:56:36 +07:00
narawat lamaiin 150ddac2c0 add extractTextBetweenString 2025-04-30 12:59:14 +07:00
narawat lamaiin 5108ad1f6b update 2025-04-25 21:12:14 +07:00
narawat lamaiin 14766ae171 update 2025-04-13 21:45:47 +07:00
narawat lamaiin ccd91a7b6f update 2025-04-07 05:20:05 +07:00
narawat lamaiin a894ad85ba update 2025-04-04 15:04:19 +07:00
narawat lamaiin 1da05f5cae update 2025-03-31 21:30:29 +07:00
narawat lamaiin 562f528c01 update 2025-03-27 13:09:20 +07:00
narawat lamaiin 840b0e6205 update 2025-03-22 09:41:39 +07:00
tonaerospace cb4d01c612 update 2025-03-20 16:05:39 +07:00
tonaerospace e6344f1a92 mark new version 2025-03-17 09:54:32 +07:00
ton 3082c261c7 Merge pull request 'v0.2.2' (#3) from v0.2.2 into main
Reviewed-on: #3
2025-03-14 12:17:37 +00:00
17 changed files with 2807 additions and 1424 deletions
+369 -152
View File
@@ -1,8 +1,32 @@
# This file is machine-generated - editing it directly is not advised # This file is machine-generated - editing it directly is not advised
julia_version = "1.11.2" julia_version = "1.12.6"
manifest_format = "2.0" manifest_format = "2.0"
project_hash = "75c6a269a13b222c106479d2177b05facfa23f74" project_hash = "c825feef41198c770952e1181ec41e9f2aa0c3c0"
[[deps.Accessors]]
deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "MacroTools"]
git-tree-sha1 = "7063ad1083578215c7c4bf410368150abe8d5524"
uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
version = "0.1.45"
[deps.Accessors.extensions]
AxisKeysExt = "AxisKeys"
IntervalSetsExt = "IntervalSets"
LinearAlgebraExt = "LinearAlgebra"
StaticArraysExt = "StaticArrays"
StructArraysExt = "StructArrays"
TestExt = "Test"
UnitfulExt = "Unitful"
[deps.Accessors.weakdeps]
AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
[[deps.AliasTables]] [[deps.AliasTables]]
deps = ["PtrArrays", "Random"] deps = ["PtrArrays", "Random"]
@@ -10,10 +34,6 @@ git-tree-sha1 = "9876e1e164b144ca45e9e3198d0b689cadfed9ff"
uuid = "66dad0bd-aa9a-41b7-9441-69ab47430ed8" uuid = "66dad0bd-aa9a-41b7-9441-69ab47430ed8"
version = "1.1.3" version = "1.1.3"
[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
version = "1.1.2"
[[deps.Artifacts]] [[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
version = "1.11.0" version = "1.11.0"
@@ -22,32 +42,87 @@ version = "1.11.0"
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
version = "1.11.0" version = "1.11.0"
[[deps.BufferedStreams]]
git-tree-sha1 = "6863c5b7fc997eadcabdbaf6c5f201dc30032643"
uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
version = "1.2.2"
[[deps.CRC32c]]
uuid = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"
version = "1.11.0"
[[deps.CSV]] [[deps.CSV]]
deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "PrecompileTools", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"] deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "PrecompileTools", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"]
git-tree-sha1 = "deddd8725e5e1cc49ee205a1964256043720a6c3" git-tree-sha1 = "8d8e0b0f350b8e1c91420b5e64e5de774c2f0f4d"
uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
version = "0.10.15" version = "0.10.16"
[[deps.CodeTracking]]
deps = ["InteractiveUtils", "REPL", "UUIDs"]
git-tree-sha1 = "cfb7a2e89e245a9d5016b70323db412b3a7438d5"
uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
version = "3.0.2"
[[deps.CodecBase]]
deps = ["TranscodingStreams"]
git-tree-sha1 = "40956acdbef3d8c7cc38cba42b56034af8f8581a"
uuid = "6c391c72-fb7b-5838-ba82-7cfb1bcfecbf"
version = "0.3.4"
[[deps.CodecZlib]] [[deps.CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"] deps = ["TranscodingStreams", "Zlib_jll"]
git-tree-sha1 = "bce6804e5e6044c6daab27bb533d1295e4a2e759" git-tree-sha1 = "962834c22b66e32aa10f7611c08c8ca4e20749a9"
uuid = "944b1d66-785c-5afd-91f1-9de20f533193" uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
version = "0.7.6" version = "0.7.8"
[[deps.CommonSolve]]
git-tree-sha1 = "99ee296f88c12485402e37c2fd025f95ae097637"
uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2"
version = "0.2.9"
[[deps.Compat]] [[deps.Compat]]
deps = ["TOML", "UUIDs"] deps = ["TOML", "UUIDs"]
git-tree-sha1 = "8ae8d32e09f0dcf42a36b90d4e17f5dd2e4c4215" git-tree-sha1 = "9d8a54ce4b17aa5bdce0ea5c34bc5e7c340d16ad"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "4.16.0" version = "4.18.1"
weakdeps = ["Dates", "LinearAlgebra"] weakdeps = ["Dates", "LinearAlgebra"]
[deps.Compat.extensions] [deps.Compat.extensions]
CompatLinearAlgebraExt = "LinearAlgebra" CompatLinearAlgebraExt = "LinearAlgebra"
[[deps.Compiler]]
git-tree-sha1 = "382d79bfe72a406294faca39ef0c3cef6e6ce1f1"
uuid = "807dbc54-b67e-4c79-8afb-eafe4df6f2e1"
version = "0.1.1"
[[deps.CompilerSupportLibraries_jll]] [[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"] deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.1.1+0" version = "1.3.0+1"
[[deps.CompositionsBase]]
git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad"
uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b"
version = "0.1.2"
weakdeps = ["InverseFunctions"]
[deps.CompositionsBase.extensions]
CompositionsBaseInverseFunctionsExt = "InverseFunctions"
[[deps.ConstructionBase]]
git-tree-sha1 = "b4b092499347b18a015186eae3042f72267106cb"
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
version = "1.6.0"
[deps.ConstructionBase.extensions]
ConstructionBaseIntervalSetsExt = "IntervalSets"
ConstructionBaseLinearAlgebraExt = "LinearAlgebra"
ConstructionBaseStaticArraysExt = "StaticArrays"
[deps.ConstructionBase.weakdeps]
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[[deps.Crayons]] [[deps.Crayons]]
git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
@@ -61,15 +136,15 @@ version = "1.16.0"
[[deps.DataFrames]] [[deps.DataFrames]]
deps = ["Compat", "DataAPI", "DataStructures", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrecompileTools", "PrettyTables", "Printf", "Random", "Reexport", "SentinelArrays", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] deps = ["Compat", "DataAPI", "DataStructures", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrecompileTools", "PrettyTables", "Printf", "Random", "Reexport", "SentinelArrays", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
git-tree-sha1 = "fb61b4812c49343d7ef0b533ba982c46021938a6" git-tree-sha1 = "5fab31e2e01e70ad66e3e24c968c264d1cf166d6"
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
version = "1.7.0" version = "1.8.2"
[[deps.DataStructures]] [[deps.DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"] deps = ["OrderedCollections"]
git-tree-sha1 = "1d0a14036acb104d9e89698bd408f63ab58cdc82" git-tree-sha1 = "6fb53a69613a0b2b68a0d12671717d307ab8b24e"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.20" version = "0.19.5"
[[deps.DataValueInterfaces]] [[deps.DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
@@ -81,43 +156,39 @@ deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
version = "1.11.0" version = "1.11.0"
[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
version = "1.11.0"
[[deps.Distributions]] [[deps.Distributions]]
deps = ["AliasTables", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"] deps = ["AliasTables", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "Roots", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"]
git-tree-sha1 = "3101c32aab536e7a27b1763c0797dba151b899ad" git-tree-sha1 = "cd3c5ac74cd3923c8945c6a81518c46abd0e73a3"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.25.113" version = "0.25.129"
[deps.Distributions.extensions] [deps.Distributions.extensions]
DistributionsChainRulesCoreExt = "ChainRulesCore" DistributionsChainRulesCoreExt = "ChainRulesCore"
DistributionsDensityInterfaceExt = "DensityInterface" DistributionsDensityInterfaceExt = "DensityInterface"
DistributionsSparseConnectivityTracerExt = "SparseConnectivityTracer"
DistributionsTestExt = "Test" DistributionsTestExt = "Test"
[deps.Distributions.weakdeps] [deps.Distributions.weakdeps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d" DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[[deps.DocStringExtensions]] [[deps.DocStringExtensions]]
deps = ["LibGit2"] git-tree-sha1 = "7442a5dfe1ebb773c29cc2962a8980f47221d76c"
git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.9.3" version = "0.9.5"
[[deps.Downloads]] [[deps.EnumX]]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] git-tree-sha1 = "c49898e8438c828577f04b92fc9368c388ac783c"
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56"
version = "1.6.0" version = "1.0.7"
[[deps.FilePathsBase]] [[deps.FilePathsBase]]
deps = ["Compat", "Dates"] deps = ["Compat", "Dates"]
git-tree-sha1 = "7878ff7172a8e6beedd1dea14bd27c3c6340d361" git-tree-sha1 = "3bab2c5aa25e7840a4b065805c0cdfc01f3068d2"
uuid = "48062228-2e41-5def-b9a4-89aafe57970f" uuid = "48062228-2e41-5def-b9a4-89aafe57970f"
version = "0.9.22" version = "0.9.24"
[deps.FilePathsBase.extensions] [deps.FilePathsBase.extensions]
FilePathsBaseMmapExt = "Mmap" FilePathsBaseMmapExt = "Mmap"
@@ -133,31 +204,54 @@ version = "1.11.0"
[[deps.FillArrays]] [[deps.FillArrays]]
deps = ["LinearAlgebra"] deps = ["LinearAlgebra"]
git-tree-sha1 = "6a70198746448456524cb442b8af316927ff3e1a" git-tree-sha1 = "2f979084d1e13948a3352cf64a25df6bd3b4dca3"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "1.13.0" version = "1.16.0"
weakdeps = ["PDMats", "SparseArrays", "Statistics"]
[deps.FillArrays.extensions] [deps.FillArrays.extensions]
FillArraysPDMatsExt = "PDMats" FillArraysPDMatsExt = "PDMats"
FillArraysSparseArraysExt = "SparseArrays" FillArraysSparseArraysExt = "SparseArrays"
FillArraysStaticArraysExt = "StaticArrays"
FillArraysStatisticsExt = "Statistics" FillArraysStatisticsExt = "Statistics"
[deps.FillArrays.weakdeps]
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[[deps.Future]] [[deps.Future]]
deps = ["Random"] deps = ["Random"]
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
version = "1.11.0" version = "1.11.0"
[[deps.GeneralUtils]]
deps = ["CSV", "DataFrames", "DataStructures", "Dates", "Distributions", "HTTP", "JSON", "NATS", "PrettyPrinting", "Random", "Revise", "SHA", "UUIDs"]
path = "."
uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe"
version = "0.4.10"
[[deps.HTTP]]
deps = ["Base64", "CodecZlib", "Dates", "EnumX", "PrecompileTools", "Random", "Reseau", "SHA", "URIs", "UUIDs", "Zlib_jll"]
git-tree-sha1 = "69343dd8afb1671b84c3aa2dda511238d0919a55"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "2.5.0"
[[deps.HashArrayMappedTries]]
git-tree-sha1 = "2eaa69a7cab70a52b9687c8bf950a5a93ec895ae"
uuid = "076d061b-32b6-4027-95e0-9a2c6f6d7e74"
version = "0.2.0"
[[deps.HypergeometricFunctions]] [[deps.HypergeometricFunctions]]
deps = ["LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"] deps = ["LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"]
git-tree-sha1 = "b1c2585431c382e3fe5805874bda6aea90a95de9" git-tree-sha1 = "68c173f4f449de5b438ee67ed0c9c748dc31a2ec"
uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a" uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
version = "0.3.25" version = "0.3.28"
[[deps.InlineStrings]] [[deps.InlineStrings]]
git-tree-sha1 = "45521d31238e87ee9f9732561bfee12d4eebd52d" git-tree-sha1 = "8f3d257792a522b4601c24a577954b0a8cd7334d"
uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
version = "1.4.2" version = "1.4.5"
[deps.InlineStrings.extensions] [deps.InlineStrings.extensions]
ArrowTypesExt = "ArrowTypes" ArrowTypesExt = "ArrowTypes"
@@ -172,15 +266,28 @@ deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
version = "1.11.0" version = "1.11.0"
[[deps.InverseFunctions]]
git-tree-sha1 = "a779299d77cd080bf77b97535acecd73e1c5e5cb"
uuid = "3587e190-3f89-42d0-90ee-14403ec27112"
version = "0.1.17"
[deps.InverseFunctions.extensions]
InverseFunctionsDatesExt = "Dates"
InverseFunctionsTestExt = "Test"
[deps.InverseFunctions.weakdeps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[[deps.InvertedIndices]] [[deps.InvertedIndices]]
git-tree-sha1 = "0dc7b50b8d436461be01300fd8cd45aa0274b038" git-tree-sha1 = "6da3c4316095de0f5ee2ebd875df8721e7e0bdbe"
uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
version = "1.3.0" version = "1.3.1"
[[deps.IrrationalConstants]] [[deps.IrrationalConstants]]
git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" git-tree-sha1 = "b2d91fe939cae05960e760110b328288867b5758"
uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" uuid = "92d709cd-6900-40b7-9082-c6be49f344b6"
version = "0.2.2" version = "0.2.6"
[[deps.IteratorInterfaceExtensions]] [[deps.IteratorInterfaceExtensions]]
git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
@@ -189,15 +296,27 @@ version = "1.0.0"
[[deps.JLLWrappers]] [[deps.JLLWrappers]]
deps = ["Artifacts", "Preferences"] deps = ["Artifacts", "Preferences"]
git-tree-sha1 = "be3dc50a92e5a386872a493a10050136d4703f9b" git-tree-sha1 = "7204148362dafe5fe6a273f855b8ccbe4df8173e"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.8.0"
[[deps.JSON]]
deps = ["Dates", "Logging", "Parsers", "PrecompileTools", "StructUtils", "UUIDs", "Unicode"]
git-tree-sha1 = "c89d196f5ffb64bfbf80985b699ea913b0d2c211"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "1.6.1" version = "1.6.1"
[deps.JSON.extensions]
JSONArrowExt = ["ArrowTypes"]
[deps.JSON.weakdeps]
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd"
[[deps.JSON3]] [[deps.JSON3]]
deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"]
git-tree-sha1 = "1d322381ef7b087548321d3f878cb4c9bd8f8f9b" git-tree-sha1 = "411eccfe8aba0814ffa0fdf4860913ed09c34975"
uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
version = "1.14.1" version = "1.14.3"
[deps.JSON3.extensions] [deps.JSON3.extensions]
JSON3ArrowExt = ["ArrowTypes"] JSON3ArrowExt = ["ArrowTypes"]
@@ -205,35 +324,36 @@ version = "1.14.1"
[deps.JSON3.weakdeps] [deps.JSON3.weakdeps]
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd"
[[deps.JuliaInterpreter]]
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
git-tree-sha1 = "58927c485919bf17ea308d9d82156de1adf4b006"
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.10.12"
[[deps.JuliaSyntaxHighlighting]]
deps = ["StyledStrings"]
uuid = "ac6e5ff7-fb65-4e79-a425-ec3bc9c03011"
version = "1.12.0"
[[deps.LaTeXStrings]] [[deps.LaTeXStrings]]
git-tree-sha1 = "dda21b8cbd6a6c40d9d02a73230f9d70fed6918c" git-tree-sha1 = "dda21b8cbd6a6c40d9d02a73230f9d70fed6918c"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
version = "1.4.0" version = "1.4.0"
[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
version = "0.6.4"
[[deps.LibCURL_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
version = "8.6.0+0"
[[deps.LibGit2]] [[deps.LibGit2]]
deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] deps = ["LibGit2_jll", "NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
version = "1.11.0" version = "1.11.0"
[[deps.LibGit2_jll]] [[deps.LibGit2_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "OpenSSL_jll"]
uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5"
version = "1.7.2+0" version = "1.9.0+0"
[[deps.LibSSH2_jll]] [[deps.LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"] deps = ["Artifacts", "Libdl", "OpenSSL_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
version = "1.11.0+1" version = "1.11.3+1"
[[deps.Libdl]] [[deps.Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
@@ -242,13 +362,13 @@ version = "1.11.0"
[[deps.LinearAlgebra]] [[deps.LinearAlgebra]]
deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
version = "1.11.0" version = "1.12.0"
[[deps.LogExpFunctions]] [[deps.LogExpFunctions]]
deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"]
git-tree-sha1 = "a2d09619db4e765091ee5c6ffe8872849de0feea" git-tree-sha1 = "bba2d9aa057d8f126415de240573e86a8f39d2a1"
uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
version = "0.3.28" version = "1.0.1"
[deps.LogExpFunctions.extensions] [deps.LogExpFunctions.extensions]
LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" LogExpFunctionsChainRulesCoreExt = "ChainRulesCore"
@@ -264,25 +384,33 @@ version = "0.3.28"
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
version = "1.11.0" version = "1.11.0"
[[deps.MQTTClient]] [[deps.LoweredCodeUtils]]
deps = ["Distributed", "Random", "Sockets"] deps = ["CodeTracking", "Compiler", "JuliaInterpreter"]
git-tree-sha1 = "f2597b290d4bf17b577346153cd2ddf9accb5c26" git-tree-sha1 = "3733419e9a71156b389f3e331672d2e95436783f"
uuid = "985f35cc-2c3d-4943-b8c1-f0931d5f0959" uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
version = "0.3.1" version = "3.6.2"
weakdeps = ["PrecompileTools"]
[deps.MQTTClient.extensions] [[deps.MacroTools]]
PrecompileMQTT = "PrecompileTools" git-tree-sha1 = "1e0228a030642014fe5cfe68c2c0a818f9e3f522"
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
version = "0.5.16"
[[deps.Markdown]] [[deps.Markdown]]
deps = ["Base64"] deps = ["Base64", "JuliaSyntaxHighlighting", "StyledStrings"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
version = "1.11.0" version = "1.11.0"
[[deps.MbedTLS]]
deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"]
git-tree-sha1 = "8785729fa736197687541f7053f6d8ab7fc44f92"
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
version = "1.1.10"
[[deps.MbedTLS_jll]] [[deps.MbedTLS_jll]]
deps = ["Artifacts", "Libdl"] deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "ff69a2b1330bcb730b9ac1ab7dd680176f5896b8"
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.28.6+0" version = "2.28.1010+0"
[[deps.Missings]] [[deps.Missings]]
deps = ["DataAPI"] deps = ["DataAPI"]
@@ -296,55 +424,65 @@ version = "1.11.0"
[[deps.MozillaCACerts_jll]] [[deps.MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159" uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
version = "2023.12.12" version = "2025.11.4"
[[deps.NATS]]
deps = ["Base64", "BufferedStreams", "CodecBase", "Dates", "DocStringExtensions", "JSON3", "MbedTLS", "NanoDates", "Random", "ScopedValues", "Sockets", "Sodium", "StructTypes", "URIs"]
git-tree-sha1 = "a1cdf34ba90ee5cd2658e487d3277ffafee712ce"
uuid = "55e73f9c-eeeb-467f-b4cc-a633fde63d2a"
version = "0.1.1"
[[deps.NanoDates]]
deps = ["Dates", "Parsers"]
git-tree-sha1 = "850a0557ae5934f6e67ac0dc5ca13d0328422d1f"
uuid = "46f1a544-deae-4307-8689-c12aa3c955c6"
version = "1.0.3"
[[deps.NetworkOptions]] [[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
version = "1.2.0" version = "1.3.0"
[[deps.OpenBLAS_jll]] [[deps.OpenBLAS_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
version = "0.3.27+1" version = "0.3.29+0"
[[deps.OpenLibm_jll]] [[deps.OpenLibm_jll]]
deps = ["Artifacts", "Libdl"] deps = ["Artifacts", "Libdl"]
uuid = "05823500-19ac-5b8b-9628-191a04bc5112" uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
version = "0.8.1+2" version = "0.8.7+0"
[[deps.OpenSSL_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
version = "3.5.4+0"
[[deps.OpenSpecFun_jll]] [[deps.OpenSpecFun_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"]
git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" git-tree-sha1 = "1346c9208249809840c91b26703912dff463d335"
uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
version = "0.5.5+0" version = "0.5.6+0"
[[deps.OrderedCollections]] [[deps.OrderedCollections]]
git-tree-sha1 = "12f1439c4f986bb868acda6ea33ebc78e19b95ad" git-tree-sha1 = "94ba93778373a53bfd5a0caaf7d809c445292ff4"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.7.0" version = "1.8.2"
[[deps.PDMats]] [[deps.PDMats]]
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"]
git-tree-sha1 = "949347156c25054de2db3b166c52ac4728cbad65" git-tree-sha1 = "26766d4b5f1a410c218a19b85a672c6edb693c65"
uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" uuid = "90014a1f-27ba-587c-ab20-58faa44d9150"
version = "0.11.31" version = "0.11.40"
weakdeps = ["StatsBase"]
[deps.PDMats.extensions]
StatsBaseExt = "StatsBase"
[[deps.Parsers]] [[deps.Parsers]]
deps = ["Dates", "PrecompileTools", "UUIDs"] deps = ["Dates", "PrecompileTools", "UUIDs"]
git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" git-tree-sha1 = "32a4e09c5f29402573d673901778a0e03b0807b9"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "2.8.1" version = "2.8.6"
[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "Random", "SHA", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
version = "1.11.0"
[deps.Pkg.extensions]
REPLExt = "REPL"
[deps.Pkg.weakdeps]
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
[[deps.PooledArrays]] [[deps.PooledArrays]]
deps = ["DataAPI", "Future"] deps = ["DataAPI", "Future"]
@@ -354,15 +492,15 @@ version = "1.4.3"
[[deps.PrecompileTools]] [[deps.PrecompileTools]]
deps = ["Preferences"] deps = ["Preferences"]
git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" git-tree-sha1 = "edbeefc7a4889f528644251bdb5fc9ab5348bc2c"
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
version = "1.2.1" version = "1.3.4"
[[deps.Preferences]] [[deps.Preferences]]
deps = ["TOML"] deps = ["TOML"]
git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" git-tree-sha1 = "8b770b60760d4451834fe79dd483e318eee709c4"
uuid = "21216c6a-2e73-6563-6e65-726566657250" uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.4.3" version = "1.5.2"
[[deps.PrettyPrinting]] [[deps.PrettyPrinting]]
git-tree-sha1 = "142ee93724a9c5d04d78df7006670a93ed1b244e" git-tree-sha1 = "142ee93724a9c5d04d78df7006670a93ed1b244e"
@@ -370,10 +508,16 @@ uuid = "54e16d92-306c-5ea0-a30b-337be88ac337"
version = "0.4.2" version = "0.4.2"
[[deps.PrettyTables]] [[deps.PrettyTables]]
deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "Reexport", "StringManipulation", "Tables"] deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "REPL", "Reexport", "StringManipulation", "Tables"]
git-tree-sha1 = "1101cd475833706e4d0e7b122218257178f48f34" git-tree-sha1 = "624de6279ab7d94fc9f672f0068107eb6619732c"
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
version = "2.4.0" version = "3.3.2"
[deps.PrettyTables.extensions]
PrettyTablesTypstryExt = "Typstry"
[deps.PrettyTables.weakdeps]
Typstry = "f0ed7684-a786-439e-b1e3-3b82803b501e"
[[deps.Printf]] [[deps.Printf]]
deps = ["Unicode"] deps = ["Unicode"]
@@ -381,15 +525,15 @@ uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
version = "1.11.0" version = "1.11.0"
[[deps.PtrArrays]] [[deps.PtrArrays]]
git-tree-sha1 = "77a42d78b6a92df47ab37e177b2deac405e1c88f" git-tree-sha1 = "4fbbafbc6251b883f4d2705356f3641f3652a7fe"
uuid = "43287f4e-b6f4-7ad1-bb20-aadabca52c3d" uuid = "43287f4e-b6f4-7ad1-bb20-aadabca52c3d"
version = "1.2.1" version = "1.4.0"
[[deps.QuadGK]] [[deps.QuadGK]]
deps = ["DataStructures", "LinearAlgebra"] deps = ["DataStructures", "LinearAlgebra"]
git-tree-sha1 = "cda3b045cf9ef07a08ad46731f5a3165e56cf3da" git-tree-sha1 = "5e8e8b0ab68215d7a2b14b9921a946fee794749e"
uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
version = "2.11.1" version = "2.11.3"
[deps.QuadGK.extensions] [deps.QuadGK.extensions]
QuadGKEnzymeExt = "Enzyme" QuadGKEnzymeExt = "Enzyme"
@@ -397,6 +541,11 @@ version = "2.11.1"
[deps.QuadGK.weakdeps] [deps.QuadGK.weakdeps]
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
[[deps.REPL]]
deps = ["InteractiveUtils", "JuliaSyntaxHighlighting", "Markdown", "Sockets", "StyledStrings", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
version = "1.11.0"
[[deps.Random]] [[deps.Random]]
deps = ["SHA"] deps = ["SHA"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -407,11 +556,29 @@ git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
uuid = "189a3867-3050-52da-a836-e630ba90ab69" uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "1.2.2" version = "1.2.2"
[[deps.Reseau]]
deps = ["NetworkOptions", "OpenSSL_jll", "PrecompileTools", "Random", "SHA"]
git-tree-sha1 = "0eab6d95ed40c2ef3992255c1c71e4f9748932b5"
uuid = "802f3686-a58f-41ce-bb0c-3c43c75bba36"
version = "1.3.1"
[[deps.Revise]]
deps = ["CRC32c", "CodeTracking", "FileWatching", "InteractiveUtils", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Preferences", "REPL", "UUIDs"]
git-tree-sha1 = "27e3ee13fc8739a59b380d6163d6a82f52c03bd7"
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
version = "3.15.1"
[deps.Revise.extensions]
DistributedExt = "Distributed"
[deps.Revise.weakdeps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[deps.Rmath]] [[deps.Rmath]]
deps = ["Random", "Rmath_jll"] deps = ["Random", "Rmath_jll"]
git-tree-sha1 = "852bd0f55565a9e973fcfee83a84413270224dc4" git-tree-sha1 = "5b3d50eb374cea306873b371d3f8d3915a018f0b"
uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa"
version = "0.8.0" version = "0.9.0"
[[deps.Rmath_jll]] [[deps.Rmath_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"] deps = ["Artifacts", "JLLWrappers", "Libdl"]
@@ -419,15 +586,43 @@ git-tree-sha1 = "58cdd8fb2201a6267e1db87ff148dd6c1dbd8ad8"
uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f"
version = "0.5.1+0" version = "0.5.1+0"
[[deps.Roots]]
deps = ["Accessors", "CommonSolve", "Printf"]
git-tree-sha1 = "91cfb1cb4f6e27557cc2df798a31eff6089a41eb"
uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
version = "3.0.0"
[deps.Roots.extensions]
RootsChainRulesCoreExt = "ChainRulesCore"
RootsForwardDiffExt = "ForwardDiff"
RootsIntervalRootFindingExt = "IntervalRootFinding"
RootsSymPyExt = "SymPy"
RootsSymPyPythonCallExt = "SymPyPythonCall"
RootsUnitfulExt = "Unitful"
[deps.Roots.weakdeps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
IntervalRootFinding = "d2bf35a9-74e0-55ec-b149-d360ff49b807"
SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
SymPyPythonCall = "bc8888f7-b21e-4b7c-a06a-5d9c9496438c"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
[[deps.SHA]] [[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0" version = "0.7.0"
[[deps.ScopedValues]]
deps = ["HashArrayMappedTries", "Logging"]
git-tree-sha1 = "67a144433c4ce877ee6d1ada69a124d6b1ecf7be"
uuid = "7e506255-f358-4e82-b7e4-beb19740aa63"
version = "1.6.2"
[[deps.SentinelArrays]] [[deps.SentinelArrays]]
deps = ["Dates", "Random"] deps = ["Dates", "Random"]
git-tree-sha1 = "d0553ce4031a081cc42387a9b9c8441b7d99f32d" git-tree-sha1 = "084c47c7c5ce5cfecefa0a98dff69eb3646b5a80"
uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
version = "1.4.7" version = "1.4.10"
[[deps.Serialization]] [[deps.Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
@@ -437,22 +632,28 @@ version = "1.11.0"
uuid = "6462fe0b-24de-5631-8697-dd941f90decc" uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
version = "1.11.0" version = "1.11.0"
[[deps.Sodium]]
deps = ["Base64", "libsodium_jll"]
git-tree-sha1 = "907703e0d50846f300650d7225bdcab145b7bca9"
uuid = "4f5b5e99-b0ad-42cd-b47a-334e172ec8bd"
version = "1.1.2"
[[deps.SortingAlgorithms]] [[deps.SortingAlgorithms]]
deps = ["DataStructures"] deps = ["DataStructures"]
git-tree-sha1 = "66e0a8e672a0bdfca2c3f5937efb8538b9ddc085" git-tree-sha1 = "13cd91cc9be159e3f4d95b857fa2aa383b53772a"
uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
version = "1.2.1" version = "1.2.3"
[[deps.SparseArrays]] [[deps.SparseArrays]]
deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
version = "1.11.0" version = "1.12.0"
[[deps.SpecialFunctions]] [[deps.SpecialFunctions]]
deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"]
git-tree-sha1 = "2f5d4697f21388cbe1ff299430dd169ef97d7e14" git-tree-sha1 = "6547cbdd8ce32efba0d21c5a40fa96d1a3548f9f"
uuid = "276daf66-3868-5448-9aa4-cd146d93841b" uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
version = "2.4.0" version = "2.8.0"
[deps.SpecialFunctions.extensions] [deps.SpecialFunctions.extensions]
SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" SpecialFunctionsChainRulesCoreExt = "ChainRulesCore"
@@ -472,21 +673,21 @@ weakdeps = ["SparseArrays"]
[[deps.StatsAPI]] [[deps.StatsAPI]]
deps = ["LinearAlgebra"] deps = ["LinearAlgebra"]
git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed" git-tree-sha1 = "178ed29fd5b2a2cfc3bd31c13375ae925623ff36"
uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
version = "1.7.0" version = "1.8.0"
[[deps.StatsBase]] [[deps.StatsBase]]
deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] deps = ["AliasTables", "DataAPI", "DataStructures", "IrrationalConstants", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
git-tree-sha1 = "5cf7606d6cef84b543b483848d4ae08ad9832b21" git-tree-sha1 = "e4d7a1a0edc20af42689ea6f4f3587a2175d50ee"
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
version = "0.34.3" version = "0.34.12"
[[deps.StatsFuns]] [[deps.StatsFuns]]
deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"] deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"]
git-tree-sha1 = "b423576adc27097764a90e163157bcfc9acf0f46" git-tree-sha1 = "770240df9a3b8888065046948f7a09b4e0f997d5"
uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
version = "1.3.2" version = "2.2.0"
[deps.StatsFuns.extensions] [deps.StatsFuns.extensions]
StatsFunsChainRulesCoreExt = "ChainRulesCore" StatsFunsChainRulesCoreExt = "ChainRulesCore"
@@ -498,9 +699,9 @@ version = "1.3.2"
[[deps.StringManipulation]] [[deps.StringManipulation]]
deps = ["PrecompileTools"] deps = ["PrecompileTools"]
git-tree-sha1 = "a6b1675a536c5ad1a60e5a5153e1fee12eb146e3" git-tree-sha1 = "d05693d339e37d6ab134c5ab53c29fce5ee5d7d5"
uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e" uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e"
version = "0.4.0" version = "0.4.4"
[[deps.StructTypes]] [[deps.StructTypes]]
deps = ["Dates", "UUIDs"] deps = ["Dates", "UUIDs"]
@@ -508,6 +709,26 @@ git-tree-sha1 = "159331b30e94d7b11379037feeb9b690950cace8"
uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
version = "1.11.0" version = "1.11.0"
[[deps.StructUtils]]
deps = ["Dates", "UUIDs"]
git-tree-sha1 = "82bee338d650aa515f31866c460cb7e3bcef90b8"
uuid = "ec057cc2-7a8d-4b58-b3b3-92acb9f63b42"
version = "2.8.2"
[deps.StructUtils.extensions]
StructUtilsMeasurementsExt = ["Measurements"]
StructUtilsStaticArraysCoreExt = ["StaticArraysCore"]
StructUtilsTablesExt = ["Tables"]
[deps.StructUtils.weakdeps]
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
[[deps.StyledStrings]]
uuid = "f489334b-da3d-4c2e-b8f0-e476e12c162b"
version = "1.11.0"
[[deps.SuiteSparse]] [[deps.SuiteSparse]]
deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"]
uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
@@ -515,7 +736,7 @@ uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
[[deps.SuiteSparse_jll]] [[deps.SuiteSparse_jll]]
deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] deps = ["Artifacts", "Libdl", "libblastrampoline_jll"]
uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c"
version = "7.7.0+0" version = "7.8.3+2"
[[deps.TOML]] [[deps.TOML]]
deps = ["Dates"] deps = ["Dates"]
@@ -530,20 +751,20 @@ version = "1.0.1"
[[deps.Tables]] [[deps.Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"] deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"]
git-tree-sha1 = "598cd7c1f68d1e205689b1c2fe65a9f85846f297" git-tree-sha1 = "0f38a06c83f0007bbab3cf911262841c9a0f07e0"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "1.12.0" version = "1.13.0"
[[deps.Tar]]
deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
version = "1.10.0"
[[deps.TranscodingStreams]] [[deps.TranscodingStreams]]
git-tree-sha1 = "0c45878dcfdcfa8480052b6ab162cdd138781742" git-tree-sha1 = "0c45878dcfdcfa8480052b6ab162cdd138781742"
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
version = "0.11.3" version = "0.11.3"
[[deps.URIs]]
git-tree-sha1 = "bef26fb046d031353ef97a82e3fdb6afe7f21b1a"
uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
version = "1.6.1"
[[deps.UUIDs]] [[deps.UUIDs]]
deps = ["Random", "SHA"] deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
@@ -555,9 +776,9 @@ version = "1.11.0"
[[deps.WeakRefStrings]] [[deps.WeakRefStrings]]
deps = ["DataAPI", "InlineStrings", "Parsers"] deps = ["DataAPI", "InlineStrings", "Parsers"]
git-tree-sha1 = "b1be2855ed9ed8eac54e5caff2afcdb442d52c23" git-tree-sha1 = "0716e01c3b40413de5dedbc9c5c69f27cddfddfc"
uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5" uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"
version = "1.4.2" version = "1.4.3"
[[deps.WorkerUtilities]] [[deps.WorkerUtilities]]
git-tree-sha1 = "cd1659ba0d57b71a464a29e64dbc67cfe83d54e7" git-tree-sha1 = "cd1659ba0d57b71a464a29e64dbc67cfe83d54e7"
@@ -567,19 +788,15 @@ version = "1.6.1"
[[deps.Zlib_jll]] [[deps.Zlib_jll]]
deps = ["Libdl"] deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a" uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
version = "1.2.13+1" version = "1.3.1+2"
[[deps.libblastrampoline_jll]] [[deps.libblastrampoline_jll]]
deps = ["Artifacts", "Libdl"] deps = ["Artifacts", "Libdl"]
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
version = "5.11.0+0" version = "5.15.0+0"
[[deps.nghttp2_jll]] [[deps.libsodium_jll]]
deps = ["Artifacts", "Libdl"] deps = ["Artifacts", "JLLWrappers", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" git-tree-sha1 = "011b0a7331b41c25524b64dc42afc9683ee89026"
version = "1.59.0+0" uuid = "a9144af2-ca23-56d9-984f-0d03f7b5ccf8"
version = "1.0.21+0"
[[deps.p7zip_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
version = "17.4.0+2"
+11 -3
View File
@@ -1,7 +1,7 @@
name = "GeneralUtils" name = "GeneralUtils"
uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe" uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe"
version = "0.4.10"
authors = ["tonaerospace <tonaerospace.etc@gmail.com>"] authors = ["tonaerospace <tonaerospace.etc@gmail.com>"]
version = "0.2.2"
[deps] [deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
@@ -9,9 +9,17 @@ 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"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
MQTTClient = "985f35cc-2c3d-4943-b8c1-f0931d5f0959" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
NATS = "55e73f9c-eeeb-467f-b4cc-a633fde63d2a"
PrettyPrinting = "54e16d92-306c-5ea0-a30b-337be88ac337" PrettyPrinting = "54e16d92-306c-5ea0-a30b-337be88ac337"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
[compat]
HTTP = "2.5.0 - 2.9.9"
JSON = "1.3.0 - 1.9.9"
NATS = "0.1.0"
Revise = "3.13.2"
+5
View File
@@ -0,0 +1,5 @@
Todo:
- [WORKING] update with JSON
Change from previous version:
- replace JSON3 with JSON
+79
View File
@@ -0,0 +1,79 @@
using NATS, JSON3
connection = NATS.connect("nats.yiem.cc:4222")
sub1 = NATS.reply(connection, "some_subject"; queue_group="group1") do msg
payload = copy(JSON3.read(msg.payload))
println(payload)
println(msg.reply_to)
# publish(connection, msg.reply_to, "ACK")
return JSON3.write(Dict(:a=>"wassup"))
end
using NATS, JSON3, GeneralUtils
connection = NATS.connect("nats.yiem.cc:4222")
msgMeta = GeneralUtils.generate_msgMeta(
"text2textinstruct_medium.inference.api.v1";
msgPurpose= "inference",
senderName= "yiemagent",
senderId= GeneralUtils.uuid4snakecase(),
receiverName= "text2textinstruct",
)
llmHttpTimeout = 60
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "Wassup buddy!",
:kwargs=> Dict(
:max_tokens=> 2048,
:stop=> ["<|im_end|>"],
:temperature=> 0.2,
),
:llmHttpTimeout=>llmHttpTimeout,
)
)
r = NATS.request(String, connection, "text2textinstruct_medium.inference.api.v1",
JSON3.write(outgoingMsg); timer=Timer(llmHttpTimeout))
using NATS, JSON3, GeneralUtils
connection = NATS.connect("nats.yiem.cc:4222")
msgMeta = GeneralUtils.generate_msgMeta(
"tonpc.containerServices",
msgPurpose="reset container",
senderName= "",
)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> "docker container restart ollama-instance-2",
)
# may be I can't use NATS request inside NATS reply??
r = NATS.request(String, connection, msgMeta[:sendTopic], JSON3.write(outgoingMsg); timer=Timer(10))
BIN
View File
Binary file not shown.
+1 -10
View File
@@ -2,7 +2,7 @@ module GeneralUtils
export # struct export # struct
mqttClientInstance, # mqttClientInstance,
# function # function
noNegative!, randomWithProb, randomChoiceWithProb, findIndex, limitvalue noNegative!, randomWithProb, randomChoiceWithProb, findIndex, limitvalue
@@ -24,16 +24,7 @@ using .interface
#------------------------------------------------------------------------------------------------100 #------------------------------------------------------------------------------------------------100
""" version 0.0.4
Todo:
- [*1] cartesianAssign for different matrix dimension
Change from version: 0.0.3
-
All features
"""
+743 -707
View File
File diff suppressed because it is too large Load Diff
+160 -130
View File
@@ -2,13 +2,45 @@ module dbUtil
export dictToPostgresKeyValueString, generateInsertSQL, generateUpdateSQL export dictToPostgresKeyValueString, generateInsertSQL, generateUpdateSQL
using JSON3, DataStructures, Distributions, Random, Dates, UUIDs, MQTTClient, DataFrames, using JSON, DataStructures, Distributions, Random, Dates, UUIDs, DataFrames,
SHA SHA
using ..util using ..util
#[PENDING] update code to use JSON
# ---------------------------------------------- 100 --------------------------------------------- # # ---------------------------------------------- 100 --------------------------------------------- #
"""
dictToPostgresKeyValueString - Convert dictionary to PostgreSQL key-value string format
This function takes a dictionary and converts it into a PostgreSQL-compatible key-value string
format suitable for storage in a TEXT field. The output format uses curly braces with comma-separated
key-value pairs, where string values are quoted.
# Function Workflow:
1. Iterates through dictionary key-value pairs
2. Handles nested dictionaries by recursively converting them
3. Wraps string values in double quotes
4. Formats numeric and other values without quotes
5. Returns a PostgreSQL-compatible key-value string enclosed in curly braces
# Arguments:
- `dict::Dict` - Dictionary containing key-value pairs to convert
# Return:
- A String in PostgreSQL key-value format: "{key1: value1, key2: \"value2\", ...}"
# Example
```jldoctest
julia> data = Dict{String, Any}(
"name" => "John",
"age" => 30,
"city" => "New York"
);
julia> dictToPostgresKeyValueString(data)
"{\"name\": \"John\", \"age\": 30, \"city\": \"New York\"}"
```
"""
function dictToPostgresKeyValueString(dict) function dictToPostgresKeyValueString(dict)
parts = [] parts = []
for (k, v) in dict for (k, v) in dict
@@ -26,61 +58,71 @@ end
""" Get characters between specified characters. """ generateInsertSQL - Generate SQL INSERT statement from dictionary data
# Arguments This function constructs a SQL INSERT statement by extracting values for specified columns
- `text::T` from a dictionary and formatting them into a valid PostgreSQL INSERT query.
a text being searched
- `startChar::Char` # Function Workflow:
start character 1. Iterates through the dictionary key-value pairs
- `endChar::Char` 2. Filters keys to only include those present in `columnToInsert`
end character 3. Collects column names and their corresponding values
# Keyword Arguments 4. Constructs the final SQL INSERT statement
- `endCharLocation::String`
end character position after startChar. Can be "next" or "end". "next" means the closed # Arguments:
endChar just after startChar. "end" means the furthest endChar. - `table_name::String` - Name of the database table to insert into
- `includeChar::Bool` - `columnToInsert::Vector{Symbol}` - List of column names to include in the INSERT statement
whether to include the startChar and endChar. Default is true - `data::Dict{Symbol, Any}` - Dictionary containing column-value pairs for the insert
# Return
the characters between specified characters. # Return:
- A String containing the SQL INSERT statement
# Example # Example
```jldoctest ```jldoctest
julia> using Revise julia> using UUIDs
julia> using GeneralUtils
julia> insert_data = Dict(
:grape => "NA",
:acidity => "0",
:tannin => "0",
:country => "NA",
:description => "NA",
:region => "NA",
:winery => "ccc",
:intensity => "0",
:sweetness => "0",
:tasting_notes => "NA",
:wine_name => "new_wine",
:wine_id => "9e1deb6a-d57f-4d2c-abbe-da813f4e91ad",
:wine_type => "NA",
:other_attributes => "{\"attribute3\":{\"attribute5\":666,\"attribute4\":\"text\"},\"attribute1\":\"hello world\",\"attribute2\":555}",
:fizziness => "0",
:serving_temperature => "0",
:additional_search_term => "{NA1,NA2}")
```
# TODO
- [] update docs
# Signature # Insert a single record with specific columns
table_name = "wine"
columnToInsert = [:acidity, :tannin, :country, :region, :winery]
data = Dict{Symbol, Any}(
:grape => "Cabernet Sauvignon",
:acidity => "medium", # using descriptive scale (low/medium/full)
:tannin => "medium-plus", # common wine descriptor
:country => "France",
:description => "A rich and structured red wine with notes of blackcurrant, cedar, and subtle oak.",
:region => "Bordeaux",
:winery => "Château Margaux",
:intensity => "medium", # intensity is usually low/medium/full
:sweetness => "dry", # dry/medium-dry/medium/medium-sweet/sweet
:tasting_notes => "Blackberry, graphite, tobacco, vanilla, and subtle earth.",
:wine_name => "Château Margaux Grand Cru",
:wine_id => "8f3c7a2e-1b4d-4a9f-9c2e-4a8b3d6e5f7a", # UUID-like (valid hex)
:wine_type => "Red",
:other_attributes => Dict{String, Any}(
"vintage" => 2018,
"alcohol_percent" => 13.5,
"ph" => 3.6,
" aging_years" => 24, # years in barrel
" producer_code" => "CM-GRAND"
),
:fizziness => "still",
:serving_temperature => "1618°C",
:additional_search_term => ["Cabernet", "Bordeaux red", "premium wine", "CabSav"]
)
julia> generateInsertSQL(table_name, columnToInsert, data)
"INSERT INTO wine (acidity, tannin, country, region, winery) VALUES ('medium', 'medium-plus', 'France', 'Bordeaux', 'Château Margaux');"
```
""" """
function generateInsertSQL(table_name::String, columnToInsert::Vector{Symbol}, function generateInsertSQL(table_name::String, columnToInsert::Vector{Symbol}, data::Dict{Symbol, Any})
insert_data::Dict{Symbol, Any})
columns = String[] columns = String[]
values = String[] values = String[]
for (key, value) in insert_data for (key, value) in data
if key columnToInsert if key columnToInsert
push!(columns, string(key)) push!(columns, string(key))
push!(values, "'$value'") #[] number should not wrapped in '' value_str = isa(value, AbstractString) ? "'$value'" : "$value"
push!(values, value_str)
end end
end end
@@ -89,113 +131,101 @@ function generateInsertSQL(table_name::String, columnToInsert::Vector{Symbol},
return "INSERT INTO $table_name ($columns_str) VALUES ($values_str);" return "INSERT INTO $table_name ($columns_str) VALUES ($values_str);"
end end
# function generateInsertSQL(table_name::String, insert_data::Dict{Symbol, Any})
# columns = String[]
# values = String[]
# for (key, value) in insert_data function generateInsertSQL(table_name::String, data::AbstractDict{String, Any})
# push!(columns, string(key)) columns = String[]
# if key == :other_attributes values = String[]
# push!(values, "'$value'")
# else
# push!(values, "'$value'")
# end
# end
# columns_str = join(columns, ", ") for (key, value) in data
# values_str = join(values, ", ") push!(columns, string(key))
value_str = isa(value, AbstractString) ? "'$value'" : "$value"
# return "INSERT INTO $table_name ($columns_str) VALUES ($values_str);" push!(values, value_str)
# end
"""
example:
insert_data = Dict(
:grape => "NA",
:acidity => "0",
:tannin => "0",
:country => "NA",
:description => "NA",
:region => "NA",
:winery => "ccc",
:intensity => "0",
:sweetness => "0",
:tasting_notes => "NA",
:wine_name => "new_wine",
:wine_id => "9e1deb6a-d57f-4d2c-abbe-da813f4e91ad",
:wine_type => "NA",
:other_attributes => "{\"attribute3\":{\"attribute5\":666,\"attribute4\":\"text\"},\"attribute1\":\"hello world\",\"attribute2\":555}",
:fizziness => "0",
:serving_temperature => "0",
:additional_search_term => "{NA1,NA2}")
id_keys is the primary key columns
"""
# function generateUpdateSQL(table_name::String, update_data::Dict{Symbol, Any}, id_keys::Vector{Symbol})
# set_clauses = String[]
# where_clauses = String[]
# for (key, value) in update_data
# if key in id_keys
# push!(where_clauses, "$key = '$value'")
# else
# if key == :other_attributes
# push!(set_clauses, "$key = '$value'")
# else
# push!(set_clauses, "$key = '$value'")
# end
# end
# end
# set_clause = join(set_clauses, ", ")
# where_clause = join(where_clauses, " AND ")
# return "UPDATE $table_name SET $set_clause WHERE $where_clause;"
# end
function generateUpdateSQL(table_name::String, columnToUpdate::Vector{Symbol},
updatedata::Dict{Symbol, Any}, id_keys::Vector{Symbol})
set_clauses = String[]
where_clauses = String[]
for (key, value) in updatedata
if key in id_keys
push!(where_clauses, "$key = '$value'")
else
if key columnToUpdate # update only specified columns
push!(set_clauses, "$key = '$value'")
end
end
end end
set_clause = join(set_clauses, ", ") columns_str = join(columns, ", ")
where_clause = join(where_clauses, " AND ") values_str = join(values, ", ")
return "UPDATE $table_name SET $set_clause WHERE $where_clause;" return "INSERT INTO $table_name ($columns_str) VALUES ($values_str);"
end end
# ---------------------------------------------- 100 --------------------------------------------- #
""" generateUpdateSQL - Generate SQL UPDATE statement from dictionary data
This function constructs a SQL UPDATE statement by updating multiple columns
based on a primary key condition.
# Arguments:
- `table_name::String` - Name of the database table to update
- `pk_column::Symbol` - The primary key column name
- `pk_value` - The primary key value (used in WHERE clause)
- `data::Dict{Symbol, Any}` - Dictionary containing column-value pairs to update
# Return:
- A String containing the SQL UPDATE statement
# Example
```jldoctest
julia> using UUIDs
# Update multiple columns using a dictionary
table_name = "wine"
pk_column = :wine_id
pk_value = "8f3c7a2e-1b4d-4a9f-9c2e-4a8b3d6e5f7a"
data = Dict{Symbol, Any}(
:acidity => "full",
:tannin => "medium",
:country => "Italy"
)
julia> generateUpdateSQL(table_name, pk_column, pk_value, data)
"UPDATE wine SET acidity = 'full', tannin = 'medium', country = 'Italy' WHERE wine_id = '8f3c7a2e-1b4d-4a9f-9c2e-4a8b3d6e5f7a';"
```
"""
function generateUpdateSQL(table_name::String, pk_column::String, pk_value,
data::AbstractDict{String, Any})
# Build SET clause
set_parts = String[]
for (key, value) in data
if key [pk_column]
value_str = isa(value, AbstractString) ? "'$value'" : "$value"
push!(set_parts, "$(string(key)) = $value_str")
end
end
set_clause = join(set_parts, ", ")
# Handle primary key value
pk_val_str = isa(pk_value, AbstractString) ? "'$pk_value'" : "$pk_value"
return "UPDATE $table_name SET $set_clause WHERE $pk_column = $pk_val_str;"
end
function generateUpdateSQL(table_name::String, pk_dict::AbstractDict{String, Any},
data::AbstractDict{String, Any})
# Build SET clause
set_parts = String[]
for (key, value) in data
if key keys(pk_dict)
value_str = isa(value, AbstractString) ? "'$value'" : "$value"
push!(set_parts, "$(string(key)) = $value_str")
end
end
set_clause = join(set_parts, ", ")
# Build WHERE clause for composite keys
where_parts = String[]
for (col, val) in pk_dict
val_str = isa(val, AbstractString) ? "'$val'" : "$val"
push!(where_parts, "$(string(col)) = $val_str")
end
where_clause = join(where_parts, " AND ")
return "UPDATE $table_name SET $set_clause WHERE $where_clause;"
end
end # module end # module
+738 -144
View File
File diff suppressed because it is too large Load Diff
+334 -44
View File
@@ -1,12 +1,13 @@
module llmUtil module llmUtil
export formatLLMtext, formatLLMtext_llama3instruct, jsoncorrection export formatLLMtext, formatLLMtext_llama3instruct, jsoncorrection, deFormatLLMtext, extractthink,
checkAgentResponse_JSON, clean_json_response
using UUIDs, JSON3, Dates using UUIDs, JSON, Dates
using GeneralUtils using GeneralUtils
# ---------------------------------------------- 100 --------------------------------------------- # # ---------------------------------------------- 100 --------------------------------------------- #
#[PENDING] update code to use JSON
""" Convert a single chat dictionary into LLM model instruct format. """ Convert a single chat dictionary into LLM model instruct format.
@@ -43,7 +44,7 @@ julia> formattedtext = YiemAgent.formatLLMtext_llama3instruct(d[:name], d[:text]
Signature Signature
""" """
function formatLLMtext_llama3instruct(name::T, text::T; function formatLLMtext_llama3instruct(name::T, text::T;
assistantStarter::Bool=true) where {T<:AbstractString} assistantStarter::Bool=false) where {T<:AbstractString}
formattedtext = formattedtext =
if name == "system" if name == "system"
""" """
@@ -68,28 +69,10 @@ function formatLLMtext_llama3instruct(name::T, text::T;
return formattedtext return formattedtext
end end
# function formatLLMtext_llama3instruct(name::T, text::T) where {T<:AbstractString}
# formattedtext =
# if name == "system"
# """
# <|begin_of_text|>
# <|start_header_id|>$name<|end_header_id|>
# $text
# <|eot_id|>
# """
# else
# """
# <|start_header_id|>$name<|end_header_id|>
# $text
# <|eot_id|>
# """
# end
# return formattedtext
# end
function formatLLMtext_qwen(name::T, text::T; function formatLLMtext_qwen(name::T, text::T;
assistantStarter::Bool=true) where {T<:AbstractString} assistantStarter::Bool=false) where {T<:AbstractString}
formattedtext = formattedtext =
if name == "system" if name == "system"
""" """
@@ -116,14 +99,94 @@ function formatLLMtext_qwen(name::T, text::T;
end end
""" Convert a chat messages in vector of dictionary into LLM model instruct format. function formatLLMtext_qwen3(name::T, text::T;
assistantStarter::Bool=false) where {T<:AbstractString}
formattedtext =
if name == "system"
"""
<|im_start|>$name
$text
<|im_end|>
"""
else
"""
<|im_start|>$name
$text
<|im_end|>
"""
end
if assistantStarter
formattedtext *=
"""
<|im_start|>assistant
"""
end
return formattedtext
end
function formatLLMtext_phi4(name::T, text::T;
assistantStarter::Bool=false) where {T<:AbstractString}
formattedtext =
if name == "system"
"""
<|system|>
$text
<|end|>
"""
else
"""
<|assistant|>
$text
<|end|>
"""
end
if assistantStarter
formattedtext *=
"""
<|assistant|>
"""
end
return formattedtext
end
function formatLLMtext_granite3(name::T, text::T;
assistantStarter::Bool=false) where {T<:AbstractString}
formattedtext =
if name == "system"
"""
<|start_of_role|>system<|end_of_role|>{$text}<|end_of_text|>
"""
else
"""
<|start_of_role|>$name<|end_of_role|>{$text}<|end_of_text|>
"""
end
if assistantStarter
formattedtext *=
"""
<|start_of_role|>assistant<|end_of_role|>{
"""
end
return formattedtext
end
""" Convert a vector of chat message dictionaries into LLM model instruct format.
# Arguments # Arguments
- `messages::Vector{Dict{Symbol, T}}` - `messages::Vector{Dict{Symbol, T}}`
message owner name e.f. "system", "user" or "assistant" A vector of dictionaries where each dictionary contains the keys `:name` (the name of the message owner) and `:text` (the text of the message).
- `formatname::T` - `formatname::T`
format name to be used The name of the format to be used for converting the chat messages.
# Return # Return
- `formattedtext::String` - `formattedtext::String`
text formatted to model format text formatted to model format
@@ -140,31 +203,137 @@ julia> chatmessage = [
julia> formattedtext = YiemAgent.formatLLMtext(chatmessage, "llama3instruct") julia> formattedtext = YiemAgent.formatLLMtext(chatmessage, "llama3instruct")
"<|begin_of_text|>\n <|start_header_id|>system<|end_header_id|>\n You are a helpful, respectful and honest assistant.\n <|eot_id|>\n <|start_header_id|>user<|end_header_id|>\n list me all planets in our solar system.\n <|eot_id|>\n <|start_header_id|>assistant<|end_header_id|>\n I'm sorry. I don't know. You tell me.\n <|eot_id|>\n" "<|begin_of_text|>\n <|start_header_id|>system<|end_header_id|>\n You are a helpful, respectful and honest assistant.\n <|eot_id|>\n <|start_header_id|>user<|end_header_id|>\n list me all planets in our solar system.\n <|eot_id|>\n <|start_header_id|>assistant<|end_header_id|>\n I'm sorry. I don't know. You tell me.\n <|eot_id|>\n"
``` ```
# Signature
""" """
function formatLLMtext(messages::Vector{Dict{Symbol, T}}; formatname::String="llama3instruct" function formatLLMtext(messages::Vector{Dict{Symbol, T}}, formatname::String
)::String where {T<:Any} )::String where {T<:AbstractString}
f = if formatname == "llama3instruct" f =
formatLLMtext_llama3instruct if formatname == "llama3instruct"
elseif formatname == "mistral" formatLLMtext_llama3instruct
# not define yet elseif formatname == "mistral"
elseif formatname == "phi3instruct" # not define yet
# not define yet elseif formatname == "phi3instruct"
elseif formatname == "qwen" # not define yet
formatLLMtext_qwen elseif formatname == "qwen"
else formatLLMtext_qwen
error("$formatname template not define yet") elseif formatname == "qwen3"
end formatLLMtext_qwen3
elseif formatname == "phi4"
formatLLMtext_phi4
elseif formatname == "granite3"
formatLLMtext_granite3
else
error("$formatname template not define yet")
end
str = "" str = ""
for t in messages for (i, t) in enumerate(messages)
str *= f(t[:name], t[:text]) if i < length(messages)
str *= f(t[:name], t[:text])
else
str *= f(t[:name], t[:text]; assistantStarter=true)
end
end end
return str return str
end end
""" Revert LLM-format response back into regular text.
# Arguments
- `text::String`
The LLM formatted string to be converted.
# Return
- `normalText::String`
The original plain text extracted from the given LLM-formatted string.
# Example
```jldoctest
julia> using Revise
julia> using YiemAgent
julia> response = "<|begin_of_text|>This is a sample system instruction.<|eot_id|>"
julia> normalText = YiemAgent.deFormatLLMtext(response, "granite3")
"This is a sample system instruction."
```
"""
function deFormatLLMtext(text::String, formatname::String; includethink::Bool=false
)::String
f =
if formatname == "granite3"
deFormatLLMtext_granite3
elseif formatname == "qwen3"
deFormatLLMtext_qwen3
else
error("$formatname template not define yet")
end
r = f(text)
result = r === nothing ? text : r
return result
end
""" Revert LLM-format response back into regular text for Granite 3 format.
# Arguments
- `text::String`
The LLM formatted string to be converted.
# Return
- `normalText::Union{Nothing, String}`
The original plain text extracted from the given LLM-formatted string.
Returns nothing if the text is not in Granite 3 format.
# Example
```jldoctest
julia> using Revise
julia> using YiemAgent
julia> response = "{This is a sample LLM response.}"
julia> normalText = YiemAgent.deFormatLLMtext(response, "granite3")
"This is a sample LLM response."
"""
function deFormatLLMtext_granite3(text::String)::Union{Nothing, String}
# check if '{' and '}' are in the text because it's a special format for the LLM response
if contains(text, "<|im_start|>assistant")
# get the text between '{' and '}'
text_between_braces = GeneralUtils.extractTextBetweenCharacter(text, '{', '}')[1]
return text_between_braces
elseif text[end] == '}'
text = "{$text"
text_between_braces = GeneralUtils.extractTextBetweenCharacter(text, '{', '}')[1]
else
return nothing
end
end
function deFormatLLMtext_qwen3(text::String)::Union{Nothing, String}
return text
end
# function deFormatLLMtext_qwen3(text::String; includethink::Bool=false)::Union{Nothing, String}
# think = nothing
# str = nothing
# if occursin("<think>", text)
# r = GeneralUtils.extractTextBetweenString(text, "<think>", "</think>")
# if r[:success]
# think = r[:text]
# end
# str = string(split(text, "</think>")[2])
# end
# if includethink == true && occursin("<think>", text)
# result = "ModelThought: $think $str"
# return result
# elseif includethink == false && occursin("<think>", text)
# result = str
# return result
# else
# return text
# end
# end
""" Attemp to correct LLM response's incorrect JSON response. """ Attemp to correct LLM response's incorrect JSON response.
@@ -255,9 +424,130 @@ function jsoncorrection(config::T1, input::T2, correctJsonExample::T3;
end end
function extractthink(text::String)
think = nothing
str = nothing
if occursin("<think>", text)
r = GeneralUtils.extractTextBetweenString(text, "<think>", "</think>")
if r[:success]
think = r[:text]
end
str = string(split(text, "</think>")[2])
else
str = text
end
return think, str
end
""" Validate that an agent's JSON response contains all required keys and no extra keys.
The function checks if `responsedict` contains exactly the keys specified in `requiredKeys`
with no duplicates and no missing keys. It is designed to validate structured agent responses
against an expected schema.
# Arguments
- `responsedict::Dict`
A dictionary containing the agent's JSON response. Must be a plain `Dict` or
dictionary-like object with String keys.
- `requiredKeys::T` where `T<:Array{String}`
An array of required key names that must be present in `responsedict`.
# Return
- `Tuple{Bool, Union{String, Nothing}}`
A tuple where the first element indicates whether validation passed (`true`) or failed (`false`),
and the second element contains an error message if validation failed, or `nothing` if it passed.
# Details
The validation logic checks:
1. **Duplicate keys**: If `responsedict` contains more keys than `requiredKeys`, validation fails
because the agent included extra/unexpected keys.
2. **Missing keys**: If any key in `requiredKeys` is absent from `responsedict`, validation fails
and the specific missing keys are listed in the error message.
3. **Valid response**: If all required keys are present and no extra keys exist, validation passes.
# Example
```julia
julia> using YiemAgent
julia> requiredKeys = ["wine_name", "price", "rating"]
julia> response = Dict("wine_name"=>"Château Margaux", "price"=>250.0, "rating"=>98)
julia> YiemAgent.checkAgentResponse_JSON(response, requiredKeys)
(true, nothing)
julia> response_missing = Dict("wine_name"=>"Château Margaux", "price"=>250.0)
julia> YiemAgent.checkAgentResponse_JSON(response_missing, requiredKeys)
(false, "rating are missing from your previous response")
julia> response_extra = Dict("wine_name"=>"Château Margaux", "price"=>250.0, "rating"=>98, "extra_field"=>"data")
julia> YiemAgent.checkAgentResponse_JSON(response_extra, requiredKeys)
(false, "Your previous attempt has duplicated points according to the required response format")
```
"""
function checkAgentResponse_JSON(responsedict::T1, requiredKeys::T2
)::Tuple where {T1<:AbstractDict, T2<:Array{String}}
_responsedictKey = keys(responsedict)
responsedictKey = [i for i in _responsedictKey] # convert into a list
is_requiredKeys_in_responsedictKey = [i responsedictKey for i in requiredKeys]
ispass = false
errormsg = nothing
if length(is_requiredKeys_in_responsedictKey) > length(requiredKeys)
errormsg = "Your previous attempt has duplicated points according to the required response format"
ispass = false
elseif !all(is_requiredKeys_in_responsedictKey)
zeroind = findall(x -> x == 0, is_requiredKeys_in_responsedictKey)
missingkeys = [requiredKeys[i] for i in zeroind]
errormsg = "$missingkeys are missing from your previous response"
ispass = false
else
ispass = true
end
return (ispass, errormsg)
end
""" Convert a plain text string containing key-value pairs into a JSON-formatted string.
This function takes text containing key-value pairs (typically extracted from LLM responses)
and wraps them in proper JSON braces to create a valid JSON string. It cleans the input
by removing common formatting artifacts like braces, code block markers, and language
specifiers before wrapping the content.
# Arguments
- `text::String`
A string containing key-value pairs, typically in the format `key: value, key: value`.
May contain leading/trailing braces, code block markers (```), or language specifiers
(e.g., `json`) that will be removed.
# Return
- `String`
A JSON-formatted string with the key-value pairs wrapped in `{}` braces.
# Notes
- The function removes `{`, `}`, `````, and `json` from the input before wrapping.
- The output is always wrapped in curly braces to create valid JSON structure.
- This is typically used to sanitize LLM responses that contain key-value data
but may include formatting artifacts.
# Examples
```jldoctest
julia> text = "thought: Hello, action: CHATBOX, input: How can I help?"
julia> clean_json_response(text)
"{thought: Hello, action: CHATBOX, input: How can I help?}"
julia> text = "{thought: Hello, action: CHATBOX}"
julia> clean_json_response(text)
"{thought: Hello, action: CHATBOX}"
julia> text = "```json{thought: Hello, action: CHATBOX}```"
julia> clean_json_response(text)
"{thought: Hello, action: CHATBOX}"
```
"""
function clean_json_response(text::String)
removelist = ["{", "}", "```", "json", "\n"]
return '{' * removestring(text, removelist) * '}'
end
+319 -227
View File
@@ -1,47 +1,52 @@
module util module util
export timedifference, showstracktrace, findHighestIndexKey, uuid4snakecase, replaceDictKeys, export timedifference, showstracktrace, findHighestIndexKey, uuid4snakecase, replaceDictKeys,
findMatchingDictKey, textToDict, randstring, randstrings, timeout, findMatchingDictKey, randstring, randstrings, timeout,
dataframeToCSV, dfToVectorDict, disintegrate_vectorDict, getDataFrameValue, dfRowtoString, dataframeToCSV, dfToVectorDict, disintegrate_vectorDict, getDataFrameValue, dfRowtoString,
dfToString, dataframe_to_json_list, dictToString, dictToString_noKey, dfToString, dataframe_to_json_list, dictToString, dictToString_noKey, issomething,
dictToString_numbering, extract_triple_backtick_text, dictToString_numbering, extract_triple_backtick_text,
countGivenWords, remove_french_accents, detect_keyword, extractTextBetweenCharacter, countGivenWords, remove_french_accents, removestring,
convertCamelSnakeKebabCase extractTextBetweenCharacter, extractTextBetweenString,
convertCamelSnakeKebabCase, fitrange, recentElementsIndex, nonRecentElementsIndex
using JSON3, DataStructures, Distributions, Random, Dates, UUIDs, MQTTClient, DataFrames using JSON, DataStructures, Distributions, Random, Dates, UUIDs, DataFrames
# ---------------------------------------------- 100 --------------------------------------------- # # ---------------------------------------------- 100 --------------------------------------------- #
""" Compute time different between start time and stop time in a given unit. """ Computes the time difference between two `DateTime` values and returns the
Unit can be "milliseconds", "seconds", "minutes", "hours". result in a specified unit: milliseconds, seconds, minutes, or hours.
# Arguments # Arguments
- `starttime::DateTime` - `starttime::DateTime`
start time The starting `DateTime` value.
- `stoptime::DateTime` - `stoptime::DateTime`
stop time The ending `DateTime` value.
- `unit::String` - `unit::String`
unit of time difference The unit for the result. Must be one of: `"milliseconds"`, `"seconds"`,
`"minutes"`, `"hours"`.
# Return # Return
- time difference in given unit - `Integer`: The time difference converted to the specified unit.
# Example # Notes
- The function computes `stoptime - starttime` and converts the result to the
requested unit using integer division.
- Errors with `ArgumentError` if an invalid unit is specified.
# Examples
```jldoctest ```jldoctest
julia> using Revise
julia> using GeneralUtils, Dates julia> using GeneralUtils, Dates
julia> a = Dates.now() julia> a = Dates.now()
julia> b = a + Dates.Day(5) # add 5 days julia> b = a + Dates.Day(5)
julia> GeneralUtils.timedifference(a, b, "hours") julia> timedifference(a, b, "hours")
120 120
``` ```
# Signature
""" """
function timedifference(starttime::DateTime, stoptime::DateTime, unit::String)::Integer function timedifference(starttime::DateTime, stoptime::DateTime, unit::String)::Integer
diff = stoptime - starttime diff = stoptime - starttime
unit = lowercase(unit) unit = lowercase(unit)
# Check the unit and calculate the time difference accordingly
if unit == "milliseconds" if unit == "milliseconds"
return diff.value return diff.value
elseif unit == "seconds" elseif unit == "seconds"
@@ -182,21 +187,27 @@ end
""" Get uuid4 with snake case """ Generates a UUID4 (version 4) identifier and converts it to snake case by
replacing hyphens with underscores.
# Arguments
- This function takes no arguments.
# Return # Return
- `uuid4::String` - `String`: A UUID4 string with underscores instead of hyphens (e.g.,
uuid4 with snake case `"0f6e4f_568c_4df4_8c79_1d7a58072f4a"`).
# Example # Notes
- Uses the `uuid4()` function from the UUIDs standard library to generate a
random UUID.
- The underscore character replaces all hyphens in the UUID string.
# Examples
```jldoctest ```jldoctest
julia> using Revise
julia> using GeneralUtils julia> using GeneralUtils
julia> GeneralUtils.uuid4snakecase() julia> uuid4snakecase()
"0f6e4f_568c_4df4_8c79_1d7a58072f4a" "0f6e4f_568c_4df4_8c79_1d7a58072f4a"
``` ```
# Signature
""" """
function uuid4snakecase()::String function uuid4snakecase()::String
_id = string(uuid4()) _id = string(uuid4())
@@ -205,32 +216,37 @@ function uuid4snakecase()::String
end end
""" Replace a dictionary key with the new key """ Replaces keys in a dictionary according to a mapping, returning a new
dictionary with updated keys while preserving the original values.
# Arguments # Arguments
- `d::Dict` - `d::Dict`
The input dictionary that you want to modify The input dictionary to modify.
- `replacementMap::Dict` - `replacementMap::Dict`
A dictionary that maps old keys to new keys A dictionary mapping old keys to new keys. Keys not present in this map are
left unchanged.
# Return # Return
- `newDict::Dict` - `Dict`: A new dictionary with replaced keys. Values are preserved from the
new dictionary with the replaced keys original dictionary.
# Example # Notes
- The function creates a new dictionary rather than modifying the input in
place.
- Keys not found in `replacementMap` are copied to the result with their
original keys unchanged.
# Examples
```jldoctest ```jldoctest
julia> using Revise
julia> using GeneralUtils julia> using GeneralUtils
julia> d = Dict(:a => 1, :b => 2, :c => 3) julia> d = Dict(:a => 1, :b => 2, :c => 3)
julia> replacement_map = Dict(:a => :x, :b => :y) julia> replacement_map = Dict(:a => :x, :b => :y)
julia> new_dict = GeneralUtils.replaceDictKeys(d, replacement_map) julia> replaceDictKeys(d, replacement_map)
Dict{Any, Any} with 3 entries: Dict{Any, Any} with 3 entries:
:y => 2 :y => 2
:c => 3 :c => 3
:x => 1 :x => 1
``` ```
# Signature
""" """
function replaceDictKeys(d::Dict, replacementMap::Dict)::Dict function replaceDictKeys(d::Dict, replacementMap::Dict)::Dict
newDict = Dict() newDict = Dict()
@@ -242,101 +258,6 @@ function replaceDictKeys(d::Dict, replacementMap::Dict)::Dict
end end
""" Convert text into a dictionary with a given keywords. This function use keywords to slice
a given text into the following format: KW1|kw1_text|KW2|kw2_text|KW3|kw3_text.
The left most string which has no keyword will be discarded. WARNING, ordering is important
# Arguments
- `text::String`
A text to be converted.
- `keywords::Vector{String}`
A list of keywords to be used to slice the text.
These keywords also be the resulting dict keys.
# Keyword Arguments
- `rightmarker::String`
A maker used to make a word to be unique. Ex, A keyword "plan" with rightmarker ":",
the function will search for "plan:" otherwise the function will search for "plan".
The marker will not be in the resulting dict keys.
- `symbolkey::Bool`
If true, resulting dict's key will be Symbols, otherwise string.
- `lowercasekey::Bool`
set resulting dict's key to be lowercase
# Return
- `d::OrderedDict`
# Example
```jldoctest
julia> text = "TODAY thought: what to do plan: wake up and going out action: 1. wake up 2. eat 3. sleep"
julia> sample_keywords = ["thought", "plan", "action"]
julia> resultdict = GeneralUtils.textToDict(text, sample_keywords; rightmarker=":", symbolkey=true)
julia> println(resultdict)
OrderedCollections.OrderedDict{Any, Any}(:thought => "what to do",
:plan => "wake up and going out",
:action => "1. wake up 2. eat 3. sleep")
```
# Signature
"""
function textToDict(text::String, detectKeywords::Vector{String};
dictKey::Union{Vector{String}, Nothing}=nothing,
symbolkey::Bool=false, lowercasekey::Bool=false
)::OrderedDict
# make sure this function detect variation of a work e.g. agent, Agent, AGENT
kw = []
# use for loop and detect_keyword function to get the exact variation of each keyword in the text then push to kw list
for keyword in detectKeywords
detected = detect_keyword(keyword, text)
if detected !== nothing
push!(kw, detected)
else
error("Keyword $keyword not found in text.")
end
end
od1, od2 =
if symbolkey
OrderedDict{Symbol, Any}(), OrderedDict{Symbol, Any}()
else
OrderedDict{String, Any}(), OrderedDict{String, Any}()
end
remainingtext = text
dictKey_ = reverse(dictKey)
# process text from back to front
for (i,keyword) in enumerate(reverse(kw))
# Find the position of the keyword in the text
keywordidx = findlast(keyword, remainingtext)
dKey = dictKey_[i]
if keywordidx !== nothing
substr = remainingtext[keywordidx[end]+1:end]
str = string(strip(substr)) # Removes both leading and trailing whitespace.
_key = lowercasekey == true ? lowercase(dKey) : dKey
key = symbolkey == true ? Symbol(_key) : _key
od1[key] = str
remainingtext = remainingtext[1:keywordidx[1]-1]
else
error("""keyword "$keyword" not found in the provided text: $text </end of error note>""")
end
end
# correct the order
ks = reverse([i for i in keys(od1)])
for k in ks
k = symbolkey == true ? Symbol(k) : k
od2[k] = od1[k]
end
return od2
end
""" Generate a random string """ Generate a random string
# Arguments # Arguments
@@ -387,36 +308,43 @@ end
""" Execute a function with timer. """ Executes a function with a timeout mechanism. If the function does not
complete within the specified time, it is interrupted and a timeout message
is returned.
# Arguments # Arguments
- `f::Function` - `f::Function`
a function to run The function to execute.
- `timeoutwindow::Integer`` - `timeoutwindow::Integer`
timeout in seconds The timeout duration in seconds.
# Keyword Argument # Keyword Arguments
- `fargs` - `fargs`
arguments for the function Arguments to pass to the function `f`. If `nothing`, the function is called
- `timeoutmsg::String` without arguments.
time out message - `timeoutmsg::String`
The message to return if the function times out. Defaults to `"task timed out"`.
# Return # Return
- task result otherwise timeout message - The result of the function if it completes within the timeout, otherwise the
`timeoutmsg` string.
# Example # Notes
```jldoctest - Uses Julia's `@task`, `schedule`, and `Timer` to implement non-blocking
execution with interruption via `Base.throwto`.
- Errors with `InterruptException` if the function exceeds the timeout.
# Examples
```jldoctest
julia> function testfunc(x) julia> function testfunc(x)
sleep(x) sleep(x)
return "task done" return "task done"
end end
julia> result = timeout(testfunc, 10; fargs=20) julia> result = timeout(testfunc, 10; fargs=20)
"task timed out" "task timed out"
julia> result = timeout(testfunc, 20; fargs=10) julia> result = timeout(testfunc, 20; fargs=10)
"task done" "task done"
``` ```
# Signature
""" """
function timeout(f::Function, timeoutwindow::Integer; fargs=nothing, timeoutmsg="task timed out") function timeout(f::Function, timeoutwindow::Integer; fargs=nothing, timeoutmsg="task timed out")
tsk = @task f(fargs) tsk = @task f(fargs)
@@ -433,23 +361,26 @@ end
""" Convert a dataframe into CSV. """ Converts a DataFrame to a CSV string representation using the CSV.jl package.
# Arguments # Arguments
- `df::DataFrame` - `df::DataFrame`
A connection object to Postgres database The DataFrame to convert to CSV format.
# Return # Return
- `result::String` - `String`: The DataFrame contents as a CSV-formatted string.
# Example # Notes
- Uses `CSV.write` with an `IOBuffer` to capture the output as a string.
- The returned string contains the full CSV representation including headers.
# Examples
```jldoctest ```jldoctest
julia> using DataFrames, GeneralUtils julia> using DataFrames, GeneralUtils
julia> df = DataFrame(A=1:3, B=5:7, fixed=1) julia> df = DataFrame(A=1:3, B=5:7, fixed=1)
julia> result = GeneralUtils.dataframeToCSV(df) julia> dataframeToCSV(df)
"1,5,1\n2,6,1\n3,7,1\n"
``` ```
# Signature
""" """
function dataframeToCSV(df::DataFrame) function dataframeToCSV(df::DataFrame)
# Create an IOBuffer to capture the output # Create an IOBuffer to capture the output
@@ -471,7 +402,7 @@ end
# Example # Example
```jldoctest ```jldoctest
julia> using DataFrames, JSON3, GeneralUtils julia> using DataFrames, GeneralUtils
julia> df = DataFrame(A = [1, 2, 3], B = ["apple", "banana", "cherry"]) julia> df = DataFrame(A = [1, 2, 3], B = ["apple", "banana", "cherry"])
julia> vectorDict = GeneralUtils.dfToVectorDict(df) julia> vectorDict = GeneralUtils.dfToVectorDict(df)
[Dict{String, Any}("B" => "apple", "A" => 1), [Dict{String, Any}("B" => "apple", "A" => 1),
@@ -509,7 +440,7 @@ end
# Example # Example
```jldoctest ```jldoctest
julia> using GeneralUtils, Dates, JSON3, UUIDs julia> using GeneralUtils, Dates, UUIDs
julia> vecDict = [Dict("a" => i) for i in 1:10] julia> vecDict = [Dict("a" => i) for i in 1:10]
julia> d = GeneralUtils.disintegrate_vectorDict(vecDict, 3) julia> d = GeneralUtils.disintegrate_vectorDict(vecDict, 3)
julia> println(d[:data]) julia> println(d[:data])
@@ -519,8 +450,6 @@ end
3 => [Dict("a"=>7), Dict("a"=>8), Dict("a"=>9)] 3 => [Dict("a"=>7), Dict("a"=>8), Dict("a"=>9)]
4 => [Dict("a"=>10)] 4 => [Dict("a"=>10)]
``` ```
# Signature
""" """
function disintegrate_vectorDict(data::Vector, partsize::Integer function disintegrate_vectorDict(data::Vector, partsize::Integer
) )
@@ -566,8 +495,6 @@ end
julia> getDataFrameValue(df[1, :], :name) julia> getDataFrameValue(df[1, :], :name)
"Alice" "Alice"
``` ```
# Signature
""" """
getDataFrameValue(row::DataFrameRow, key::Symbol) = row.:($key) getDataFrameValue(row::DataFrameRow, key::Symbol) = row.:($key)
@@ -636,8 +563,6 @@ end
julia> dfToString(df) julia> dfToString(df)
"1) name: Alice, age: 25\n2) name: Bob, age: 30" "1) name: Alice, age: 25\n2) name: Bob, age: 30"
``` ```
# Signature
""" """
function dfToString(df::DataFrame) function dfToString(df::DataFrame)
dfstr = "" dfstr = ""
@@ -661,7 +586,7 @@ end
# Example # Example
```jldoctest ```jldoctest
julia> using DataFrames julia> using DataFrames, GeneralUtils
julia> df = DataFrame(name=["Alice", "Bob"], age=[25, 30]) julia> df = DataFrame(name=["Alice", "Bob"], age=[25, 30])
2×2 DataFrame 2×2 DataFrame
@@ -671,13 +596,11 @@ end
│ 1 │ Alice 25 │ 1 │ Alice 25
│ 2 │ Bob 30 │ 2 │ Bob 30
julia> dataframe_to_json_list(df) julia> GeneralUtils.dataframe_to_json_list(df)
2-element Vector{String}: 2-element Vector{String}:
"{\"name\":\"Alice\",\"age\":25}" "{\"name\":\"Alice\",\"age\":25}"
"{\"name\":\"Bob\",\"age\":30}" "{\"name\":\"Bob\",\"age\":30}"
``` ```
# Signature
""" """
function dataframe_to_json_list(df::DataFrame)::Vector{String} function dataframe_to_json_list(df::DataFrame)::Vector{String}
json_list = [] json_list = []
@@ -711,8 +634,6 @@ end
julia> dict_to_string(od) julia> dict_to_string(od)
"1) name: Alice, 2) age: 25" "1) name: Alice, 2) age: 25"
``` ```
# Signature
""" """
function dictToString(od::T) where {T<:AbstractDict} function dictToString(od::T) where {T<:AbstractDict}
items = [] items = []
@@ -770,48 +691,19 @@ function extract_triple_backtick_text(input::String)::Vector{String}
end end
""" wordwindow(word::String, startindex::Integer)::UnitRange = startindex:startindex + length(word) -1
detect_keyword(keyword::String, text::String) -> Union{Nothing, String}
Detects if a keyword exists in the text in different case variations (lowercase, uppercase first letter, or all uppercase). function cuttext(range, text)
# check whether range is outside text boundary
# Arguments: if range.start > length(text) || range.stop > length(text)
- `keyword::String` The keyword to search for return nothing
- `text::String` The text to search in else
return text[range]
# Returns:
- `Union{Nothing, String}` Returns the matched keyword variation if found, otherwise returns nothing
# Examples:
```jldoctest
julia> detect_keyword("test", "This is a Test case")
"Test"
julia> detect_keyword("error", "NO ERRORS FOUND")
"ERRORS"
julia> detect_keyword("missing", "complete data")
nothing
```
# Signature
"""
function detect_keyword(keyword::String, text::String)::Union{Nothing, String}
# Define the keyword variations to search for
keyword_variations = [keyword, uppercasefirst(keyword), uppercase(keyword), lowercase(keyword)]
# Check if any of the keyword variations are in the text
for variation in keyword_variations
if occursin(variation, text)
return variation
end
end end
# Return nothing if no variation is found
return nothing
end end
""" """
countGivenWords(text::String, words::Vector{String}) -> Dict{String, Int} countGivenWords(text::String, words::Vector{String}) -> Dict{String, Int}
@@ -855,27 +747,39 @@ end
""" """ Remove French accents from the given text.
remove_french_accents(text::String) -> String
Remove French accents from the given text. The function replaces accented French characters with their non-accented
counterparts using a dictionary mapping. Supported accented characters
include: à, â, ä, á, é, è, ê, ë, î, ï, í, ñ, ô, ö, ò, ó, ù, û, ü, ÿ, ç,
and their uppercase variants. The apostrophe character `` is removed
completely.
# Arguments # Arguments
- `text::String` The input string containing French accents. - `text::AbstractString`
The input string containing French accented characters.
# Returns # Return
- `String` The input string with all French accents removed. - `AbstractString`: A new string with all French accents replaced by their
non-accented equivalents.
# Notes
- The function creates a character list and replaces each accented character
according to an internal dictionary mapping.
- Does **not** mutate the input; it allocates a new string.
# Examples # Examples
```jldoctest ```jldoctest
julia> remove_french_accents("Café") julia> using GeneralUtils
"Cafe" julia> remove_french_accents("Café")
"Cafe"
julia> remove_french_accents("L'été est beau.") julia> remove_french_accents("L'été est beau.")
"L'ete est beau." "L'ete est beau."
```
# Signature julia> remove_french_accents("Noël, naïve, François")
"Noel, naive, Francois"
```
""" """
function remove_french_accents(text::AbstractString)::AbstractString function remove_french_accents(text::AbstractString)::AbstractString
textcharlist = [i for i in text] textcharlist = [i for i in text]
@@ -924,9 +828,11 @@ Extracts and returns the text that is enclosed between two specified characters
# Examples # Examples
```jldoctest ```jldoctest
julia> text = "Hello [World]!" julia> text = "Hello [World]! [Yay]"
julia> extracted_text = extractTextBetweenCharacter(text, '[', ']') julia> extracted_text = extractTextBetweenCharacter(text, '[', ']')
println(extracted_text) # Output: "World" 2-element Vector{Any}:
"World"
"Yay"
``` ```
""" """
function extractTextBetweenCharacter(text::String, startchar::Char, endchar::Char) function extractTextBetweenCharacter(text::String, startchar::Char, endchar::Char)
@@ -950,6 +856,29 @@ function extractTextBetweenCharacter(text::String, startchar::Char, endchar::Cha
end end
function extractTextBetweenString(text::String, startstr::String, endstr::String)
# check whether startstr is in the text or not
isStartStr = split(text, startstr)
if length(isStartStr) > 2
return (success=false, error="There are more than one occurrences of the start string '$startstr' in the text. Text must has only one start string", errorcode=2, result=nothing)
elseif length(isStartStr) == 1
return (success=false, error="There are no start string '$startstr' in the text. Text must has only one start string", errorcode=1, result=nothing)
end
# check whether endstr is in the text or not
isEndStr = split(text, endstr)
if length(isEndStr) > 2
return (success=false, error="There are more than one occurrences of the end string '$endstr' in the text. Text must has only one end string", errorcode=3, result=nothing)
elseif length(isStartStr) == 1
return (success=false, error="There are no end string '$endstr' in the text. Text must has only one end string", errorcode=4, result=nothing)
end
s = string(split(isStartStr[2], endstr)[1])
return (success=true, error=nothing, errorcode=0, text=s)
end
""" """
Determines if the given string follows camel case naming convention. Determines if the given string follows camel case naming convention.
@@ -1075,10 +1004,173 @@ function convertCamelSnakeKebabCase(text::T, tocase::Symbol)::String where {T<:A
end end
""" Check if a value is not `nothing`.
# Arguments
- `x`: The value to check
# Returns
- `Bool`: `true` if `x` is not `nothing`, `false` otherwise
# Examples
```jldoctest
julia> issomething(1)
true
julia> issomething(nothing)
false
julia> issomething("test")
true
````
"""
function issomething(x)
return x === nothing ? false : true
end
""" Adjust a given range to fit within the bounds of a vector's length.
# Arguments
- `v::T1`
the input vector to check against
- `range::UnitRange`
the original range to be adjusted
# Return
- `adjusted_range::UnitRange`
a range that is constrained to the vector's length, preventing out-of-bounds indexing
# Example
julia> v = [1, 2, 3, 4, 5]
julia> fitrange(v, 3:10)
3:5
"""
function fitrange(v::T1, range::UnitRange) where {T1<:AbstractVector}
totalelements = length(v)
startind =
# check if user put start range greater than total event
if range.start > totalelements
totalelements
else
range.start
end
stopind =
if range.stop > totalelements
totalelements
else
range.stop
end
return startind:stopind
end
""" Find a unit range for a vector given a number of the most recent elements of interest.
# Arguments
- `vectorLength::Integer`
the length of the vector to generate range from
- `n::Integer`
the number of most recent elements to include in range
# Return
- `UnitRange`
a range representing the n most recent elements of a vector with length vectorLength
# Example
```jldoctest
julia> a = [1, 2, 3, 4, 5]
julia> recentElementsIndex(length(a), 3)
3:5
julia> recentElementsIndex(length(a), 0)
5:5
```
"""
function recentElementsIndex(vectorlength::Integer, n::Integer; includelatest::Bool=false)
if n == 0
error("n must be greater than 0")
end
if includelatest
start = max(1, vectorlength - n + 1)
return start:vectorlength
else
startind = max(1, vectorlength - n)
endind = vectorlength -1
return startind:endind
end
end
""" Find a unit range for a vector excluding the most recent elements.
# Arguments
- `vectorlength::Integer`
the length of the vector to generate range from
- `n::Integer`
the number of most recent elements to exclude from range
# Return
- `UnitRange`
a range representing the elements of the vector excluding the last `n` elements
# Example
```jldoctest
julia> a = [1, 2, 3, 4, 5]
julia> nonRecentElementsIndex(length(a), 3)
1:2
julia> nonRecentElementsIndex(length(a), 1)
1:4
julia> nonRecentElementsIndex(length(a), 0)
1:5
```
"""
function nonRecentElementsIndex(vectorlength::Integer, n::Integer)
if n < 0
error("n must be non-negative")
end
if n > vectorlength
return 1:0 # empty range
end
return 1:(vectorlength-n)
end
""" Remove specified substrings from text.
Removes all occurrences of each string in `removelist` from the input text
by repeatedly replacing them with empty strings until none remain.
# Arguments
- `text::String`
The input string to modify.
- `removelist::Vector{String}`
A vector of substrings to remove from the text.
# Return
- `String`: The text with all specified substrings removed.
# Examples
```jldoctest
julia> using GeneralUtils
julia> removestring("hello world", ["l", " "])
"heoword"
julia> removestring("foo bar baz", ["bar", " "])
"foobaz"
```
"""
function removestring(text::String, removelist::Vector{String})::String
for i in removelist
while occursin(i, text)
text = replace(text, i => "")
end
end
return string(text)
end
+3
View File
@@ -0,0 +1,3 @@
{
"julia.environmentPath": "/appfolder/app/dev/GeneralUtils/test"
}
+41
View File
@@ -0,0 +1,41 @@
# This file is machine-generated - editing it directly is not advised
julia_version = "1.11.4"
manifest_format = "2.0"
project_hash = "71d91126b5a1fb1020e1098d9d492de2a4438fd2"
[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
version = "1.11.0"
[[deps.InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
version = "1.11.0"
[[deps.Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
version = "1.11.0"
[[deps.Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
version = "1.11.0"
[[deps.Random]]
deps = ["SHA"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
version = "1.11.0"
[[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"
[[deps.Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
version = "1.11.0"
[[deps.Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
version = "1.11.0"
+2
View File
@@ -0,0 +1,2 @@
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
View File
-44
View File
@@ -1,44 +0,0 @@
using Revise
using GeneralUtils, MQTTClient, JSON3
mqttMsgReceiveTopic = ["/receivetopic_1", "/receivetopic_2"]
mqttMsgReceiveChannel = (ch1=Channel(8), ch2=Channel(32))
keepaliveChannel = Channel(8)
function onMsgCallback(topic, payload)
jobj = JSON3.read(String(payload))
incomingMqttMsg = copy(jobj) # convert json object into julia dictionary recursively
if occursin("topic_1", topic)
put!(mqttMsgReceiveChannel[:ch1], incomingMqttMsg)
elseif occursin("topic_2", topic)
put!(mqttMsgReceiveChannel[:ch2], incomingMqttMsg)
elseif occursin("keepalive", topic)
put!(keepaliveChannel, incomingMqttMsg)
else
println("undefined condition ", @__FILE__, " ", @__LINE__)
end
end
mqttInstance = GeneralUtils.mqttClientInstance_v2(
"mqtt.yiem.cc",
mqttMsgReceiveTopic,
mqttMsgReceiveChannel,
keepaliveChannel,
onMsgCallback
)
_ = GeneralUtils.checkMqttConnection!(mqttInstance)
println("GeneralUtils test done")
+39
View File
@@ -0,0 +1,39 @@
using Test
using GeneralUtils: detect_keyword
@testset "detect_keyword tests" begin
@test detect_keyword(["test"], "this is a test") == Dict("test" => 1)
@test detect_keyword(["hello", "world"], "hello world hello") == Dict("hello" => 2, "world" => 1)
@test detect_keyword(["cat"], "category") == Dict("cat" => 1)
@test detect_keyword(["cat"], "category"; mode="individual") == Dict("cat" => 0)
@test detect_keyword(["dog"], "dogs and cats"; mode="individual", delimiter=[' ']) == Dict("dog" => 0)
@test detect_keyword(["test"], "test.case"; mode="individual", delimiter=['.']) == Dict("test" => 1)
@test detect_keyword(["word"], "") == Dict("word" => 0)
@test detect_keyword(String[], "some text") == Dict{String, Integer}()
@test detect_keyword(["a", "b"], "a.b\nc"; delimiter=['.', '\n']) == Dict("a" => 1, "b" => 1)
multiline_text = """
first line
second line
first word
"""
@test detect_keyword(["first"], multiline_text) == Dict("first" => 2)
@test detect_keyword(["word"], "word"; mode="individual") == Dict("word" => 1)
@test detect_keyword(["test"], "testing.test.tester"; mode="individual", delimiter=['.']) == Dict("test" => 1)
end