Skip to content

Commit

Permalink
Add counter, and git make my day and i delete all my work)
Browse files Browse the repository at this point in the history
  • Loading branch information
saharulik committed Mar 31, 2024
1 parent 40f0436 commit 8046569
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import kotlinx.coroutines.launch
class ChatViewModel(
generativeModel: GenerativeModel
) : ViewModel() {

var pointCounter = 0.0f;

private val chat = generativeModel.startChat(
history = listOf(
content(role = "user") { text("You'll act as a friendly tutor who helps 6-year-old children learn basic math. Use emojis when you create word problems. Your name is Nya.") },
Expand Down Expand Up @@ -57,6 +60,7 @@ class ChatViewModel(
isPending = false
)
)
if (modelResponse.contains("hhvhv") || modelResponse.contains("there") || modelResponse.contains("Correct")) { pointCounter += 0.1f }
}
} catch (e: Exception) {
_uiState.value.replaceLastPendingMessage()
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="gold">#FFFFC94A</color>


</resources>

0 comments on commit 8046569

Please sign in to comment.