Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,21 +11,30 @@ import torch
|
|
| 11 |
import getpass
|
| 12 |
|
| 13 |
|
| 14 |
-
# Prompt the user to enter their API key
|
| 15 |
-
|
| 16 |
|
| 17 |
# Check if the API key has been provided
|
| 18 |
-
if
|
| 19 |
# Use the API key in your app
|
| 20 |
-
st.write("API Key is set.")
|
| 21 |
else:
|
| 22 |
-
st.write("Please enter your API key.")
|
| 23 |
|
|
|
|
|
|
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# Initialize LangChain client (hypothetical example)
|
| 26 |
-
lc_client = Client(api_key=LANGCHAIN_API_KEY)
|
| 27 |
|
| 28 |
-
GROQ_API_KEY =
|
| 29 |
from langchain_groq import ChatGroq
|
| 30 |
|
| 31 |
llm = ChatGroq(model="llama3-8b-8192")
|
|
|
|
| 11 |
import getpass
|
| 12 |
|
| 13 |
|
| 14 |
+
# Prompt the user to enter their Langchain API key
|
| 15 |
+
api_key_lanchain = st.text_input("Enter your LANGCHAIN_API_KEY", type="password")
|
| 16 |
|
| 17 |
# Check if the API key has been provided
|
| 18 |
+
if api_key_langchain:
|
| 19 |
# Use the API key in your app
|
| 20 |
+
st.write("LangChain API Key is set.")
|
| 21 |
else:
|
| 22 |
+
st.write("Please enter your LangChain API key.")
|
| 23 |
|
| 24 |
+
# Prompt the user to enter their Groq API key
|
| 25 |
+
api_key_Groq = st.text_input("Enter your Groq_API_KEY", type="password")
|
| 26 |
|
| 27 |
+
# Check if the Groq API key has been provided
|
| 28 |
+
if api_key_Groq:
|
| 29 |
+
# Use the Groq API key in your app
|
| 30 |
+
st.write("Groq API Key is set.")
|
| 31 |
+
else:
|
| 32 |
+
st.write("Please enter your Groq API key.")
|
| 33 |
+
|
| 34 |
# Initialize LangChain client (hypothetical example)
|
| 35 |
+
#lc_client = Client(api_key=LANGCHAIN_API_KEY)
|
| 36 |
|
| 37 |
+
GROQ_API_KEY = api_key_Groq
|
| 38 |
from langchain_groq import ChatGroq
|
| 39 |
|
| 40 |
llm = ChatGroq(model="llama3-8b-8192")
|