Spaces:
Runtime error
Runtime error
:boom: [Fix] ConversationStyle: Typing check
Browse files
conversations/conversation_connector.py
CHANGED
@@ -27,17 +27,22 @@ class ConversationConnector:
|
|
27 |
|
28 |
def __init__(
|
29 |
self,
|
30 |
-
conversation_style:
|
31 |
sec_access_token: str = "",
|
32 |
client_id: str = "",
|
33 |
conversation_id: str = "",
|
34 |
invocation_id: int = 0,
|
35 |
cookies={},
|
36 |
):
|
37 |
-
|
|
|
|
|
|
|
|
|
38 |
self.conversation_style = ConversationStyle.PRECISE.value
|
39 |
else:
|
40 |
self.conversation_style = conversation_style.lower()
|
|
|
41 |
|
42 |
self.sec_access_token = sec_access_token
|
43 |
self.client_id = client_id
|
|
|
27 |
|
28 |
def __init__(
|
29 |
self,
|
30 |
+
conversation_style: str = ConversationStyle.PRECISE.value,
|
31 |
sec_access_token: str = "",
|
32 |
client_id: str = "",
|
33 |
conversation_id: str = "",
|
34 |
invocation_id: int = 0,
|
35 |
cookies={},
|
36 |
):
|
37 |
+
conversation_style_enum_values = [
|
38 |
+
style.value for style in ConversationStyle.__members__.values()
|
39 |
+
]
|
40 |
+
|
41 |
+
if conversation_style.lower() not in conversation_style_enum_values:
|
42 |
self.conversation_style = ConversationStyle.PRECISE.value
|
43 |
else:
|
44 |
self.conversation_style = conversation_style.lower()
|
45 |
+
print(f"Model: [{self.conversation_style}]")
|
46 |
|
47 |
self.sec_access_token = sec_access_token
|
48 |
self.client_id = client_id
|
networks/chathub_request_payload_constructor.py
CHANGED
@@ -10,7 +10,7 @@ class ChathubRequestPayloadConstructor:
|
|
10 |
client_id: str,
|
11 |
conversation_id: str,
|
12 |
invocation_id: int = 0,
|
13 |
-
conversation_style:
|
14 |
):
|
15 |
self.prompt = prompt
|
16 |
self.client_id = client_id
|
|
|
10 |
client_id: str,
|
11 |
conversation_id: str,
|
12 |
invocation_id: int = 0,
|
13 |
+
conversation_style: str = ConversationStyle.PRECISE.value,
|
14 |
):
|
15 |
self.prompt = prompt
|
16 |
self.client_id = client_id
|