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 """ convert preparedcontext into openai message format ready to be used by LLM
""" """
function formatMsgForLLM(messages::Vector{agentMessage})::Vector{Dict{String, Any}} function formatMsgForLLM(messages::Vector{agentMessage})::Vector{Dict{String, Any}}
""" openai message format """ openai message format example
message = Dict( msg = Dict(
"role" => "user", "model" => "gemma-4-E4B-it-UD-Q4_K_XL",
"content" => [ "messages" => [
Dict("type" => "text", "text" =>
"
Do you have Brunello di Montalcino from Tenuta CastelGiocon?
"),
Dict( Dict(
"type" => "image_url", "role" => "system",
"image_url" => Dict("url" => data1_uri) "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)
)
]
)