Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ from langchain_core.output_parsers import StrOutputParser
|
|
| 12 |
from langchain_community.chat_message_histories import ChatMessageHistory
|
| 13 |
|
| 14 |
# 1. Configuration - Use OpenRouter API Key
|
| 15 |
-
os.environ["OPENROUTER_API_KEY"] = "sk-or-v1-
|
| 16 |
|
| 17 |
# 2. Define the Persona Template
|
| 18 |
SYSTEM_PROMPT = """You are an AI mental health and well-being companion named MindMate.
|
|
@@ -35,7 +35,7 @@ Rules:
|
|
| 35 |
llm = ChatOpenAI(
|
| 36 |
api_key=os.environ.get("OPENROUTER_API_KEY"),
|
| 37 |
base_url="https://openrouter.ai/api/v1", # <-- Point to OpenRouter instead of OpenAI
|
| 38 |
-
model="
|
| 39 |
temperature=0.5,
|
| 40 |
default_headers={
|
| 41 |
"HTTP-Referer": "http://localhost:7860", # Optional: Used by OpenRouter for app rankings
|
|
|
|
| 12 |
from langchain_community.chat_message_histories import ChatMessageHistory
|
| 13 |
|
| 14 |
# 1. Configuration - Use OpenRouter API Key
|
| 15 |
+
os.environ["OPENROUTER_API_KEY"] = "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" # <-- Uncommented and replace with your actual API key
|
| 16 |
|
| 17 |
# 2. Define the Persona Template
|
| 18 |
SYSTEM_PROMPT = """You are an AI mental health and well-being companion named MindMate.
|
|
|
|
| 35 |
llm = ChatOpenAI(
|
| 36 |
api_key=os.environ.get("OPENROUTER_API_KEY"),
|
| 37 |
base_url="https://openrouter.ai/api/v1", # <-- Point to OpenRouter instead of OpenAI
|
| 38 |
+
model="deepseek/deepseek-v4-flash", # <-- Swap this with ANY model ID from OpenRouter
|
| 39 |
temperature=0.5,
|
| 40 |
default_headers={
|
| 41 |
"HTTP-Referer": "http://localhost:7860", # Optional: Used by OpenRouter for app rankings
|