Skip to content

Commit

Permalink
Tweaked emotion generation code
Browse files Browse the repository at this point in the history
  • Loading branch information
hiibolt committed Dec 26, 2023
1 parent dbacc7f commit ec13c97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>WebSocket Chat</title>
<title>MonikaiV2</title>
<script src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.js"></script>
<link href="public/style.css" rel="stylesheet" type="text/css" />
</head>
Expand Down Expand Up @@ -54,7 +54,7 @@

function preload() {
background_sprite = loadImage('public/assets/backgrounds/default.png');
textbox_sprite = loadImage('public/assets/gui/TEXTBOX_NASTYA.png');
textbox_sprite = loadImage('public/assets/gui/TEXTBOX_LIBITINA.png');
speech_font = loadFont('public/assets/fonts/ALLER.ttf');

let emotions = ["CONCERNED", "CRYING", "LAUGHING", "NEUTRAL", "SAD"];
Expand Down Expand Up @@ -96,7 +96,7 @@

// Textbox Sprite Handling
if ( current_message.length > 0 ) {
image(textbox_sprite, (1280 / 2) - (800 / 2), 535, 800, 260);
image(textbox_sprite, (1280 / 2) - (900 / 2), 535, 900, 260);
}

fill(255);
Expand Down
5 changes: 2 additions & 3 deletions src/monikai/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,10 @@ async fn monikai_websocket(stream: WebSocket, monikai: Arc<Mutex<Monikai>>) {
NEXT RESPONSE:
{}
{{
\"message\": \"{}\",
{{\"message\":\"{}\",\"emotion\":
", description, conversation, response, response)).await.unwrap();

let response_with_emotion = format!(r#"{{"message": "{}",{}"#, response, emotion);
let response_with_emotion = format!(r#"{{"message": "{}","emotion":{}"#, response, emotion);

sender
.send(axum::extract::ws::Message::Text(response_with_emotion))
Expand Down

0 comments on commit ec13c97

Please sign in to comment.