This commit is contained in:
lunaticbum 2026-03-30 13:41:26 +09:00
parent d552584446
commit 5b70c7805a
3 changed files with 8 additions and 8 deletions

View File

@ -2,6 +2,6 @@ object Defines {
val DETAILLOG = false
var LLM_PORT = 8080
var EMBEDDING_PORT = 8081
val AUTOSELL = false
val AUTOSELL = true
val BLACKLISTEDSTOCKCODES = listOf<String>()
}

View File

@ -99,11 +99,11 @@ private var isAppStarted = false
fun main() = application {
if (!isAppStarted) {
initLogger(DETAILLOG)
val (port1, port2) = PortFinder.findAvailablePortPair(18080)
println("🚀 AI 서버용 포트 할당 완료: 메인($port1), 서브($port2)")
LLM_PORT = port1
EMBEDDING_PORT = port2
// val (port1, port2) = PortFinder.findAvailablePortPair(18080)
//
// println("🚀 AI 서버용 포트 할당 완료: 메인($port1), 서브($port2)")
// LLM_PORT = port1
// EMBEDDING_PORT = port2
isAppStarted = true
}

View File

@ -332,7 +332,7 @@ object RagService {
//// println(response)
// return response.aiMessage().text()
// }
private const val LLM_API_URL = "http://127.0.0.1:8080/v1/chat/completions"
private fun LLM_API_URL() = "http://127.0.0.1:$LLM_PORT/v1/chat/completions"
private suspend fun callLlamaWithSchema(prompt: String): String {
val jsonMediaType = "application/json; charset=utf-8".toMediaType()
@ -365,7 +365,7 @@ object RagService {
}.toString()
println("requestBodyJson =>> $requestBodyJson")
val request = Request.Builder()
.url(LLM_API_URL)
.url(LLM_API_URL())
.post(requestBodyJson.toRequestBody(jsonMediaType))
.build()