Spaces:
Runtime error
Runtime error
GitLab CI
commited on
Commit
·
45ab685
1
Parent(s):
457d4b2
Update game build from GitLab CI
Browse files- server/ActionProcessor.py +7 -12
- server/static/godot/index.pck +0 -0
server/ActionProcessor.py
CHANGED
|
@@ -32,24 +32,19 @@ class ActionProcessor(Thread):
|
|
| 32 |
|
| 33 |
def get_sentiment(self, input_text: str) -> str:
|
| 34 |
"""Get sentiment analysis for input text."""
|
| 35 |
-
|
| 36 |
-
model="mistral-large-latest",
|
| 37 |
-
messages=[
|
| 38 |
-
{
|
| 39 |
"role": "user",
|
| 40 |
"content": f"""You are a sentiment classifier of positive or negative parenting.
|
| 41 |
Classify the following sentence, output "negative" or "positive", do not justify:
|
| 42 |
"{input_text}"
|
| 43 |
-
""",
|
| 44 |
-
|
| 45 |
-
|
|
|
|
| 46 |
)
|
|
|
|
| 47 |
|
| 48 |
-
|
| 49 |
-
for chunk in stream_response:
|
| 50 |
-
response += chunk.choices[0].delta.content
|
| 51 |
-
|
| 52 |
-
return response.strip()
|
| 53 |
|
| 54 |
def process_text(self, text: str) -> Dict[str, Any] | None:
|
| 55 |
"""Convert text into an action if a complete command is detected."""
|
|
|
|
| 32 |
|
| 33 |
def get_sentiment(self, input_text: str) -> str:
|
| 34 |
"""Get sentiment analysis for input text."""
|
| 35 |
+
messages=[{
|
|
|
|
|
|
|
|
|
|
| 36 |
"role": "user",
|
| 37 |
"content": f"""You are a sentiment classifier of positive or negative parenting.
|
| 38 |
Classify the following sentence, output "negative" or "positive", do not justify:
|
| 39 |
"{input_text}"
|
| 40 |
+
""",},]
|
| 41 |
+
response = self.mistral_client.chat.complete(
|
| 42 |
+
model="mistral-large-latest",
|
| 43 |
+
messages=messages,
|
| 44 |
)
|
| 45 |
+
result = response.choices[0].message.content
|
| 46 |
|
| 47 |
+
return result.strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
def process_text(self, text: str) -> Dict[str, Any] | None:
|
| 50 |
"""Convert text into an action if a complete command is detected."""
|
server/static/godot/index.pck
CHANGED
|
Binary files a/server/static/godot/index.pck and b/server/static/godot/index.pck differ
|
|
|