This commit is contained in:
2023-11-24 07:21:35 +00:00
parent 27ae99afeb
commit d040e46950
5 changed files with 647 additions and 587 deletions

View File

@@ -3,7 +3,8 @@ module llmfunction
export wikisearch
using HTTP, JSON3
using GeneralUtils
using ..utils
#------------------------------------------------------------------------------------------------100
"""
@@ -24,7 +25,7 @@ function wikisearch(phrase::T) where {T<:AbstractString}
phrase = phrase[1] == " " ? phrase[2:end] : phrase
# prepare input phrase
if occursin("\"", phrase)
phrase = GeneralUtils.getStringBetweenCharacters(toolinput, "\"", "\"")
phrase = GeneralUtils.getStringBetweenCharacters(phrase, "\"", "\"")
end
phrase = replace(phrase, "\n"=>"")
@@ -45,6 +46,10 @@ function wikisearch(phrase::T) where {T<:AbstractString}
if result == ""
result = "No info available."
end
if result != "No info available." #TODO for use with wikisearch(). Not good for other tools
result = makeSummary(a, result)
end
return result
end
@@ -99,7 +104,6 @@ end