update
This commit is contained in:
64
src/util.jl
64
src/util.jl
@@ -11,44 +11,40 @@ using ..type
|
||||
|
||||
""" Clear agent chat history.
|
||||
|
||||
Arguments\n
|
||||
-----
|
||||
a::agent
|
||||
an agent
|
||||
# Arguments
|
||||
- `a::agent`
|
||||
an agent
|
||||
|
||||
Return\n
|
||||
-----
|
||||
nothing
|
||||
# Return
|
||||
- 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",
|
||||
),
|
||||
# Example
|
||||
```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> a = YiemAgent.sommelier(
|
||||
client,
|
||||
msgMeta,
|
||||
agentConfig,
|
||||
)
|
||||
julia> YiemAgent.addNewMessage(a, "user", "hello")
|
||||
julia> YiemAgent.clearhistory(a)
|
||||
```
|
||||
julia> YiemAgent.addNewMessage(a, "user", "hello")
|
||||
julia> YiemAgent.clearhistory(a)
|
||||
```
|
||||
|
||||
Signature\n
|
||||
-----
|
||||
# Signature
|
||||
"""
|
||||
function clearhistory(a::T) where {T<:agent}
|
||||
empty!(a.chathistory)
|
||||
|
||||
Reference in New Issue
Block a user