Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,11 @@ import matplotlib.pyplot as plt
|
|
7 |
from typing import Dict, List, Tuple, Any
|
8 |
import json
|
9 |
from litellm import completion
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# System prompts for different AI roles
|
12 |
CONVERSATION_PROMPT = """
|
@@ -375,6 +380,14 @@ def create_interface():
|
|
375 |
return "Advisor initialized! Let's discuss your career."
|
376 |
|
377 |
def chat(message: str, history: List):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
if not advisor:
|
379 |
return "Please enter your API key first.", None
|
380 |
|
@@ -438,4 +451,4 @@ def create_interface():
|
|
438 |
|
439 |
if __name__ == "__main__":
|
440 |
demo = create_interface()
|
441 |
-
demo.launch()
|
|
|
7 |
from typing import Dict, List, Tuple, Any
|
8 |
import json
|
9 |
from litellm import completion
|
10 |
+
import logging
|
11 |
+
|
12 |
+
# Configure logging
|
13 |
+
logging.basicConfig(level=logging.INFO)
|
14 |
+
logger = logging.getLogger(__name__)
|
15 |
|
16 |
# System prompts for different AI roles
|
17 |
CONVERSATION_PROMPT = """
|
|
|
380 |
return "Advisor initialized! Let's discuss your career."
|
381 |
|
382 |
def chat(message: str, history: List):
|
383 |
+
if not advisor:
|
384 |
+
return "Please enter your API key first.", history
|
385 |
+
|
386 |
+
response = advisor.chat(message)
|
387 |
+
history.append((message, response))
|
388 |
+
return "", history
|
389 |
+
|
390 |
+
def analyze():
|
391 |
if not advisor:
|
392 |
return "Please enter your API key first.", None
|
393 |
|
|
|
451 |
|
452 |
if __name__ == "__main__":
|
453 |
demo = create_interface()
|
454 |
+
demo.launch()
|