update
This commit is contained in:
52
src/type.jl
52
src/type.jl
@@ -1,6 +1,6 @@
|
||||
module type
|
||||
|
||||
export agent, sommelier, clearhistory
|
||||
export agent, sommelier
|
||||
|
||||
using Dates, UUIDs, DataStructures, JSON3
|
||||
using GeneralUtils
|
||||
@@ -165,56 +165,6 @@ function sommelier(
|
||||
return newAgent
|
||||
end
|
||||
|
||||
""" Clear agent chat history.
|
||||
|
||||
Arguments\n
|
||||
-----
|
||||
a::agent
|
||||
an agent
|
||||
|
||||
Return\n
|
||||
-----
|
||||
nothing
|
||||
|
||||
Example\n
|
||||
-----
|
||||
```jldoctest
|
||||
julia> using YiemAgent, MQTTClient, GeneralUtils
|
||||
julia> client, connection = MakeConnection("test.mosquitto.org", 1883)
|
||||
julia> connect(client, connection)
|
||||
julia> msgMeta = GeneralUtils.generate_msgMeta("testtopic")
|
||||
julia> agentConfig = Dict(
|
||||
:receiveprompt=>Dict(
|
||||
:mqtttopic=> "testtopic/receive",
|
||||
),
|
||||
:receiveinternal=>Dict(
|
||||
:mqtttopic=> "testtopic/internal",
|
||||
),
|
||||
:text2text=>Dict(
|
||||
:mqtttopic=> "testtopic/text2text",
|
||||
),
|
||||
)
|
||||
julia> a = YiemAgent.sommelier(
|
||||
client,
|
||||
msgMeta,
|
||||
agentConfig,
|
||||
)
|
||||
julia> YiemAgent.addNewMessage(a, "user", "hello")
|
||||
julia> YiemAgent.clearhistory(a)
|
||||
```
|
||||
|
||||
Signature\n
|
||||
-----
|
||||
"""
|
||||
function clearhistory(a::T) where {T<:agent}
|
||||
empty!(a.chathistory)
|
||||
empty!(a.mctstree)
|
||||
empty!(a.plan[:activeplan])
|
||||
empty!(a.plan[:currenttrajectory])
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user