Shubham Saboo
Shubham Saboo

@Saboo_Shubham_

10 Tweets 4 reads May 31, 2024
Build an AI Research Assistant with GPT-4o in just 15 lines of Python Code (step-by-step instructions):
1. Install the necessary Python Libraries
Run the following command from your terminal.
2. Import necessary libraries
β€’ Streamlit for building the web app
β€’ Phidata for building AI agents
β€’ OpenAI for using the gpt-4o
β€’ arXiv to access the research papers
3. Set up the Streamlit App
Streamlit lets you create user interface with just python code, for this app we will:
β€’ Add a title to the app using 'st.title()'
β€’ Add a description for the app using 'st.caption()'
4. Create and Initialize the AI assistant
β€’ Create a text input to enter their OpenAI API key using 'st.text_input()'
β€’ If the OpenAI API key is provided, create an instance of Assistant with gpt-40 as LLM and ArxivToolkit as the tool.
5. Chat with Research papers
β€’ Create a text input for the user to enter their query using 'st.text_input()'
β€’ If a question is asked, run the assistant to get the answer and display it using 'st.write()'
Full RAG Application code to chat with research papersπŸ‘‡
Working Application demo using Streamlit
Paste the above code in vscode or pycharm and run the following command: 'streamlit run chat_arxiv.py'
If you find this useful, RT to share it with your friends.
Don't forget to follow me @Saboo_Shubham_ for more such LLMs tips and tutorials.
x.com

Loading suggestions...