ai-plays-jackbox 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ai-plays-jackbox might be problematic. Click here for more details.

@@ -2,7 +2,7 @@ import json
2
2
  import threading
3
3
  import traceback
4
4
  from abc import ABC, abstractmethod
5
- from typing import Optional
5
+ from typing import Optional, Union
6
6
  from urllib import parse
7
7
  from uuid import uuid4
8
8
 
@@ -110,18 +110,17 @@ class JackBoxBotBase(ABC):
110
110
  def _on_message(self, wsapp, message) -> None:
111
111
  server_message = ServerMessage.model_validate_json(message)
112
112
 
113
- # logger.info(server_message.result)
114
-
115
113
  if server_message.opcode == "client/welcome":
116
114
  self._player_id = server_message.result["id"]
117
115
  self._handle_welcome(server_message.result)
118
116
 
119
- elif server_message.opcode == "object" or server_message.opcode == "text":
120
- if server_message.opcode == "object":
121
- operation = ObjectOperation(**server_message.result)
122
- elif server_message.opcode == "text":
123
- operation = TextOperation(**server_message.result) # type: ignore
117
+ operation: Optional[Union[ObjectOperation, TextOperation]] = None
118
+ if server_message.opcode == "object":
119
+ operation = ObjectOperation(**server_message.result)
120
+ elif server_message.opcode == "text":
121
+ operation = TextOperation(**server_message.result)
124
122
 
123
+ if operation is not None:
125
124
  if self._is_player_operation_key(operation.key):
126
125
  self._handle_player_operation(operation.json_data)
127
126
  if self._is_room_operation_key(operation.key):
@@ -22,7 +22,7 @@ class GeminiModel(ChatModel):
22
22
 
23
23
  # Check connection and if model exists, this will hard fail if connection can't be made
24
24
  # Or if the model is not found
25
- _ = self._gemini_vertex_ai_client.models.get(self._model)
25
+ _ = self._gemini_vertex_ai_client.models.get(model=self._model)
26
26
 
27
27
  @classmethod
28
28
  def get_default_model(cls):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ai-plays-jackbox
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Bringing the dead internet theory to life. Have AI play JackBox with you; no friends required!
5
5
  License: MIT
6
6
  Author: Daniel S. Thompson
@@ -28,7 +28,7 @@ Project-URL: Bug Tracker, https://github.com/SudoSpartanDan/AIPlaysJackBox/issue
28
28
  Project-URL: Repository, https://github.com/SudoSpartanDan/AIPlaysJackBox
29
29
  Description-Content-Type: text/markdown
30
30
 
31
- # AI Plays JackBox
31
+ # ai-plays-jackbox
32
32
 
33
33
  ![Stable Version](https://img.shields.io/pypi/v/ai-plays-jackbox?label=stable)
34
34
  ![Python Versions](https://img.shields.io/pypi/pyversions/ai-plays-jackbox)
@@ -1,6 +1,6 @@
1
1
  ai_plays_jackbox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  ai_plays_jackbox/bot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- ai_plays_jackbox/bot/bot_base.py,sha256=d9PVr2fA6ajeTs1tU-Qa1ZOMuOu-hQOEHLiHHpzbp1A,7415
3
+ ai_plays_jackbox/bot/bot_base.py,sha256=c9luRy5GPsjZdL87GU5T2kj4NqroNU3DyzX5RXCgpg0,7369
4
4
  ai_plays_jackbox/bot/bot_factory.py,sha256=7FuDvYxotttPGEW5iHL-52nrfTn-hFJGKVwwsxkOak8,1264
5
5
  ai_plays_jackbox/bot/bot_personality.py,sha256=x7oVyyH83Ofd8C7ZHczEVgY_6NSpSafixZCI-NKxBc8,4217
6
6
  ai_plays_jackbox/bot/jackbox5/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -25,7 +25,7 @@ ai_plays_jackbox/constants.py,sha256=5ejveTgb9_QJOqYW8Lc9mqrUIFo6LjE-GJYJEGHpSM0
25
25
  ai_plays_jackbox/llm/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
26
26
  ai_plays_jackbox/llm/chat_model.py,sha256=VirseP5NgCVg42-NGO5qj_v4bXPqMl1c98aUX8pRHOY,984
27
27
  ai_plays_jackbox/llm/chat_model_factory.py,sha256=rJNMXyOIDf6CnX41EWt3mW7u8m30uRhq_I8dXsI4sf0,1222
28
- ai_plays_jackbox/llm/gemini_model.py,sha256=Zq9WGRCevetb9y7dJrpr4Wn0XCbY6aN5N9q0lI_Qna0,2879
28
+ ai_plays_jackbox/llm/gemini_model.py,sha256=ElcfHC-r_fOYGEH7CEthisj8FCLGhe6-QLh-RNwZjN4,2885
29
29
  ai_plays_jackbox/llm/ollama_model.py,sha256=DDc8pRdpXVDnq3k1v1VsJUAaA-3HaFefEIimmptsU5I,1644
30
30
  ai_plays_jackbox/llm/openai_model.py,sha256=pDW6-Afy6dQh84ccM8lTZjz5bsymtaxzTgW8R_2BMtE,2734
31
31
  ai_plays_jackbox/room/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -35,8 +35,8 @@ ai_plays_jackbox/scripts/lint.py,sha256=xCQ9vYZv0iiRvaFgdoWr9Gpe2Tz9rX9fn1ltZFm3
35
35
  ai_plays_jackbox/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
36
  ai_plays_jackbox/ui/main.py,sha256=-J7DGanJrMkPUP0OdVPVP_IIr5dZ6G2D1IehV365bGo,242
37
37
  ai_plays_jackbox/ui/startup.py,sha256=s_Hfp90NZ73egs_ePfWk0rEUYoctFXPU5jqsKbtXY8I,9057
38
- ai_plays_jackbox-0.2.1.dist-info/LICENSE,sha256=Dxj3CeEsn2Olpkn5QJxGmQemd3zGnM2aA-7Hme4uIE4,1095
39
- ai_plays_jackbox-0.2.1.dist-info/METADATA,sha256=DKyAqsyLiTQh2JMrGbHKsnrsq4kPFUrYpokTw3VIXMk,7605
40
- ai_plays_jackbox-0.2.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
41
- ai_plays_jackbox-0.2.1.dist-info/entry_points.txt,sha256=FtRnZSjr8xKAC206XNhh-M7vJlcF7Hb_tBg4qZFzQvY,117
42
- ai_plays_jackbox-0.2.1.dist-info/RECORD,,
38
+ ai_plays_jackbox-0.2.2.dist-info/LICENSE,sha256=Dxj3CeEsn2Olpkn5QJxGmQemd3zGnM2aA-7Hme4uIE4,1095
39
+ ai_plays_jackbox-0.2.2.dist-info/METADATA,sha256=DOgi4733M3qRZVjGg_lvZIx3YVVBh9ok1XU75DxjTRQ,7605
40
+ ai_plays_jackbox-0.2.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
41
+ ai_plays_jackbox-0.2.2.dist-info/entry_points.txt,sha256=FtRnZSjr8xKAC206XNhh-M7vJlcF7Hb_tBg4qZFzQvY,117
42
+ ai_plays_jackbox-0.2.2.dist-info/RECORD,,