This commit is contained in:
2026-08-06 18:40:09 +07:00
parent 8232946e91
commit e592441387
+46 -13
View File
@@ -116,19 +116,40 @@ end
""" 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?
"),
""" openai message format example
msg = Dict(
"model" => "gemma-4-E4B-it-UD-Q4_K_XL",
"messages" => [
Dict(
"type" => "image_url",
"image_url" => Dict("url" => data1_uri)
)
]
"role" => "system",
"content" => [
Dict("type" => "text", "text" => systemmsg),
]
),
Dict(
"role" => "user",
"content" => [
Dict("type" => "text", "text" => "Do you have something similar to the one in the image?"),
Dict(
"type" => "image_url",
"image_url" => Dict("url" => data1_uri)
)
]
),
Dict(
"role" => "assistant",
"content" => [
Dict("type" => "text", "text" => "let me check."),
]
),
Dict(
"role" => "toolResult",
"content" => [
Dict("type" => "text", "text" => "name: Chateau Montelena ..."),
]
),
],
"temperature" => 0.7
)
"""
@@ -141,7 +162,19 @@ end
message = Dict(
"role" => "user",
"content" => [
Dict("type" => "text", "text" =>
"
Do you have something similar to the one in the image?
"),
Dict(
"type" => "image_url",
"image_url" => Dict("url" => data1_uri)
)
]
)