RaghavenderReddy commited on
Commit
6dbe47c
Β·
verified Β·
1 Parent(s): db16d10

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +19 -16
  2. autoguru.py +54 -0
  3. requirements.txt +3 -0
README.md CHANGED
@@ -1,20 +1,23 @@
1
- ---
2
- title: Autu Guru 2.0
3
- emoji: πŸš€
4
- colorFrom: red
5
- colorTo: red
6
- sdk: docker
7
- app_port: 8501
8
- tags:
9
- - streamlit
10
- pinned: false
11
- short_description: Streamlit template space
12
- license: mit
13
  ---
14
 
15
- # Welcome to Streamlit!
16
 
17
- Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
 
 
 
 
 
18
 
19
- If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
20
- forums](https://discuss.streamlit.io).
 
 
 
 
 
 
 
1
+ # 🏍️ AutoGuru – Your Ultimate Automotive AI Assistant
2
+
3
+ **AutoGuru** is a powerful Streamlit-based AI assistant that provides expert-level information and support for everything related to **cars and motorcycles**. Whether you're an auto enthusiast, a beginner, or a professional, AutoGuru is here to help with instant insights and comparisons.
4
+
 
 
 
 
 
 
 
 
5
  ---
6
 
7
+ ## πŸš— Features
8
 
9
+ - πŸ” **Vehicle Lookup**: Get detailed specs and histories of bikes and cars
10
+ - πŸ”§ **Repair Guidance**: Step-by-step solutions for common maintenance tasks
11
+ - πŸ› οΈ **Customization Tips**: Advice on modifications and tuning
12
+ - πŸ“° **Latest News**: Stay updated with auto trends, launches, and tech
13
+ - βš–οΈ **Smart Comparison**: Compare models based on performance, price, and more
14
+ - 🌐 **Wikipedia Integration**: Instant fetch of trusted automotive info
15
 
16
+ ---
17
+
18
+ ## πŸ“¦ Requirements
19
+
20
+ - Python 3.7+
21
+ - streamlit
22
+ - wikipedia
23
+ - (Optional) openai for GPT integration
autoguru.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import wikipedia
3
+ import openai
4
+ import os
5
+
6
+ # Set your OpenAI API Key here
7
+ openai.api_key = st.secrets["OPENAI_API_KEY"] if "OPENAI_API_KEY" in st.secrets else "your-api-key-here"
8
+
9
+ st.set_page_config(page_title="AutoGuru", page_icon="πŸš—")
10
+ st.title("🏍️ AutoGuru – Ask Me Anything!")
11
+
12
+ st.write("I'm your AI assistant for cars, bikes, and anything else you'd like to know.")
13
+
14
+ # Sidebar with example questions
15
+ with st.sidebar:
16
+ st.subheader("πŸ’‘ Try asking:")
17
+ st.markdown("- What is a turbocharger?")
18
+ st.markdown("- How does ABS work?")
19
+ st.markdown("- Who invented the motorcycle?")
20
+ st.markdown("- How to boost mileage of a bike?")
21
+ st.markdown("- What is Python used for?")
22
+
23
+ # Question input
24
+ user_input = st.text_input("πŸ” Ask your question:")
25
+
26
+ # Ask GPT (OpenAI)
27
+ def ask_gpt(question):
28
+ try:
29
+ response = openai.ChatCompletion.create(
30
+ model="gpt-3.5-turbo", # or "gpt-4" if you have access
31
+ messages=[
32
+ {"role": "system", "content": "You are AutoGuru, an expert AI assistant in automobiles and general knowledge."},
33
+ {"role": "user", "content": question}
34
+ ]
35
+ )
36
+ return response['choices'][0]['message']['content'].strip()
37
+ except Exception as e:
38
+ return f"Error: {e}"
39
+
40
+ # Try Wikipedia first
41
+ def ask_wikipedia(question):
42
+ try:
43
+ return wikipedia.summary(question, sentences=3)
44
+ except:
45
+ return None
46
+
47
+ # Answer Logic
48
+ if user_input:
49
+ with st.spinner("Thinking..."):
50
+ answer = ask_wikipedia(user_input)
51
+ if not answer:
52
+ answer = ask_gpt(user_input)
53
+ st.success("βœ… Answer:")
54
+ st.write(answer)
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ streamlit
2
+ openai
3
+ wikipedia