This commit is contained in:
narawat lamaiin
2024-12-10 13:17:19 +07:00
parent d763727d7d
commit bc002a3ef4
2 changed files with 23 additions and 22 deletions

View File

@@ -26,7 +26,6 @@ function executeSQLVectorDB(sql)
return result
end
function text2textInstructLLM(prompt::String)
msgMeta = GeneralUtils.generate_msgMeta(
config[:externalservice][:text2textinstruct][:mqtttopic];
@@ -55,7 +54,6 @@ function text2textInstructLLM(prompt::String)
return response
end
# get text embedding from a LLM service
function getEmbedding(text::T) where {T<:AbstractString}
msgMeta = GeneralUtils.generate_msgMeta(
@@ -74,7 +72,7 @@ function getEmbedding(text::T) where {T<:AbstractString}
:text => [text] # must be a vector of string
)
)
response = GeneralUtils.sendReceiveMqttMsg(outgoingMsg)
response = GeneralUtils.sendReceiveMqttMsg(outgoingMsg; timeout=6000)
embedding = response[:response][:embeddings]
return embedding
end