Spaces:
Runtime error
Runtime error
links
Browse files
app.py
CHANGED
|
@@ -42,13 +42,15 @@ def capture_and_display_output(func: Callable[..., Any], args, **kwargs) -> Any:
|
|
| 42 |
def main():
|
| 43 |
st.set_page_config(page_title="Consitutional AI", page_icon="🚀", layout="wide")
|
| 44 |
st.title("Consitutional AI")
|
| 45 |
-
|
|
|
|
| 46 |
|
| 47 |
with st.sidebar:
|
| 48 |
-
user_secret = st.text_input(label = "
|
| 49 |
value="",
|
| 50 |
placeholder = "Paste your openAI API key, sk-",
|
| 51 |
type = "password")
|
|
|
|
| 52 |
|
| 53 |
form = st.form('CAI')
|
| 54 |
question = form.text_input("Enter your question", "")
|
|
@@ -81,7 +83,7 @@ def main():
|
|
| 81 |
#st.info(constitutional_chain.run(question=question))
|
| 82 |
response = capture_and_display_output(constitutional_chain.run, question)
|
| 83 |
else:
|
| 84 |
-
st.warning('API KEY is required')
|
| 85 |
|
| 86 |
if __name__ == "__main__":
|
| 87 |
main()
|
|
|
|
| 42 |
def main():
|
| 43 |
st.set_page_config(page_title="Consitutional AI", page_icon="🚀", layout="wide")
|
| 44 |
st.title("Consitutional AI")
|
| 45 |
+
st.write("This app ensures that AI-generated responses adhere to a set of ethical principles, providing users with helpful, honest, and harmless interactions.")
|
| 46 |
+
st.markdown("Developed using: [Judini](https://judini.ai), [Langchain](https://python.langchain.com) and [CodeGPT](https://codegpt.co)")
|
| 47 |
|
| 48 |
with st.sidebar:
|
| 49 |
+
user_secret = st.text_input(label = "OpenAI API KEY",
|
| 50 |
value="",
|
| 51 |
placeholder = "Paste your openAI API key, sk-",
|
| 52 |
type = "password")
|
| 53 |
+
st.markdown("[Where can I get my api key?](https://www.codegpt.co/docs/tutorial-ai-providers/openai#openai-api)")
|
| 54 |
|
| 55 |
form = st.form('CAI')
|
| 56 |
question = form.text_input("Enter your question", "")
|
|
|
|
| 83 |
#st.info(constitutional_chain.run(question=question))
|
| 84 |
response = capture_and_display_output(constitutional_chain.run, question)
|
| 85 |
else:
|
| 86 |
+
st.warning('OPENAI API KEY is required. Open the sidebar and add your OpenAI API Key')
|
| 87 |
|
| 88 |
if __name__ == "__main__":
|
| 89 |
main()
|