This commit is contained in:
lunaticbum 2025-03-14 18:39:15 +09:00
parent c69e18346a
commit 931ec332d7

View File

@ -156,7 +156,7 @@ class Lama {
val currentLLM = llmGemma3 val currentLLM = llmDolphin3
fun getGoogleSearch(query:String){ fun getGoogleSearch(query:String){
Jsoup.connect("https://www.google.com/search?q=".plus(query)).timeout(30000).get().select("a[href]").forEach { } Jsoup.connect("https://www.google.com/search?q=".plus(query)).timeout(30000).get().select("a[href]").forEach { }
} }
@ -430,7 +430,7 @@ class Lama {
infomationDic.get(query!!)!!.iterator().forEach { context.append("\n#${it.key}:${it.value}") } infomationDic.get(query!!)!!.iterator().forEach { context.append("\n#${it.key}:${it.value}") }
val prompt : StringBuffer = StringBuffer().append("참조:\n").append(context).append("\n참조 내용을 고려 해서\n'$query'").append(query).append("\n에 {querys:[],answers:[],keywords:[],links:[]}형식으로 최대한 자세히 대답 해줘 ") val prompt : StringBuffer = StringBuffer().append("참조:\n").append(context).append("\n참조 내용을 고려 해서\n'$query'").append(query).append("\n에 {querys:[],answers:[],keywords:[],links:[]}형식으로 최대한 자세히 대답 해줘 모든 내용은 한국어로 해줘")
val fullUrl = "https://api.telegram.org/${globalEvv.telegramBotKey}/sendMessage" val fullUrl = "https://api.telegram.org/${globalEvv.telegramBotKey}/sendMessage"
val response: OllamaApi.ChatResponse = chatClient.chat(OllamaApi.ChatRequest.Builder(currentLLM).stream(false).format("json").messages( val response: OllamaApi.ChatResponse = chatClient.chat(OllamaApi.ChatRequest.Builder(currentLLM).stream(false).format("json").messages(
@ -439,7 +439,7 @@ class Lama {
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
var toalmsg = "${query}의 대답이 도착했어요.\n${response.message.content}" var toalmsg = "${query}의 대답이 도착했어요.\n${response.message.content}"
toalmsg.chunked(512).forEach { chunkedMsg -> toalmsg.chunked(512).forEach { chunkedMsg ->
println("fullUrl >>> ${fullUrl}") println("chunkedMsg >>> ${chunkedMsg}")
(targetId ?: globalEvv.telegramMyId)?.let { (targetId ?: globalEvv.telegramMyId)?.let {
var tlgSend = TelegramSendMsg(it, chunkedMsg) var tlgSend = TelegramSendMsg(it, chunkedMsg)
WebClient WebClient