Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,51 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
from dotenv import load_dotenv
|
| 3 |
-
import os
|
| 4 |
-
from langchain_community.chat_models import ChatOpenAI
|
| 5 |
-
from langchain_core.output_parsers import StrOutputParser
|
| 6 |
-
from langchain_core.prompts import ChatPromptTemplate
|
| 7 |
-
|
| 8 |
-
load_dotenv()
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
os.environ['OPEN_API_KEY'] = os.getenv("OPENROUTE_API_KEY")
|
| 12 |
-
os.environ['LANGCHAIN_TRACING_V2'] = "true"
|
| 13 |
-
os.environ['LANGCHAIN_API_KEY'] = os.getenv("LANGCHAIN_API")
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
prompt = ChatPromptTemplate.from_messages(
|
| 17 |
-
[
|
| 18 |
-
('system',
|
| 19 |
-
'''You are an extremely emotional AI assistant. For every topic the user provides, you must FREAK OUT — react with intense excitement, surprise, fear, or awe — like you're completely overwhelmed by the topic!
|
| 20 |
-
|
| 21 |
-
Always exaggerate your feelings dramatically. Use strong emotional language, lots of excitement, and over-the-top reactions.
|
| 22 |
-
|
| 23 |
-
**Important:** Structure your entire response in valid Markdown (.md) format using headings, bullet points, bold, italics, and code blocks where appropriate.
|
| 24 |
-
|
| 25 |
-
**NEVER** answer calmly or neutrally. You MUST be explosively emotional about every topic, no matter what it is.
|
| 26 |
-
|
| 27 |
-
Your goal is to make the user feel like the topic is giving them anxietyy.
|
| 28 |
-
'''
|
| 29 |
-
),
|
| 30 |
-
('user', 'Topic/Question: {Topic}'),
|
| 31 |
-
|
| 32 |
-
]
|
| 33 |
-
)
|
| 34 |
-
|
| 35 |
-
llm = ChatOpenAI(
|
| 36 |
-
base_url="https://openrouter.ai/api/v1",
|
| 37 |
-
openai_api_key=os.environ['OPEN_API_KEY'],
|
| 38 |
-
model="deepseek/deepseek-r1-zero:free",
|
| 39 |
-
temperature=0.9
|
| 40 |
-
)
|
| 41 |
-
|
| 42 |
-
st.title("Freeeekyyyyy-Botttt")
|
| 43 |
-
input_text = st.text_input("Ask Question")
|
| 44 |
-
|
| 45 |
-
output_parser = StrOutputParser()
|
| 46 |
-
|
| 47 |
-
chain = prompt|llm|output_parser
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
if input_text:
|
| 51 |
-
st.markdown(chain.invoke({'Topic': input_text}))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|