Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -1,5 +1,4 @@ | |
| 1 | 
             
            import os
         | 
| 2 | 
            -
            from getpass import getpass
         | 
| 3 | 
             
            import streamlit as st
         | 
| 4 | 
             
            from llama_index.node_parser import SemanticSplitterNodeParser
         | 
| 5 | 
             
            from llama_index.embeddings import OpenAIEmbedding
         | 
| @@ -14,8 +13,7 @@ from llama_index.query_engine import RetrieverQueryEngine | |
| 14 | 
             
            # Streamlit interface for inputting API keys
         | 
| 15 | 
             
            st.title("Annual Report Summary Chatbot")
         | 
| 16 | 
             
            pinecone_api_key = os.getenv("PINECONE_API_KEY")
         | 
| 17 | 
            -
            openai_api_key = os.getenv("OPENAI_API_KEY") | 
| 18 | 
            -
             | 
| 19 |  | 
| 20 | 
             
            if pinecone_api_key and openai_api_key:
         | 
| 21 | 
             
                # This will be the model we use both for Node parsing and for vectorization
         | 
| @@ -58,7 +56,3 @@ if pinecone_api_key and openai_api_key: | |
| 58 | 
             
                if st.button("Submit"):
         | 
| 59 | 
             
                    llm_query = query_engine.query(user_query)
         | 
| 60 | 
             
                    st.write(llm_query.response)
         | 
| 61 | 
            -
             | 
| 62 | 
            -
            # Run the app
         | 
| 63 | 
            -
            if __name__ == "__main__":
         | 
| 64 | 
            -
                st.run()
         | 
|  | |
| 1 | 
             
            import os
         | 
|  | |
| 2 | 
             
            import streamlit as st
         | 
| 3 | 
             
            from llama_index.node_parser import SemanticSplitterNodeParser
         | 
| 4 | 
             
            from llama_index.embeddings import OpenAIEmbedding
         | 
|  | |
| 13 | 
             
            # Streamlit interface for inputting API keys
         | 
| 14 | 
             
            st.title("Annual Report Summary Chatbot")
         | 
| 15 | 
             
            pinecone_api_key = os.getenv("PINECONE_API_KEY")
         | 
| 16 | 
            +
            openai_api_key = os.getenv("OPENAI_API_KEY")
         | 
|  | |
| 17 |  | 
| 18 | 
             
            if pinecone_api_key and openai_api_key:
         | 
| 19 | 
             
                # This will be the model we use both for Node parsing and for vectorization
         | 
|  | |
| 56 | 
             
                if st.button("Submit"):
         | 
| 57 | 
             
                    llm_query = query_engine.query(user_query)
         | 
| 58 | 
             
                    st.write(llm_query.response)
         | 
|  | |
|  | |
|  | |
|  | 
