Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -28,9 +28,10 @@ LANGCHAIN_PROJECT = "docu-help"
|
|
28 |
|
29 |
# Sidebar for model selection and Pinecone index name input
|
30 |
st.sidebar.title("Sidebar")
|
31 |
-
model_name = st.sidebar.radio("Choose a model:", ("gpt-3.5-turbo-1106", "gpt-4-0125-preview", "
|
32 |
openai_api_key2 = st.sidebar.text_input("Enter OpenAI Key: ")
|
33 |
groq_api_key = st.sidebar.text_input("Groq API Key: ")
|
|
|
34 |
pinecone_index_name = os.getenv("pinecone_index_name")
|
35 |
namespace_name = "crawlee"
|
36 |
|
@@ -87,8 +88,8 @@ def generate_response(prompt):
|
|
87 |
"""
|
88 |
prompt_template = ChatPromptTemplate.from_template(template)
|
89 |
|
90 |
-
if model_name == "
|
91 |
-
chat_model =
|
92 |
elif model_name == "mixtral-groq":
|
93 |
chat_model = ChatGroq(temperature=0, groq_api_key=groq_api_key, model_name="mixtral-8x7b-32768")
|
94 |
else:
|
|
|
28 |
|
29 |
# Sidebar for model selection and Pinecone index name input
|
30 |
st.sidebar.title("Sidebar")
|
31 |
+
model_name = st.sidebar.radio("Choose a model:", ("gpt-3.5-turbo-1106", "gpt-4-0125-preview", "Claude-Sonnet", "mixtral-groq"))
|
32 |
openai_api_key2 = st.sidebar.text_input("Enter OpenAI Key: ")
|
33 |
groq_api_key = st.sidebar.text_input("Groq API Key: ")
|
34 |
+
anthropic_api_key = st.sidebar.text_input("Claude API Key: ")
|
35 |
pinecone_index_name = os.getenv("pinecone_index_name")
|
36 |
namespace_name = "crawlee"
|
37 |
|
|
|
88 |
"""
|
89 |
prompt_template = ChatPromptTemplate.from_template(template)
|
90 |
|
91 |
+
if model_name == "Claude-Sonnet":
|
92 |
+
chat_model = ChatAnthropic(temperature=0, model="claude-3-sonnet-20240229", anthropic_api_key=anthropic_api_key)
|
93 |
elif model_name == "mixtral-groq":
|
94 |
chat_model = ChatGroq(temperature=0, groq_api_key=groq_api_key, model_name="mixtral-8x7b-32768")
|
95 |
else:
|