V0.8.0 async think loop #40
+22
-2
@@ -113,8 +113,28 @@ function prepareContext(state::agentState)::Vector{agentMessage}
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function formatMsgForLLM()
|
""" convert preparedcontext into openai message format ready to be used by LLM
|
||||||
|
"""
|
||||||
|
function formatMsgForLLM(messages::Vector{agentMessage})::Vector{Dict{String, Any}}
|
||||||
|
""" openai message format
|
||||||
|
message = Dict(
|
||||||
|
"role" => "user",
|
||||||
|
"content" => [
|
||||||
|
Dict("type" => "text", "text" =>
|
||||||
|
"
|
||||||
|
Do you have Brunello di Montalcino from Tenuta CastelGiocon?
|
||||||
|
"),
|
||||||
|
Dict(
|
||||||
|
"type" => "image_url",
|
||||||
|
"image_url" => Dict("url" => data1_uri)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
"""
|
||||||
|
|
||||||
|
# convert various messages to openai message format
|
||||||
|
|
||||||
|
return openai_message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user