update
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module llmfunction
|
||||
|
||||
export virtualWineCustomerChatbox, jsoncorrection, winestock,
|
||||
virtualWineCustomerReccommendbox
|
||||
export virtualWineUserChatbox, jsoncorrection, winestock,
|
||||
virtualWineUserRecommendbox, userChatbox, userRecommendbox
|
||||
|
||||
using HTTP, JSON3, URIs, Random
|
||||
using GeneralUtils
|
||||
@@ -26,8 +26,46 @@ julia>
|
||||
|
||||
# Signature
|
||||
"""
|
||||
function chatbox(a::T1, input::T2) where {T1<:agent, T2<:AbstractString}
|
||||
error("--> chatbox")
|
||||
function userChatbox(a::T1, input::T2) where {T1<:agent, T2<:AbstractString}
|
||||
error("--> userChatbox")
|
||||
|
||||
# put in model format
|
||||
virtualWineCustomer = a.config[:externalservice][:virtualWineCustomer_1]
|
||||
llminfo = virtualWineCustomer[:llminfo]
|
||||
formattedinput =
|
||||
if llminfo[:name] == "llama3instruct"
|
||||
formatLLMtext_llama3instruct("assistant", input)
|
||||
else
|
||||
error("llm model name is not defied yet $(@__LINE__)")
|
||||
end
|
||||
|
||||
# send formatted input to user using GeneralUtils.sendReceiveMqttMsg
|
||||
|
||||
|
||||
# return response
|
||||
|
||||
end
|
||||
|
||||
|
||||
"""
|
||||
|
||||
# Arguments
|
||||
|
||||
# Return
|
||||
|
||||
# Example
|
||||
```jldoctest
|
||||
julia>
|
||||
```
|
||||
|
||||
# TODO
|
||||
- [] update docstring
|
||||
- [PENDING] implement the function
|
||||
|
||||
# Signature
|
||||
"""
|
||||
function userRecommendbox(a::T1, input::T2) where {T1<:agent, T2<:AbstractString}
|
||||
error("--> userRecommendbox")
|
||||
|
||||
# put in model format
|
||||
virtualWineCustomer = a.config[:externalservice][:virtualWineCustomer_1]
|
||||
@@ -69,7 +107,7 @@ julia>
|
||||
|
||||
# Signature
|
||||
"""
|
||||
function virtualWineCustomerReccommendbox(a::T1, input
|
||||
function virtualWineUserRecommendbox(a::T1, input
|
||||
)::Union{Tuple{String, Number, Number, Bool}, Tuple{String, Nothing, Number, Bool}} where {T1<:agent}
|
||||
|
||||
# put in model format
|
||||
@@ -85,7 +123,7 @@ function virtualWineCustomerReccommendbox(a::T1, input
|
||||
# send formatted input to user using GeneralUtils.sendReceiveMqttMsg
|
||||
msgMeta = GeneralUtils.generate_msgMeta(
|
||||
virtualWineCustomer[:mqtttopic],
|
||||
senderName= "virtualWineCustomerReccommendbox",
|
||||
senderName= "virtualWineUserRecommendbox",
|
||||
senderId= a.id,
|
||||
receiverName= "virtualWineCustomer",
|
||||
mqttBroker= a.config[:mqttServerInfo][:broker],
|
||||
@@ -125,12 +163,11 @@ julia>
|
||||
```
|
||||
|
||||
# TODO
|
||||
- [] update docs
|
||||
- [] add to remove <<< user option select >>> and <<| reward |>>
|
||||
- [] update docs
|
||||
|
||||
# Signature
|
||||
"""
|
||||
function virtualWineCustomerChatbox(a::T1, input::T2
|
||||
function virtualWineUserChatbox(a::T1, input::T2
|
||||
)::Union{Tuple{String, Number, Number, Bool}, Tuple{String, Nothing, Number, Bool}} where {T1<:agent, T2<:AbstractString}
|
||||
|
||||
# put in model format
|
||||
@@ -146,7 +183,7 @@ function virtualWineCustomerChatbox(a::T1, input::T2
|
||||
# send formatted input to user using GeneralUtils.sendReceiveMqttMsg
|
||||
msgMeta = GeneralUtils.generate_msgMeta(
|
||||
virtualWineCustomer[:mqtttopic],
|
||||
senderName= "virtualWineCustomerChatbox",
|
||||
senderName= "virtualWineUserChatbox",
|
||||
senderId= a.id,
|
||||
receiverName= "virtualWineCustomer",
|
||||
mqttBroker= a.config[:mqttServerInfo][:broker],
|
||||
@@ -178,7 +215,7 @@ function virtualWineCustomerChatbox(a::T1, input::T2
|
||||
println("")
|
||||
end
|
||||
end
|
||||
error("virtualWineCustomerChatbox failed to get a response")
|
||||
error("virtualWineUserChatbox failed to get a response")
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user