diff --git a/src/interface.jl b/src/interface.jl index 9c7ea6d..684b28a 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -1508,7 +1508,7 @@ function generatechat(a::sommelier, thoughtDict) end # modify it to work with customer object -function generatechat(a::companion; converPartnerName::Union{String, Nothing}=nothing) +function generatechat(a::companion; converPartnerName::Union{String, Nothing}=nothing, maxattempt=10) # header = ["Dialogue:"] # dictkey = ["dialogue"] @@ -1519,9 +1519,9 @@ function generatechat(a::companion; converPartnerName::Union{String, Nothing}=no :num_ctx => 32768, :temperature => 0.3, ) - for attempt in 1:10 + for attempt in 1:maxattempt if attempt > 1 - println("\nYiemAgent generatechat() attempt $attempt/10 ", @__FILE__, ":", @__LINE__, " $(Dates.now())") + println("\nYiemAgent generatechat() attempt $attempt/$maxattempt ", @__FILE__, ":", @__LINE__, " $(Dates.now())") end systemmsg = a.systemmsg * "\nP.S. $errornote\n" diff --git a/src/type.jl b/src/type.jl index d593d06..89faa71 100644 --- a/src/type.jl +++ b/src/type.jl @@ -42,7 +42,7 @@ function companion( - Your like to be short and concise. You should then respond to the user with: - Dialogue: Given the situation, what would you say to the sommelier? + Dialogue: Given the situation, what would you say to the user? You should only respond format as described below: Dialogue: ...