add return chat

This commit is contained in:
2023-11-03 08:23:09 +00:00
parent 884b6abbdc
commit 0db827839b

View File

@@ -209,7 +209,10 @@ function conversation(a::agent, usermsg::String)
#WORKING 1) add if-else user intention logic. 2) add recursive thinking
if userIntent == "chat"
generatePrompt_tokenPrefix(a, userToken="Q:", assistantToken="A:")
result = sendReceivePrompt(a, usermsg)
addNewMessage(a, "assistant", result)
return result
elseif userIntent == "task"
else
@@ -322,7 +325,7 @@ function sendReceivePrompt(a::agent, prompt::String; timeout::Int=10)
)
payloadChannel = Channel(1)
#WORKING send prompt
# send prompt
CommUtils.request(a.mqttClient, msg)
starttime = Dates.now()
result = nothing