Spaces:
Runtime error
Runtime error
:gem: [Feature] Support disable search for offline models
Browse files
networks/chathub_request_payload_constructor.py
CHANGED
@@ -34,16 +34,21 @@ class ChathubRequestPayloadConstructor:
|
|
34 |
invocation_id: int = 0,
|
35 |
conversation_style: str = ConversationStyle.PRECISE.value,
|
36 |
system_prompt: str = None,
|
37 |
-
enable_search: bool = True,
|
38 |
):
|
39 |
self.prompt = prompt
|
40 |
self.client_id = client_id
|
41 |
self.conversation_id = conversation_id
|
42 |
self.invocation_id = invocation_id
|
43 |
-
self.conversation_style = conversation_style
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
self.message_id = self.generate_random_uuid()
|
45 |
self.system_prompt = system_prompt
|
46 |
-
self.enable_search = enable_search
|
47 |
self.construct()
|
48 |
|
49 |
def generate_random_uuid(self):
|
|
|
34 |
invocation_id: int = 0,
|
35 |
conversation_style: str = ConversationStyle.PRECISE.value,
|
36 |
system_prompt: str = None,
|
|
|
37 |
):
|
38 |
self.prompt = prompt
|
39 |
self.client_id = client_id
|
40 |
self.conversation_id = conversation_id
|
41 |
self.invocation_id = invocation_id
|
42 |
+
self.conversation_style = conversation_style.lower()
|
43 |
+
|
44 |
+
if self.conversation_style.endswith("offline"):
|
45 |
+
self.enable_search = False
|
46 |
+
self.conversation_style = self.conversation_style.replace("-offline", "")
|
47 |
+
else:
|
48 |
+
self.enable_search = True
|
49 |
+
|
50 |
self.message_id = self.generate_random_uuid()
|
51 |
self.system_prompt = system_prompt
|
|
|
52 |
self.construct()
|
53 |
|
54 |
def generate_random_uuid(self):
|