Update handler.py
Browse files- handler.py +3 -1
handler.py
CHANGED
|
@@ -28,7 +28,7 @@ MODEL = env.str("MODEL", "gpt-3.5-turbo")
|
|
| 28 |
AI_RESPONSE_TIMEOUT = env.int("AI_RESPONSE_TIMEOUT", 20)
|
| 29 |
|
| 30 |
class EndpointHandler:
|
| 31 |
-
def __init__(self):
|
| 32 |
pass
|
| 33 |
|
| 34 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
|
|
@@ -40,6 +40,8 @@ class EndpointHandler:
|
|
| 40 |
except Exception as e:
|
| 41 |
return {"error": str(e)}
|
| 42 |
|
|
|
|
|
|
|
| 43 |
def process_json_input(self, json_data):
|
| 44 |
if "FromUserKavasQuestions" in json_data and "Chatmood" in json_data:
|
| 45 |
prompt = self.create_conversation_starter_prompt(
|
|
|
|
| 28 |
AI_RESPONSE_TIMEOUT = env.int("AI_RESPONSE_TIMEOUT", 20)
|
| 29 |
|
| 30 |
class EndpointHandler:
|
| 31 |
+
def __init__(self, model_dir):
|
| 32 |
pass
|
| 33 |
|
| 34 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
|
| 40 |
except Exception as e:
|
| 41 |
return {"error": str(e)}
|
| 42 |
|
| 43 |
+
# Rest of the code remains the same
|
| 44 |
+
|
| 45 |
def process_json_input(self, json_data):
|
| 46 |
if "FromUserKavasQuestions" in json_data and "Chatmood" in json_data:
|
| 47 |
prompt = self.create_conversation_starter_prompt(
|