Skip to content

Commit

Permalink
2.36 2.37 2.38
Browse files Browse the repository at this point in the history
  • Loading branch information
AndraxDev committed Jan 5, 2024
1 parent d9e6352 commit 208e14d
Show file tree
Hide file tree
Showing 68 changed files with 882 additions and 305 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "org.teslasoft.assistant"
minSdk 26
targetSdk 34
versionCode 236
versionName "2.36"
versionCode 238
versionName "2.38"
externalNativeBuild {
cmake {
cppFlags ''
Expand Down Expand Up @@ -58,10 +58,10 @@ android {
dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.10.0'
implementation 'com.google.android.material:material:1.11.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.aallam.openai:openai-client:3.6.1'
implementation 'io.ktor:ktor-client-android:2.3.6'
implementation 'com.aallam.openai:openai-client:3.6.2'
implementation 'io.ktor:ktor-client-android:2.3.7'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
implementation 'org.teslasoft.core.auth:teslasoft-id:1.3.0'
Expand All @@ -75,7 +75,7 @@ dependencies {
implementation 'io.noties.markwon:ext-strikethrough:4.6.2'
implementation 'io.noties.markwon:ext-tables:4.6.2'
implementation 'io.noties.markwon:ext-tasklist:4.6.2'
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.11'
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.12'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.security:security-crypto-ktx:1.1.0-alpha06'
implementation 'com.google.mlkit:language-id:17.0.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import android.widget.Toast

import androidx.fragment.app.FragmentActivity

Expand All @@ -40,6 +43,9 @@ class AboutActivity : FragmentActivity() {
private var btnFeedback: MaterialButton? = null
private var appVer: TextView? = null
private var btnDonate: LinearLayout? = null
private var btnGithub: LinearLayout? = null

private var activateEasterEggCounter: Int = 0

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand All @@ -53,9 +59,26 @@ class AboutActivity : FragmentActivity() {
btnFeedback = findViewById(R.id.btn_feedback)
appVer = findViewById(R.id.app_ver)
btnDonate = findViewById(R.id.btn_donate)
btnGithub = findViewById(R.id.btn_github)

appIcon?.setImageResource(R.drawable.assistant)

appVer?.setOnClickListener {
if (activateEasterEggCounter == 0) {
Handler(Looper.getMainLooper()).postDelayed({
activateEasterEggCounter = 0
}, 1500)
}

if (activateEasterEggCounter == 4) {
activateEasterEggCounter = 0
Toast.makeText(this, "Easter egg found!", Toast.LENGTH_SHORT).show()
/* TODO: Open easter egg */
}

activateEasterEggCounter++
}

try {
val pInfo: PackageInfo = if (android.os.Build.VERSION.SDK_INT >= 33) {
packageManager.getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(0))
Expand Down Expand Up @@ -104,5 +127,12 @@ class AboutActivity : FragmentActivity() {
i.action = Intent.ACTION_VIEW
startActivity(i)
}

btnGithub?.setOnClickListener {
val i = Intent()
i.data = Uri.parse("https://github.com/AndraxDev/speak-gpt")
i.action = Intent.ACTION_VIEW
startActivity(i)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ class ChatActivity : FragmentActivity() {
} else if (e.stackTraceToString().contains("You exceeded your current quota")) {
"You exceeded your current quota. If you had free trial usage please add payment info. Also please check your usage limits. You can change your limits in Account settings."
} else {
e.stackTraceToString()
e.stackTraceToString() + "\n\n" + e.message
}

putMessage(response, true)
Expand Down Expand Up @@ -1169,16 +1169,18 @@ class ChatActivity : FragmentActivity() {
btnMicro?.isEnabled = false
btnSend?.isEnabled = false
progress?.visibility = View.GONE

val m = msgs

m.add(
ChatMessage(
role = ChatRole.User,
role = ChatRole.System,
content = "Create a short name for this chat according to the messages provided. Enter just short name and nothing else. Don't add word 'chat' or 'bot' to the name."
)
)

val chatCompletionRequest2 = ChatCompletionRequest(
model = ModelId("gpt-3.5-turbo"),
model = ModelId("gpt-3.5-turbo-1106"),
maxTokens = 5,
messages = m
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,15 +529,15 @@ class SettingsActivity : FragmentActivity() {
chatId = extras.getString("chatId", "")

if (chatId == "") {
btnClearChat?.visibility = View.GONE
btnClearChat?.isEnabled = false
activitySettingsTitle?.text = getString(R.string.global_settings_title)
globalSettingsTip?.visibility = View.VISIBLE
} else {
activitySettingsTitle?.text = getString(R.string.chat_settings_title)
globalSettingsTip?.visibility = View.GONE
}
} else {
btnClearChat?.visibility = View.GONE
btnClearChat?.isEnabled = false
activitySettingsTitle?.text = getString(R.string.global_settings_title)
globalSettingsTip?.visibility = View.VISIBLE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class VoiceListAdapter(private val context: Context, private val items: ArrayLis
}

private fun getSurfaceColor(context: Context) : Int {
return SurfaceColors.SURFACE_3.getColor(context)
return context.getColor(android.R.color.transparent)
}

private fun getSurfaceColorV2(context: Context) : Int {
Expand Down
Loading

0 comments on commit 208e14d

Please sign in to comment.