This commit is contained in:
2024-05-01 13:15:48 +07:00
parent 513f159be1
commit fba99ab695
3 changed files with 54 additions and 34 deletions

View File

@@ -53,22 +53,30 @@ end
a game state
# Return
- `thought::Dict`
- `thoughtDict::Dict`
# Example
```jldoctest
julia>
julia> output_thoughtDict = Dict(
:Thought_1 => "The customer wants to buy a bottle of wine. This is a good start!",
:Action_1 => Dict{Symbol, Any}(
:action=>"Chatbox",
:input=>"What occasion are you buying the wine for?"
),
:Observation_1 => ""
)
```
# TODO
[] update docstring
[x] update docstring
[x] implement the function
[] implement RAG to pull similar experience
[] use iterative prompting to ensure JSON format
[] use customerinfo
[] user storeinfo
# Signature
"""
function decisionMaker(a::T1, state::T2)::String where {T1<:agent, T2<:AbstractDict}
function decisionMaker(a::T1, state::T2)::Dict{Symbol, Any} where {T1<:agent, T2<:AbstractDict}
customerinfo =
"""
I will give you the following information about customer:
@@ -161,8 +169,9 @@ function decisionMaker(a::T1, state::T2)::String where {T1<:agent, T2<:AbstractD
)
result = GeneralUtils.sendReceiveMqttMsg(outgoingMsg)
thought = result[:response][:text]
return thought
thoughtJsonStr = result[:response][:text]
thoughtDict = copy(JSON3.read(thoughtJsonStr))
return thoughtDict
end
@@ -365,12 +374,6 @@ end