update
This commit is contained in:
+16
-8
@@ -1,6 +1,6 @@
|
||||
module type
|
||||
|
||||
export agent, sommelier, companion, virtualcustomer
|
||||
export agent, sommelier, companion, virtualcustomer, appcontext
|
||||
|
||||
using Dates, UUIDs, DataStructures, JSON3, NATS
|
||||
using GeneralUtils
|
||||
@@ -8,9 +8,17 @@ using GeneralUtils
|
||||
# ---------------------------------------------- 100 --------------------------------------------- #
|
||||
|
||||
#[WORKING]
|
||||
# struct appcontext
|
||||
# connection::
|
||||
# end
|
||||
mutable struct appcontext
|
||||
const connection::NATS.Connection
|
||||
const text2textInstructLLMServiceSubject::String
|
||||
getTextEmbedding::Function
|
||||
text2textInstructLLM::Function
|
||||
executeSQL::Function
|
||||
similarSQLVectorDB::Function
|
||||
insertSQLVectorDB::Function
|
||||
similarSommelierDecision::Function
|
||||
insertSommelierDecision::Function
|
||||
end
|
||||
|
||||
abstract type agent end
|
||||
|
||||
@@ -27,7 +35,7 @@ mutable struct companion <: agent
|
||||
end
|
||||
|
||||
function companion(
|
||||
func::NamedTuple # NamedTuple of functions
|
||||
context::appcontext # NamedTuple of functions
|
||||
;
|
||||
name::String= "Assistant",
|
||||
id::String= GeneralUtils.uuid4snakecase(),
|
||||
@@ -75,7 +83,7 @@ function companion(
|
||||
maxHistoryMsg,
|
||||
chathistory,
|
||||
memory,
|
||||
func,
|
||||
context,
|
||||
llmFormatName
|
||||
)
|
||||
|
||||
@@ -165,7 +173,7 @@ mutable struct sommelier <: agent
|
||||
end
|
||||
|
||||
function sommelier(
|
||||
func, # NamedTuple of functions
|
||||
context::appcontext, # NamedTuple of functions
|
||||
;
|
||||
name::String= "Assistant",
|
||||
id::String= string(uuid4()),
|
||||
@@ -216,7 +224,7 @@ function sommelier(
|
||||
maxHistoryMsg,
|
||||
chathistory,
|
||||
memory,
|
||||
func,
|
||||
context,
|
||||
llmFormatName
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user