I am not sure what the error details have no clue no idea but Have this error in my logs and there not response.
22:57:54.632 System.err SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
22:57:54.632 System.err SLF4J: Defaulting to no-operation (NOP) logger implementation
22:57:54.632 System.err SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
22:57:55.041 TrafficStats tagSocket(5) with statsTag=0xffffffff, statsUid=-1
22:57:56.772 System.out Failed to
class RegenerativeModule(context: Context) {
private val sharedPreferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
private val appKey = sharedPreferences.getString("api_key", "")!!
private var vertexAI: VertexAI = VertexAI.Builder()
.setAccessToken(appKey)
.setProjectId("metospherus-kit")
.build()
var textRequest = vertexAI.textRequest()
.setModel("models/chat-bison-001")
.setTemperature(0.8)
.setMaxTokens(256)
.setTopK(40)
.setTopP(0.8)
}
searchableInputEditText.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE) {
println("message input $query")
CoroutineScope(Dispatchers.Main).launch {
RegenerativeModule(requireContext()).textRequest
.execute(query,object : VertexAI.Callback<Any> {
override fun onError(throwable: Throwable) {
println("Failed to ${throwable.message} ${throwable.localizedMessage}")
}
override fun onSuccess(result: Any) {
val messageContent = result.toString()
println("context $messageContent")
CoroutineScope(Dispatchers.Main).launch {
if (messageContent != null) {
val words = messageContent.split("\\s+".toRegex())
val typingDelay = 100L
val messageComp = GeneralBrainResponse(
GeneralBrain.generateRandomId(),
query,
messageContent
)
Constructor.insertOrUpdateUserCompanionShip(
messageComp,
appDatabase
)
val responseText = StringBuilder()
for (word in words) {
searchRecyclerView.hideSkeleton()
responseText.append(
"${
word.replace(".", ".\n\n")
.replace("?", "?\n\n")
.replace("*", "\n\n*")
.replace(".\n\n\n\n*", "\n\n*")
.replace("\n*", "*")
.replace(Regex("\\d\\."), "\n$0")
} "
)
val repos = mutableListOf(
GeneralSearchResults(
"Metospherus - Comprehensive Medical System",
responseText.toString().replace("\n\n ", "\n\n"),
)
)
searchAdapter.setData(repos)
delay(typingDelay)
}
}
}
}
}).let {
}
}
}
true
}