-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathside_bar.py
38 lines (32 loc) · 1.61 KB
/
side_bar.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import streamlit as st
from dotenv import load_dotenv
import os
load_dotenv()
def sidebar():
with st.sidebar:
st.markdown(
"## How to use\n"
"1. Enter your [OpenAI API key](https://platform.openai.com/account/api-keys) and [Anthropic key](https://console.anthropic.com/login?returnTo=%2F) below🔑\n" # noqa: E501
"2. Upload a pdf, docx, or txt file📄 description of your invention\n"
"3. Upload a pdf, docx, or txt file📄 of an existing patent\n"
"4. patently will compare and contrast the documents and help you understand if the patent poses "
"difficulties for a potential patent on your own invention.\n"
)
api_key_input = st.text_input(
"OpenAI API Key",
type="password",
placeholder="Paste your OpenAI API key here (sk-...)",
help="You can get your API key from https://platform.openai.com/account/api-keys.", # noqa: E501
value=os.environ.get("OPENAI_API_KEY", None)
or st.session_state.get("OPENAI_API_KEY", ""),
)
st.session_state["OPENAI_API_KEY"] = api_key_input
api_key_input = st.text_input(
"Anthropic API Key",
type="password",
placeholder="Paste your Anthropic API key here",
help="You can get your API key from https://console.anthropic.com/login?returnTo=%2F.", # noqa: E501
value=os.environ.get("ANTHROPIC_API_KEY", None)
or st.session_state.get("ANTHROPIC_API_KEY", ""),
)
st.session_state["ANTHROPIC_API_KEY"] = api_key_input