skydoves/chatgpt-android

Help, i can't send messages

zunscifi opened this issue · 1 comments

ClearCache...alOperator com.skydoves.chatgpt D (DefaultDispatcher-worker-3:104966) clear cache & histories for Unauthorized and Forbidden
ChatGPTMessageWorker com.skydoves.chatgpt D (DefaultDispatcher-worker-5:104979) worker failure!
WM-WorkerWrapper com.skydoves.chatgpt I Worker result FAILURE for Work [ id=bb92cf25-2f5b-4c57-b6e8-e6d78a8c6574, tags={ com.skydoves.chatgpt.feature.chat.worker.ChatGPTMessageWorker } ]
Toast com.skydoves.chatgpt D show: caller = com.skydoves.chatgpt.core.network.operator.ClearCacheGlobalOperator.onError$lambda$4:68
Toast com.skydoves.chatgpt I show: focusDisplayId = 0, isFocusInDesktop = false mCustomDisplayId=-1 isDexDualMode=false
Toast com.skydoves.chatgpt I show: isActivityContext = false
ChatActivity com.skydoves.chatgpt D (main:2) gpt message worker failed: error code: 1020

binding.send.setOnClickListener {
  binding.output.setText("Typing...")
  var inputStr : String = binding.input.text.toString()
  val workRequest = buildGPTMessageWorkerRequest(inputStr)
  WorkManager.getInstance(this).enqueue(workRequest)
  val workInfo = WorkManager.getInstance(this).getWorkInfoByIdLiveData(workRequest.id)
  workInfo.observe(this, Observer { workInfo ->
    if (workInfo != null) {
      if (workInfo.state == WorkInfo.State.SUCCEEDED) {
        val data = workInfo.outputData.getString(ChatGPTMessageWorker.DATA_SUCCESS)
        binding.output.setText(data)
        streamLog { "gpt message worker success: $data" }
      } else if (workInfo.state == WorkInfo.State.FAILED) {
        val error = workInfo.outputData.getString(ChatGPTMessageWorker.DATA_FAILURE) ?: ""
        streamLog { "gpt message worker failed: $error" }
        binding.output.setText("gpt message worker failed: $error")
      }
    }
  })
}