update
This commit is contained in:
@@ -452,6 +452,7 @@ function conversation(a::agentReflex, usermsg::String; attemptlimit::Int=3)
|
||||
# end
|
||||
|
||||
response = chat_mistral_openorca(a)
|
||||
response = removeTrailingCharacters(response)
|
||||
_ = addNewMessage(a, "assistant", response)
|
||||
|
||||
return response
|
||||
|
||||
@@ -116,8 +116,8 @@ function agentReflex(
|
||||
subtopic= (imgAI="agent/api/v0.1.0/img/respond",
|
||||
txtAI="agent/api/v0.1.0/txt/respond"),
|
||||
keepalive= 30,),
|
||||
role::Symbol=:assistant,
|
||||
roles::Dict=Dict(
|
||||
role::Symbol=:assistant,
|
||||
roles::Dict=Dict(
|
||||
:assistant =>
|
||||
"""
|
||||
You are a helpful assistant who respond to user as best you can.
|
||||
|
||||
46
src/utils.jl
46
src/utils.jl
@@ -4,7 +4,7 @@ export makeSummary, sendReceivePrompt, chunktext, extractStepFromPlan, checkTota
|
||||
detectCharacters, findDetectedCharacter, extract_number, toolNameBeingCalled,
|
||||
isUseTools, conversationSummary, checkReasonableness, replaceHeaders,
|
||||
addShortMem!, splittext, dictToString, removeHeaders, keepOnlyKeys, experience,
|
||||
messagesToString
|
||||
messagesToString, removeTrailingCharacters
|
||||
|
||||
using UUIDs, Dates, DataStructures
|
||||
using CommUtils, GeneralUtils
|
||||
@@ -388,7 +388,6 @@ function isUseTools(a::agentReflex)
|
||||
|
||||
From the user's message, ask yourself what do you need to do?
|
||||
<|im_end|>
|
||||
<|im_start|>assistant
|
||||
|
||||
"""
|
||||
|
||||
@@ -431,13 +430,48 @@ function isUseTools(a::agentReflex)
|
||||
$conversation
|
||||
|
||||
Use the following format:
|
||||
1. Objective: From your conversation with the user, ask yourself what do you need to do now?
|
||||
2. Plan: first you should always think about the stimulus, the info you need and the info you have thoroughly then extract and devise a step by step plan (pay attention to correct numeral calculation and commonsense).
|
||||
Objective: From your conversation with the user, ask yourself what do you need to do now?
|
||||
<|im_end|>
|
||||
|
||||
"""
|
||||
assistant_objective_result = sendReceivePrompt(a, assistant_objective_prompt, temperature=0.2)
|
||||
@show assistant_objective_result
|
||||
result_objective = sendReceivePrompt(a, assistant_objective_prompt, temperature=0.2)
|
||||
@show result_objective
|
||||
|
||||
# assistant_plan_prompt =
|
||||
# """
|
||||
# <|im_start|>system
|
||||
# $(a.roles[a.role])
|
||||
# The info you need from the user to be able to help them selecting their best wine:
|
||||
# - type of food
|
||||
# - occasion
|
||||
# - user's personal taste of wine
|
||||
# - wine price range
|
||||
# - ambient temperature at the serving location
|
||||
# - wines we have in stock
|
||||
# You provide a personalized recommendation of up to two wines based on the user's info above, and you describe the benefits of each wine in detail.
|
||||
|
||||
# You have access to the following tools:
|
||||
# $toollines
|
||||
|
||||
# Use the following format:
|
||||
# Stimulus: the input user gives to you and you must respond
|
||||
# Plan: first you should always think about the stimulus, the info you need and the info you have thoroughly then extract and devise a step by step plan (pay attention to correct numeral calculation and commonsense).
|
||||
# p.s.1 each step should be a single action.
|
||||
# p.s.2 don't respond to the stimulus yet.
|
||||
# <|im_end|>
|
||||
# <|im_start|>user
|
||||
# $result_objective
|
||||
# <|im_end|>
|
||||
# <|im_start|>assistant
|
||||
# Plan:
|
||||
# """
|
||||
# result_plan = sendReceivePrompt(a, assistant_plan_prompt, temperature=0.2)
|
||||
# @show result_plan
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
return isusetool, plan
|
||||
|
||||
Reference in New Issue
Block a user