update
This commit is contained in:
121
src/interface.jl
121
src/interface.jl
@@ -33,6 +33,122 @@ using ..type, ..util, ..llmfunction, ..mcts
|
||||
# ---------------------------------------------- 100 --------------------------------------------- #
|
||||
|
||||
|
||||
""" Think and choose action
|
||||
|
||||
Arguments\n
|
||||
-----
|
||||
state::T
|
||||
a game state
|
||||
|
||||
Return\n
|
||||
-----
|
||||
thought::Dict
|
||||
|
||||
Example\n
|
||||
-----
|
||||
```jldoctest
|
||||
julia>
|
||||
```
|
||||
|
||||
TODO\n
|
||||
-----
|
||||
[] update docstring
|
||||
[x] implement the function
|
||||
[] implement RAG to pull similar experience
|
||||
[] use iterative prompting to ensure JSON format
|
||||
|
||||
Signature\n
|
||||
-----
|
||||
"""
|
||||
function decisionMaker(state::T) where {T<:AbstractDict}
|
||||
customerinfo =
|
||||
"""
|
||||
I will give you the following information about customer:
|
||||
$(JSON3.write(state[:customerinfo]))
|
||||
"""
|
||||
|
||||
storeinfo =
|
||||
"""
|
||||
I will give you the following information about your store:
|
||||
$(JSON3.write(state[:storeinfo]))
|
||||
"""
|
||||
|
||||
#[x]
|
||||
prompt =
|
||||
"""
|
||||
You are a helpful sommelier working for a wine store.
|
||||
You helps users by searching wine that match the user preferences from your inventory.
|
||||
|
||||
$customerinfo
|
||||
|
||||
You must follow the
|
||||
"""
|
||||
|
||||
|
||||
|
||||
thought = iterativeprompting(prompt, syntaxcheck_json)
|
||||
|
||||
|
||||
error("--> decisionMaker")
|
||||
return thought
|
||||
end
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Arguments\n
|
||||
-----
|
||||
|
||||
Return\n
|
||||
-----
|
||||
|
||||
Example\n
|
||||
-----
|
||||
```jldoctest
|
||||
julia>
|
||||
```
|
||||
|
||||
TODO\n
|
||||
-----
|
||||
[] update docstring
|
||||
[] implement the function
|
||||
|
||||
Signature\n
|
||||
-----
|
||||
"""
|
||||
function stateValueEstimator()
|
||||
|
||||
end
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Arguments\n
|
||||
-----
|
||||
|
||||
Return\n
|
||||
-----
|
||||
|
||||
Example\n
|
||||
-----
|
||||
```jldoctest
|
||||
julia>
|
||||
```
|
||||
|
||||
TODO\n
|
||||
-----
|
||||
[] update docstring
|
||||
[] implement the function
|
||||
|
||||
Signature\n
|
||||
-----
|
||||
"""
|
||||
function reflector()
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
""" Chat with llm.
|
||||
|
||||
Arguments\n
|
||||
@@ -117,8 +233,8 @@ function conversation(a::T, userinput::Dict) where {T<:agent}
|
||||
:question=> userinput[:text],
|
||||
)
|
||||
)
|
||||
bestplan = runMCTS(initialState, decisionMaker, stateValueEstimator, reflector,
|
||||
3, 10, 1000, 1.0)
|
||||
bestplan = runMCTS(a, initialState, decisionMaker, stateValueEstimator, reflector,
|
||||
3, 10, 1000, 1.0)
|
||||
error("---> bestplan")
|
||||
|
||||
# actor loop(bestplan)
|
||||
@@ -178,6 +294,7 @@ end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end # module interface
|
||||
Reference in New Issue
Block a user