Sidd0316 commited on
Commit
c6a355c
·
1 Parent(s): ab67cc3

Finalized project cleanup before submission

Browse files
__pycache__/app.cpython-312.pyc CHANGED
Binary files a/__pycache__/app.cpython-312.pyc and b/__pycache__/app.cpython-312.pyc differ
 
__pycache__/test_openrouter.cpython-312.pyc ADDED
Binary file (1.08 kB). View file
 
docs/build/doctrees/environment.pickle CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2bf54afe7c1051ad4d44786eac436159139c23a29404db25994644da281786d6
3
- size 24356
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2e48924ab312ea07e3b0d3dc5fc11c6fdd3db3137657febea0d6247630ad7b8
3
+ size 28261
docs/build/doctrees/index.doctree CHANGED
Binary files a/docs/build/doctrees/index.doctree and b/docs/build/doctrees/index.doctree differ
 
docs/build/doctrees/use_cases.doctree ADDED
Binary file (21.3 kB). View file
 
docs/build/html/_sources/index.rst.txt CHANGED
@@ -15,6 +15,7 @@ Welcome to Solar AI Assistant's Docs!
15
  api_reference
16
  contributing
17
  modules
 
18
  ======================================
19
  About Solar AI Assistant
20
  ======================================
@@ -26,3 +27,16 @@ It allows users to ask questions and get responses based on advanced AI models.
26
  - Interactive UI using Streamlit
27
  - Integration with OpenRouter API
28
  - Simple and easy-to-use interface
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  api_reference
16
  contributing
17
  modules
18
+ use_cases
19
  ======================================
20
  About Solar AI Assistant
21
  ======================================
 
27
  - Interactive UI using Streamlit
28
  - Integration with OpenRouter API
29
  - Simple and easy-to-use interface
30
+
31
+
32
+
33
+ Future Improvements
34
+ ====================
35
+
36
+ While the Solar AI Assistant is functional, there are several potential improvements:
37
+
38
+ - **Enhanced Context Management**: Improve multi-turn conversations to remember past user queries.
39
+ - **Solar Panel Recommendations**: Suggest solar panels based on location and budget.
40
+ - **Live Energy Savings Calculator**: Estimate electricity savings dynamically.
41
+ - **Multilingual Support**: Expand language options beyond English.
42
+ - **Mobile App Integration**: Develop a mobile-friendly interface.
docs/build/html/_sources/use_cases.rst.txt ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ======================
2
+ Example Use Cases
3
+ ======================
4
+
5
+ This section provides real-world examples of how users interact with the **Solar AI Assistant**.
6
+
7
+ 🏠 **Use Case 1: Homeowner Interested in Solar Energy**
8
+ --------------------------------------------------------
9
+
10
+ 🧑 **User:**
11
+ *"How much do solar panels cost for a house?"*
12
+
13
+ 🤖 **AI:**
14
+ *"The cost of solar panels for a house depends on several factors, including system size, location, and available incentives. On average:*
15
+ • A 5kW solar system costs ₹2,00,000 - ₹3,50,000 in India before incentives.
16
+ • Government subsidies can reduce costs by 30-40% under certain programs.
17
+ • The payback period is usually 5-7 years based on electricity savings."*
18
+
19
+ 🧑 **User:**
20
+ *"How much will I save on electricity bills?"*
21
+
22
+ 🤖 **AI:**
23
+ *"Solar savings depend on:*
24
+ ✅ Sunlight availability in your location.
25
+ ✅ Electricity consumption (higher bills = more savings).
26
+ ✅ Net metering (selling extra power back to the grid).
27
+
28
+ 💡 **Example Calculation:**
29
+ • Before Solar: ₹3,000/month electricity bill.
30
+ • After Solar: ₹500/month (80% savings).
31
+ • **Annual Savings:** ₹30,000 (₹3,000 x 12 months).
32
+ • **10-year Savings:** ₹3,00,000! 🎉"*
33
+
34
+ ---
35
+
36
+ 🏢 **Use Case 2: Business Owner Exploring Commercial Solar**
37
+ ------------------------------------------------------------
38
+
39
+ 🧑 **User:**
40
+ *"Is solar energy a good investment for my business?"*
41
+
42
+ 🤖 **AI:**
43
+ *"Yes! Here’s why commercial solar is a smart investment:*
44
+ 🔹 Lower electricity costs: Save up to 50-80% on power bills.
45
+ 🔹 Tax benefits: Businesses can claim depreciation & subsidies.
46
+ 🔹 ROI in 3-5 years: With net metering, extra energy earns credits.
47
+ 🔹 Sustainability: Green branding improves reputation & compliance."*
48
+
49
+ 🧑 **User:**
50
+ *"What incentives are available for businesses?"*
51
+
52
+ 🤖 **AI:**
53
+ *"Indian businesses can benefit from:*
54
+ 💰 Accelerated Depreciation: 40% depreciation in the first year.
55
+ ⚡ Net Metering: Sell excess power to the grid.
56
+ 🏢 Government Subsidies: Up to 30% for some industries.
57
+ 📜 State Incentives: Vary by region (Delhi, Maharashtra, etc.)."*
58
+
59
+ ---
60
+
61
+ 🎓 **Use Case 3: Student Learning About Solar Energy**
62
+ ------------------------------------------------------
63
+
64
+ 🧑 **User:**
65
+ *"How do solar panels generate electricity?"*
66
+
67
+ 🤖 **AI:**
68
+ *"Solar panels generate electricity using the **photovoltaic effect**.*
69
+ 🔹 Step 1: Sunlight hits solar cells (made of silicon).
70
+ 🔹 Step 2: Photons excite electrons, creating an electric flow.
71
+ 🔹 Step 3: The inverter converts DC power to AC for home use.
72
+ 🔹 Step 4: Power is used or sent to the grid for credits."*
73
+
74
+ 🧑 **User:**
75
+ *"What is the efficiency of monocrystalline vs. polycrystalline panels?"*
76
+
77
+ 🤖 **AI:**
78
+ *"🔹 **Monocrystalline Panels:**
79
+ • **Efficiency:** 15-22% (higher efficiency).
80
+ • **Cost:** More expensive but better performance.
81
+ • **Lifespan:** 25+ years.
82
+
83
+ 🔹 **Polycrystalline Panels:**
84
+ • **Efficiency:** 12-18% (slightly lower).
85
+ • **Cost:** More affordable.
86
+ • **Lifespan:** 20-25 years.
87
+
88
+ 💡 **Monocrystalline =** Best for limited space, maximum efficiency.
89
+ 💡 **Polycrystalline =** Best for budget-friendly installations."*
90
+
91
+ ---
92
+
93
+ 🌍 **Use Case 4: Environmentalist Curious About Solar's Impact**
94
+ ----------------------------------------------------------------
95
+
96
+ 🧑 **User:**
97
+ *"How does solar energy help the environment?"*
98
+
99
+ 🤖 **AI:**
100
+ *"Solar energy helps the environment by:*
101
+ ✅ **Reducing Carbon Footprint** – Solar energy reduces CO₂ emissions by replacing fossil fuels.
102
+ ✅ **Saving Water** – Unlike coal power plants, solar energy does not require water cooling.
103
+ ✅ **Preventing Air Pollution** – No harmful emissions like SO₂, NOₓ, or particulate matter.
104
+ ✅ **Reducing Land Degradation** – Solar farms do not involve mining, unlike coal and gas."*
105
+
106
+ 🧑 **User:**
107
+ *"Can solar panels be recycled?"*
108
+
109
+ 🤖 **AI:**
110
+ *"Yes! Solar panels can be recycled to recover materials like:*
111
+ ♻️ **Silicon** (95%)
112
+ ♻️ **Glass** (90%)
113
+ ♻️ **Aluminum** (100%)
114
+ 🔹 Recycling plants in India & worldwide help manage end-of-life solar waste."*
docs/build/html/app.html CHANGED
@@ -44,11 +44,17 @@
44
  </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
45
  <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
46
  <ul class="current">
 
 
 
 
 
47
  <li class="toctree-l1 current"><a class="reference internal" href="modules.html">solar-ai-assistant1</a><ul class="current">
48
  <li class="toctree-l2 current"><a class="current reference internal" href="#">app module</a></li>
49
  <li class="toctree-l2"><a class="reference internal" href="test_openrouter.html">test_openrouter module</a></li>
50
  </ul>
51
  </li>
 
52
  </ul>
53
 
54
  </div>
 
44
  </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
45
  <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
46
  <ul class="current">
47
+ <li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
48
+ <li class="toctree-l1"><a class="reference internal" href="installation.html">Installation Guide</a></li>
49
+ <li class="toctree-l1"><a class="reference internal" href="usage.html">Usage Guide</a></li>
50
+ <li class="toctree-l1"><a class="reference internal" href="api_reference.html">API Reference</a></li>
51
+ <li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
52
  <li class="toctree-l1 current"><a class="reference internal" href="modules.html">solar-ai-assistant1</a><ul class="current">
53
  <li class="toctree-l2 current"><a class="current reference internal" href="#">app module</a></li>
54
  <li class="toctree-l2"><a class="reference internal" href="test_openrouter.html">test_openrouter module</a></li>
55
  </ul>
56
  </li>
57
+ <li class="toctree-l1"><a class="reference internal" href="use_cases.html">Example Use Cases</a></li>
58
  </ul>
59
 
60
  </div>
docs/build/html/genindex.html CHANGED
@@ -47,6 +47,7 @@
47
  <li class="toctree-l1"><a class="reference internal" href="api_reference.html">API Reference</a></li>
48
  <li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
49
  <li class="toctree-l1"><a class="reference internal" href="modules.html">solar-ai-assistant1</a></li>
 
50
  </ul>
51
 
52
  </div>
 
47
  <li class="toctree-l1"><a class="reference internal" href="api_reference.html">API Reference</a></li>
48
  <li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
49
  <li class="toctree-l1"><a class="reference internal" href="modules.html">solar-ai-assistant1</a></li>
50
+ <li class="toctree-l1"><a class="reference internal" href="use_cases.html">Example Use Cases</a></li>
51
  </ul>
52
 
53
  </div>
docs/build/html/index.html CHANGED
@@ -49,6 +49,7 @@
49
  <li class="toctree-l1"><a class="reference internal" href="api_reference.html">API Reference</a></li>
50
  <li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
51
  <li class="toctree-l1"><a class="reference internal" href="modules.html">solar-ai-assistant1</a></li>
 
52
  </ul>
53
 
54
  </div>
@@ -96,6 +97,13 @@
96
  <li class="toctree-l2"><a class="reference internal" href="test_openrouter.html">test_openrouter module</a></li>
97
  </ul>
98
  </li>
 
 
 
 
 
 
 
99
  </ul>
100
  </div>
101
  </section>
@@ -108,6 +116,17 @@ It allows users to ask questions and get responses based on advanced AI models.<
108
  - Interactive UI using Streamlit
109
  - Integration with OpenRouter API
110
  - Simple and easy-to-use interface</p>
 
 
 
 
 
 
 
 
 
 
 
111
  </section>
112
 
113
 
 
49
  <li class="toctree-l1"><a class="reference internal" href="api_reference.html">API Reference</a></li>
50
  <li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
51
  <li class="toctree-l1"><a class="reference internal" href="modules.html">solar-ai-assistant1</a></li>
52
+ <li class="toctree-l1"><a class="reference internal" href="use_cases.html">Example Use Cases</a></li>
53
  </ul>
54
 
55
  </div>
 
97
  <li class="toctree-l2"><a class="reference internal" href="test_openrouter.html">test_openrouter module</a></li>
98
  </ul>
99
  </li>
100
+ <li class="toctree-l1"><a class="reference internal" href="use_cases.html">Example Use Cases</a><ul>
101
+ <li class="toctree-l2"><a class="reference internal" href="use_cases.html#use-case-1-homeowner-interested-in-solar-energy">🏠 <strong>Use Case 1: Homeowner Interested in Solar Energy</strong></a></li>
102
+ <li class="toctree-l2"><a class="reference internal" href="use_cases.html#use-case-2-business-owner-exploring-commercial-solar">🏢 <strong>Use Case 2: Business Owner Exploring Commercial Solar</strong></a></li>
103
+ <li class="toctree-l2"><a class="reference internal" href="use_cases.html#use-case-3-student-learning-about-solar-energy">🎓 <strong>Use Case 3: Student Learning About Solar Energy</strong></a></li>
104
+ <li class="toctree-l2"><a class="reference internal" href="use_cases.html#use-case-4-environmentalist-curious-about-solar-s-impact">🌍 <strong>Use Case 4: Environmentalist Curious About Solar’s Impact</strong></a></li>
105
+ </ul>
106
+ </li>
107
  </ul>
108
  </div>
109
  </section>
 
116
  - Interactive UI using Streamlit
117
  - Integration with OpenRouter API
118
  - Simple and easy-to-use interface</p>
119
+ <section id="future-improvements">
120
+ <h2>Future Improvements<a class="headerlink" href="#future-improvements" title="Link to this heading"></a></h2>
121
+ <p>While the Solar AI Assistant is functional, there are several potential improvements:</p>
122
+ <ul class="simple">
123
+ <li><p><strong>Enhanced Context Management</strong>: Improve multi-turn conversations to remember past user queries.</p></li>
124
+ <li><p><strong>Solar Panel Recommendations</strong>: Suggest solar panels based on location and budget.</p></li>
125
+ <li><p><strong>Live Energy Savings Calculator</strong>: Estimate electricity savings dynamically.</p></li>
126
+ <li><p><strong>Multilingual Support</strong>: Expand language options beyond English.</p></li>
127
+ <li><p><strong>Mobile App Integration</strong>: Develop a mobile-friendly interface.</p></li>
128
+ </ul>
129
+ </section>
130
  </section>
131
 
132
 
docs/build/html/modules.html CHANGED
@@ -20,7 +20,7 @@
20
  <link rel="index" title="Index" href="genindex.html" />
21
  <link rel="search" title="Search" href="search.html" />
22
  <link rel="next" title="app module" href="app.html" />
23
- <link rel="prev" title="Welcome to Solar AI Assistant’s Documentation!" href="index.html" />
24
  </head>
25
 
26
  <body class="wy-body-for-nav">
@@ -44,11 +44,17 @@
44
  </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
45
  <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
46
  <ul class="current">
 
 
 
 
 
47
  <li class="toctree-l1 current"><a class="current reference internal" href="#">solar-ai-assistant1</a><ul>
48
  <li class="toctree-l2"><a class="reference internal" href="app.html">app module</a></li>
49
  <li class="toctree-l2"><a class="reference internal" href="test_openrouter.html">test_openrouter module</a></li>
50
  </ul>
51
  </li>
 
52
  </ul>
53
 
54
  </div>
@@ -89,7 +95,7 @@
89
  </div>
90
  </div>
91
  <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
92
- <a href="index.html" class="btn btn-neutral float-left" title="Welcome to Solar AI Assistant’s Documentation!" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
93
  <a href="app.html" class="btn btn-neutral float-right" title="app module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
94
  </div>
95
 
 
20
  <link rel="index" title="Index" href="genindex.html" />
21
  <link rel="search" title="Search" href="search.html" />
22
  <link rel="next" title="app module" href="app.html" />
23
+ <link rel="prev" title="Contributing" href="contributing.html" />
24
  </head>
25
 
26
  <body class="wy-body-for-nav">
 
44
  </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
45
  <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
46
  <ul class="current">
47
+ <li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
48
+ <li class="toctree-l1"><a class="reference internal" href="installation.html">Installation Guide</a></li>
49
+ <li class="toctree-l1"><a class="reference internal" href="usage.html">Usage Guide</a></li>
50
+ <li class="toctree-l1"><a class="reference internal" href="api_reference.html">API Reference</a></li>
51
+ <li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
52
  <li class="toctree-l1 current"><a class="current reference internal" href="#">solar-ai-assistant1</a><ul>
53
  <li class="toctree-l2"><a class="reference internal" href="app.html">app module</a></li>
54
  <li class="toctree-l2"><a class="reference internal" href="test_openrouter.html">test_openrouter module</a></li>
55
  </ul>
56
  </li>
57
+ <li class="toctree-l1"><a class="reference internal" href="use_cases.html">Example Use Cases</a></li>
58
  </ul>
59
 
60
  </div>
 
95
  </div>
96
  </div>
97
  <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
98
+ <a href="contributing.html" class="btn btn-neutral float-left" title="Contributing" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
99
  <a href="app.html" class="btn btn-neutral float-right" title="app module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
100
  </div>
101
 
docs/build/html/objects.inv CHANGED
Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ
 
docs/build/html/py-modindex.html CHANGED
@@ -54,6 +54,7 @@
54
  <li class="toctree-l1"><a class="reference internal" href="api_reference.html">API Reference</a></li>
55
  <li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
56
  <li class="toctree-l1"><a class="reference internal" href="modules.html">solar-ai-assistant1</a></li>
 
57
  </ul>
58
 
59
  </div>
 
54
  <li class="toctree-l1"><a class="reference internal" href="api_reference.html">API Reference</a></li>
55
  <li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
56
  <li class="toctree-l1"><a class="reference internal" href="modules.html">solar-ai-assistant1</a></li>
57
+ <li class="toctree-l1"><a class="reference internal" href="use_cases.html">Example Use Cases</a></li>
58
  </ul>
59
 
60
  </div>
docs/build/html/search.html CHANGED
@@ -50,6 +50,7 @@
50
  <li class="toctree-l1"><a class="reference internal" href="api_reference.html">API Reference</a></li>
51
  <li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
52
  <li class="toctree-l1"><a class="reference internal" href="modules.html">solar-ai-assistant1</a></li>
 
53
  </ul>
54
 
55
  </div>
 
50
  <li class="toctree-l1"><a class="reference internal" href="api_reference.html">API Reference</a></li>
51
  <li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
52
  <li class="toctree-l1"><a class="reference internal" href="modules.html">solar-ai-assistant1</a></li>
53
+ <li class="toctree-l1"><a class="reference internal" href="use_cases.html">Example Use Cases</a></li>
54
  </ul>
55
 
56
  </div>
docs/build/html/searchindex.js CHANGED
@@ -1 +1 @@
1
- Search.setIndex({"alltitles":{"API Reference":[[0,null]],"About Solar AI Assistant":[[3,"about-solar-ai-assistant"]],"Contents:":[[3,null]],"Contributing":[[2,null]],"Fork the Repository":[[2,"fork-the-repository"]],"How to Contribute":[[2,"how-to-contribute"]],"Installation Guide":[[4,null]],"Introduction":[[5,null]],"Usage Guide":[[8,null]],"Welcome to Solar AI Assistant\u2019s Docs!":[[3,null]],"app module":[[1,null]],"solar-ai-assistant1":[[6,null]],"test_openrouter module":[[7,null]],"\ud83d\udccc Base URL":[[0,"base-url"]]},"docnames":["api_reference","app","contributing","index","installation","introduction","modules","test_openrouter","usage"],"envversion":{"sphinx":65,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1},"filenames":["api_reference.rst","app.rst","contributing.rst","index.rst","installation.rst","introduction.rst","modules.rst","test_openrouter.rst","usage.rst"],"indexentries":{},"objects":{"":[[1,0,0,"-","app"],[7,0,0,"-","test_openrouter"]]},"objnames":{"0":["py","module","Python module"]},"objtypes":{"0":"py:module"},"terms":{"1":[],"10":4,"3":4,"It":[3,5],"The":0,"To":8,"ad":2,"advanc":3,"ai":[0,2,4,5,8],"allow":3,"an":5,"answer":[3,5],"api":[3,5],"app":[3,6,8],"applic":8,"appreci":2,"ar":2,"ask":3,"assist":[0,2,5,8],"assistant1":[2,3,4],"backend":5,"base":3,"bug":2,"built":[0,5],"button":2,"can":5,"cd":[2,4],"chat":5,"chatbot":5,"click":2,"clone":[2,4],"co":[2,4],"code":4,"command":4,"contribut":3,"control":4,"cover":[],"customiz":5,"describ":0,"design":3,"detail":[],"develop":[],"document":[2,5],"easi":3,"endpoint":0,"energi":[3,5],"ensur":4,"error":0,"explain":8,"explor":5,"face":[0,2],"fast":5,"fastapi":[0,5],"featur":[2,3,5],"fix":2,"folder":8,"follow":[2,4],"fork":[],"format":0,"friendli":5,"frontend":5,"gener":5,"get":3,"git":[2,4],"guid":3,"handl":0,"have":4,"host":0,"how":[3,8],"http":[2,4],"hug":[0,2],"huggingfac":[2,4],"i":[0,3,5],"improv":2,"index":[],"industri":5,"insight":[3,5],"instal":3,"integr":3,"interact":[3,5],"interest":5,"interfac":[3,5],"introduct":3,"its":[],"kei":5,"lightweight":5,"manag":4,"model":3,"modul":[3,6],"navig":8,"need":5,"new":2,"open":5,"openrout":[0,3,5],"packag":4,"page":[],"pip":4,"power":[3,5],"powershel":4,"prerequisit":4,"process":5,"profession":5,"project":8,"provid":[3,5],"py":8,"python":4,"queri":3,"question":3,"quick":5,"re":2,"refer":3,"repositori":4,"request":0,"research":5,"respons":[3,5],"run":[4,8],"search":[],"section":0,"setup":[],"sh":8,"sidd0316":4,"simpl":3,"solar":[0,2,4,5,8],"sourc":5,"space":[0,2,4],"start":8,"step":2,"streamlit":[3,5,8],"student":5,"termin":4,"test_openrout":[3,6],"thi":[0,8],"tool":3,"ui":[3,5],"url":3,"us":[0,3,5,8],"usag":3,"user":[3,5],"v":4,"version":4,"we":2,"welcom":[2,5],"what":5,"whether":2,"who":5,"you":[2,4],"your":[2,4,8],"your_usernam":2},"titles":["API Reference","app module","Contributing","Welcome to Solar AI Assistant\u2019s Docs!","Installation Guide","Introduction","solar-ai-assistant1","test_openrouter module","Usage Guide"],"titleterms":{"":3,"about":3,"ai":[3,6],"api":0,"app":1,"assist":3,"assistant1":6,"base":0,"content":3,"contribut":2,"doc":3,"document":[],"fork":2,"guid":[4,8],"how":2,"indic":[],"instal":4,"introduct":5,"modul":[1,7],"refer":0,"repositori":2,"solar":[3,6],"tabl":[],"test_openrout":7,"url":0,"usag":8,"welcom":3}})
 
1
+ Search.setIndex({"alltitles":{"API Reference":[[0,null]],"About Solar AI Assistant":[[3,"about-solar-ai-assistant"]],"Contents:":[[3,null]],"Contributing":[[2,null]],"Example Use Cases":[[9,null]],"Fork the Repository":[[2,"fork-the-repository"]],"Future Improvements":[[3,"future-improvements"]],"How to Contribute":[[2,"how-to-contribute"]],"Installation Guide":[[4,null]],"Introduction":[[5,null]],"Usage Guide":[[8,null]],"Welcome to Solar AI Assistant\u2019s Docs!":[[3,null]],"app module":[[1,null]],"solar-ai-assistant1":[[6,null]],"test_openrouter module":[[7,null]],"\ud83c\udf0d Use Case 4: Environmentalist Curious About Solar\u2019s Impact":[[9,"use-case-4-environmentalist-curious-about-solar-s-impact"]],"\ud83c\udf93 Use Case 3: Student Learning About Solar Energy":[[9,"use-case-3-student-learning-about-solar-energy"]],"\ud83c\udfe0 Use Case 1: Homeowner Interested in Solar Energy":[[9,"use-case-1-homeowner-interested-in-solar-energy"]],"\ud83c\udfe2 Use Case 2: Business Owner Exploring Commercial Solar":[[9,"use-case-2-business-owner-exploring-commercial-solar"]],"\ud83d\udccc Base URL":[[0,"base-url"]]},"docnames":["api_reference","app","contributing","index","installation","introduction","modules","test_openrouter","usage","use_cases"],"envversion":{"sphinx":65,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1},"filenames":["api_reference.rst","app.rst","contributing.rst","index.rst","installation.rst","introduction.rst","modules.rst","test_openrouter.rst","usage.rst","use_cases.rst"],"indexentries":{},"objects":{"":[[1,0,0,"-","app"],[7,0,0,"-","test_openrouter"]]},"objnames":{"0":["py","module","Python module"]},"objtypes":{"0":"py:module"},"terms":{"00":9,"000":9,"1":3,"10":[4,9],"100":9,"12":9,"15":9,"18":9,"2":3,"20":9,"22":9,"25":9,"3":[3,4],"30":9,"4":3,"40":9,"5":9,"50":9,"500":9,"5kw":9,"7":9,"80":9,"90":9,"95":9,"A":9,"It":[3,5],"No":9,"On":9,"The":[0,9],"To":8,"With":9,"ac":9,"acceler":9,"ad":2,"advanc":3,"afford":9,"after":9,"ai":[0,2,4,5,8,9],"air":9,"allow":3,"aluminum":9,"an":[5,9],"annual":9,"answer":[3,5],"api":[3,5],"app":[3,6,8],"applic":8,"appreci":2,"ar":[2,3,9],"ask":3,"assist":[0,2,5,8,9],"assistant1":[2,3,4],"avail":9,"averag":9,"back":9,"backend":5,"base":[3,9],"befor":9,"benefit":9,"best":9,"better":9,"beyond":3,"bill":9,"brand":9,"budget":[3,9],"bug":2,"built":[0,5],"busi":3,"button":2,"calcul":[3,9],"can":[5,9],"carbon":9,"case":3,"cd":[2,4],"cell":9,"certain":9,"chat":5,"chatbot":5,"claim":9,"click":2,"clone":[2,4],"co":[2,4],"coal":9,"code":4,"command":4,"commerci":3,"complianc":9,"consumpt":9,"context":3,"contribut":3,"control":4,"convers":3,"convert":9,"cool":9,"cost":9,"cover":[],"co\u2082":9,"creat":9,"credit":9,"curiou":3,"customiz":5,"dc":9,"degrad":9,"delhi":9,"depend":9,"depreci":9,"describ":0,"design":3,"detail":[],"develop":3,"do":9,"document":[2,5],"doe":9,"dynam":3,"earn":9,"easi":3,"effect":9,"effici":9,"electr":[3,9],"electron":9,"emiss":9,"end":9,"endpoint":0,"energi":[3,5],"english":3,"enhanc":3,"ensur":4,"environ":9,"environmentalist":3,"error":0,"estim":3,"etc":9,"exampl":3,"excess":9,"excit":9,"expand":3,"expens":9,"explain":8,"explor":[3,5],"extra":9,"face":[0,2],"factor":9,"farm":9,"fast":5,"fastapi":[0,5],"featur":[2,3,5],"first":9,"fix":2,"flow":9,"folder":8,"follow":[2,4],"footprint":9,"fork":[],"format":0,"fossil":9,"friendli":[3,5,9],"from":9,"frontend":5,"fuel":9,"function":3,"ga":9,"gener":[5,9],"get":3,"git":[2,4],"glass":9,"good":9,"govern":9,"green":9,"grid":9,"guid":3,"handl":0,"harm":9,"have":4,"help":9,"here":9,"higher":9,"hit":9,"home":9,"homeown":3,"host":0,"hous":9,"how":[3,8,9],"http":[2,4],"hug":[0,2],"huggingfac":[2,4],"i":[0,3,5,9],"impact":3,"improv":[2,9],"incent":9,"includ":9,"index":[],"india":9,"indian":9,"industri":[5,9],"insight":[3,5],"instal":[3,9],"integr":3,"interact":[3,5,9],"interest":[3,5],"interfac":[3,5],"introduct":3,"invert":9,"invest":9,"involv":9,"its":[],"kei":5,"land":9,"languag":3,"learn":3,"life":9,"lifespan":9,"lightweight":5,"like":9,"limit":9,"live":3,"locat":[3,9],"lower":9,"made":9,"maharashtra":9,"manag":[3,4,9],"materi":9,"matter":9,"maximum":9,"meter":9,"mine":9,"mobil":3,"model":3,"modul":[3,6],"monocrystallin":9,"month":9,"more":9,"much":9,"multi":3,"multilingu":3,"my":9,"navig":8,"need":5,"net":9,"new":2,"no\u2093":9,"open":5,"openrout":[0,3,5],"option":3,"owner":3,"packag":4,"page":[],"panel":[3,9],"particul":9,"past":3,"payback":9,"perform":9,"period":9,"photon":9,"photovolta":9,"pip":4,"plant":9,"pollut":9,"polycrystallin":9,"potenti":3,"power":[3,5,9],"powershel":4,"prerequisit":4,"prevent":9,"process":5,"profession":5,"program":9,"project":8,"provid":[3,5,9],"py":8,"python":4,"queri":3,"question":3,"quick":5,"re":2,"real":9,"recommend":3,"recov":9,"recycl":9,"reduc":9,"refer":3,"region":9,"rememb":3,"replac":9,"repositori":4,"reput":9,"request":0,"requir":9,"research":5,"respons":[3,5],"roi":9,"run":[4,8],"save":[3,9],"search":[],"section":[0,9],"sell":9,"sent":9,"setup":[],"sever":[3,9],"sh":8,"sidd0316":4,"silicon":9,"simpl":3,"size":9,"slightli":9,"smart":9,"solar":[0,2,4,5,8],"some":9,"sourc":5,"so\u2082":9,"space":[0,2,4,9],"start":8,"state":9,"step":[2,9],"streamlit":[3,5,8],"student":[3,5],"subsidi":9,"suggest":3,"sunlight":9,"support":3,"sustain":9,"system":9,"tax":9,"termin":4,"test_openrout":[3,6],"thi":[0,8,9],"tool":3,"turn":3,"ui":[3,5],"under":9,"unlik":9,"up":9,"url":3,"us":[0,3,5,8],"usag":3,"user":[3,5,9],"usual":9,"v":[4,9],"vari":9,"version":4,"wast":9,"water":9,"we":2,"welcom":[2,5],"what":[5,9],"whether":2,"while":3,"who":5,"why":9,"world":9,"worldwid":9,"x":9,"ye":9,"year":9,"you":[2,4],"your":[2,4,8,9],"your_usernam":2},"titles":["API Reference","app module","Contributing","Welcome to Solar AI Assistant\u2019s Docs!","Installation Guide","Introduction","solar-ai-assistant1","test_openrouter module","Usage Guide","Example Use Cases"],"titleterms":{"":[3,9],"1":9,"2":9,"3":9,"4":9,"about":[3,9],"ai":[3,6],"api":0,"app":1,"assist":3,"assistant1":6,"base":0,"busi":9,"case":9,"commerci":9,"content":3,"contribut":2,"curiou":9,"doc":3,"document":[],"energi":9,"environmentalist":9,"exampl":9,"explor":9,"fork":2,"futur":3,"guid":[4,8],"homeown":9,"how":2,"impact":9,"improv":3,"indic":[],"instal":4,"interest":9,"introduct":5,"learn":9,"modul":[1,7],"owner":9,"refer":0,"repositori":2,"solar":[3,6,9],"student":9,"tabl":[],"test_openrout":7,"url":0,"us":9,"usag":8,"welcom":3}})
docs/build/html/use_cases.html ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ <!DOCTYPE html>
4
+ <html class="writer-html5" lang="en" data-content_root="./">
5
+ <head>
6
+ <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
7
+
8
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
+ <title>Example Use Cases &mdash; Solar AI Assistant 1.0.0 documentation</title>
10
+ <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
11
+ <link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
12
+
13
+
14
+ <script src="_static/jquery.js?v=5d32c60e"></script>
15
+ <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
16
+ <script src="_static/documentation_options.js?v=8d563738"></script>
17
+ <script src="_static/doctools.js?v=9bcbadda"></script>
18
+ <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
19
+ <script src="_static/js/theme.js"></script>
20
+ <link rel="index" title="Index" href="genindex.html" />
21
+ <link rel="search" title="Search" href="search.html" />
22
+ <link rel="prev" title="test_openrouter module" href="test_openrouter.html" />
23
+ </head>
24
+
25
+ <body class="wy-body-for-nav">
26
+ <div class="wy-grid-for-nav">
27
+ <nav data-toggle="wy-nav-shift" class="wy-nav-side">
28
+ <div class="wy-side-scroll">
29
+ <div class="wy-side-nav-search" >
30
+
31
+
32
+
33
+ <a href="index.html" class="icon icon-home">
34
+ Solar AI Assistant
35
+ </a>
36
+ <div role="search">
37
+ <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
38
+ <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
39
+ <input type="hidden" name="check_keywords" value="yes" />
40
+ <input type="hidden" name="area" value="default" />
41
+ </form>
42
+ </div>
43
+ </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
44
+ <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
45
+ <ul class="current">
46
+ <li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
47
+ <li class="toctree-l1"><a class="reference internal" href="installation.html">Installation Guide</a></li>
48
+ <li class="toctree-l1"><a class="reference internal" href="usage.html">Usage Guide</a></li>
49
+ <li class="toctree-l1"><a class="reference internal" href="api_reference.html">API Reference</a></li>
50
+ <li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
51
+ <li class="toctree-l1"><a class="reference internal" href="modules.html">solar-ai-assistant1</a></li>
52
+ <li class="toctree-l1 current"><a class="current reference internal" href="#">Example Use Cases</a><ul>
53
+ <li class="toctree-l2"><a class="reference internal" href="#use-case-1-homeowner-interested-in-solar-energy">🏠 <strong>Use Case 1: Homeowner Interested in Solar Energy</strong></a></li>
54
+ <li class="toctree-l2"><a class="reference internal" href="#use-case-2-business-owner-exploring-commercial-solar">🏢 <strong>Use Case 2: Business Owner Exploring Commercial Solar</strong></a></li>
55
+ <li class="toctree-l2"><a class="reference internal" href="#use-case-3-student-learning-about-solar-energy">🎓 <strong>Use Case 3: Student Learning About Solar Energy</strong></a></li>
56
+ <li class="toctree-l2"><a class="reference internal" href="#use-case-4-environmentalist-curious-about-solar-s-impact">🌍 <strong>Use Case 4: Environmentalist Curious About Solar’s Impact</strong></a></li>
57
+ </ul>
58
+ </li>
59
+ </ul>
60
+
61
+ </div>
62
+ </div>
63
+ </nav>
64
+
65
+ <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
66
+ <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
67
+ <a href="index.html">Solar AI Assistant</a>
68
+ </nav>
69
+
70
+ <div class="wy-nav-content">
71
+ <div class="rst-content">
72
+ <div role="navigation" aria-label="Page navigation">
73
+ <ul class="wy-breadcrumbs">
74
+ <li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
75
+ <li class="breadcrumb-item active">Example Use Cases</li>
76
+ <li class="wy-breadcrumbs-aside">
77
+ <a href="_sources/use_cases.rst.txt" rel="nofollow"> View page source</a>
78
+ </li>
79
+ </ul>
80
+ <hr/>
81
+ </div>
82
+ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
83
+ <div itemprop="articleBody">
84
+
85
+ <section id="example-use-cases">
86
+ <h1>Example Use Cases<a class="headerlink" href="#example-use-cases" title="Link to this heading"></a></h1>
87
+ <p>This section provides real-world examples of how users interact with the <strong>Solar AI Assistant</strong>.</p>
88
+ <section id="use-case-1-homeowner-interested-in-solar-energy">
89
+ <h2>🏠 <strong>Use Case 1: Homeowner Interested in Solar Energy</strong><a class="headerlink" href="#use-case-1-homeowner-interested-in-solar-energy" title="Link to this heading"></a></h2>
90
+ <p>🧑 <strong>User:</strong>
91
+ <em>“How much do solar panels cost for a house?”</em></p>
92
+ <p>🤖 <strong>AI:</strong>
93
+ <em>“The cost of solar panels for a house depends on several factors, including system size, location, and available incentives. On average:</em>
94
+ • A 5kW solar system costs ₹2,00,000 - ₹3,50,000 in India before incentives.
95
+ • Government subsidies can reduce costs by 30-40% under certain programs.
96
+ • The payback period is usually 5-7 years based on electricity savings.”*</p>
97
+ <p>🧑 <strong>User:</strong>
98
+ <em>“How much will I save on electricity bills?”</em></p>
99
+ <p>🤖 <strong>AI:</strong>
100
+ <em>“Solar savings depend on:</em>
101
+ ✅ Sunlight availability in your location.
102
+ ✅ Electricity consumption (higher bills = more savings).
103
+ ✅ Net metering (selling extra power back to the grid).</p>
104
+ <p>💡 <strong>Example Calculation:</strong>
105
+ • Before Solar: ₹3,000/month electricity bill.
106
+ • After Solar: ₹500/month (80% savings).
107
+ • <strong>Annual Savings:</strong> ₹30,000 (₹3,000 x 12 months).
108
+ • <strong>10-year Savings:</strong> ₹3,00,000! 🎉”*</p>
109
+ <p>—</p>
110
+ </section>
111
+ <section id="use-case-2-business-owner-exploring-commercial-solar">
112
+ <h2>🏢 <strong>Use Case 2: Business Owner Exploring Commercial Solar</strong><a class="headerlink" href="#use-case-2-business-owner-exploring-commercial-solar" title="Link to this heading"></a></h2>
113
+ <p>🧑 <strong>User:</strong>
114
+ <em>“Is solar energy a good investment for my business?”</em></p>
115
+ <p>🤖 <strong>AI:</strong>
116
+ <em>“Yes! Here’s why commercial solar is a smart investment:</em>
117
+ 🔹 Lower electricity costs: Save up to 50-80% on power bills.
118
+ 🔹 Tax benefits: Businesses can claim depreciation &amp; subsidies.
119
+ 🔹 ROI in 3-5 years: With net metering, extra energy earns credits.
120
+ 🔹 Sustainability: Green branding improves reputation &amp; compliance.”*</p>
121
+ <p>🧑 <strong>User:</strong>
122
+ <em>“What incentives are available for businesses?”</em></p>
123
+ <p>🤖 <strong>AI:</strong>
124
+ <em>“Indian businesses can benefit from:</em>
125
+ 💰 Accelerated Depreciation: 40% depreciation in the first year.
126
+ ⚡ Net Metering: Sell excess power to the grid.
127
+ 🏢 Government Subsidies: Up to 30% for some industries.
128
+ 📜 State Incentives: Vary by region (Delhi, Maharashtra, etc.).”*</p>
129
+ <p>—</p>
130
+ </section>
131
+ <section id="use-case-3-student-learning-about-solar-energy">
132
+ <h2>🎓 <strong>Use Case 3: Student Learning About Solar Energy</strong><a class="headerlink" href="#use-case-3-student-learning-about-solar-energy" title="Link to this heading"></a></h2>
133
+ <p>🧑 <strong>User:</strong>
134
+ <em>“How do solar panels generate electricity?”</em></p>
135
+ <p>🤖 <strong>AI:</strong>
136
+ <em>“Solar panels generate electricity using the **photovoltaic effect*</em>.*
137
+ 🔹 Step 1: Sunlight hits solar cells (made of silicon).
138
+ 🔹 Step 2: Photons excite electrons, creating an electric flow.
139
+ 🔹 Step 3: The inverter converts DC power to AC for home use.
140
+ 🔹 Step 4: Power is used or sent to the grid for credits.”*</p>
141
+ <p>🧑 <strong>User:</strong>
142
+ <em>“What is the efficiency of monocrystalline vs. polycrystalline panels?”</em></p>
143
+ <p>🤖 <strong>AI:</strong>
144
+ <em>“🔹 **Monocrystalline Panels:*</em>
145
+ • <strong>Efficiency:</strong> 15-22% (higher efficiency).
146
+ • <strong>Cost:</strong> More expensive but better performance.
147
+ • <strong>Lifespan:</strong> 25+ years.</p>
148
+ <p>🔹 <strong>Polycrystalline Panels:</strong>
149
+ • <strong>Efficiency:</strong> 12-18% (slightly lower).
150
+ • <strong>Cost:</strong> More affordable.
151
+ • <strong>Lifespan:</strong> 20-25 years.</p>
152
+ <p>💡 <strong>Monocrystalline =</strong> Best for limited space, maximum efficiency.
153
+ 💡 <strong>Polycrystalline =</strong> Best for budget-friendly installations.”*</p>
154
+ <p>—</p>
155
+ </section>
156
+ <section id="use-case-4-environmentalist-curious-about-solar-s-impact">
157
+ <h2>🌍 <strong>Use Case 4: Environmentalist Curious About Solar’s Impact</strong><a class="headerlink" href="#use-case-4-environmentalist-curious-about-solar-s-impact" title="Link to this heading"></a></h2>
158
+ <p>🧑 <strong>User:</strong>
159
+ <em>“How does solar energy help the environment?”</em></p>
160
+ <p>🤖 <strong>AI:</strong>
161
+ <em>“Solar energy helps the environment by:</em>
162
+ ✅ <strong>Reducing Carbon Footprint</strong> – Solar energy reduces CO₂ emissions by replacing fossil fuels.
163
+ ✅ <strong>Saving Water</strong> – Unlike coal power plants, solar energy does not require water cooling.
164
+ ✅ <strong>Preventing Air Pollution</strong> – No harmful emissions like SO₂, NOₓ, or particulate matter.
165
+ ✅ <strong>Reducing Land Degradation</strong> – Solar farms do not involve mining, unlike coal and gas.”*</p>
166
+ <p>🧑 <strong>User:</strong>
167
+ <em>“Can solar panels be recycled?”</em></p>
168
+ <p>🤖 <strong>AI:</strong>
169
+ <em>“Yes! Solar panels can be recycled to recover materials like:</em>
170
+ ♻️ <strong>Silicon</strong> (95%)
171
+ ♻️ <strong>Glass</strong> (90%)
172
+ ♻️ <strong>Aluminum</strong> (100%)
173
+ 🔹 Recycling plants in India &amp; worldwide help manage end-of-life solar waste.”*</p>
174
+ </section>
175
+ </section>
176
+
177
+
178
+ </div>
179
+ </div>
180
+ <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
181
+ <a href="test_openrouter.html" class="btn btn-neutral float-left" title="test_openrouter module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
182
+ </div>
183
+
184
+ <hr/>
185
+
186
+ <div role="contentinfo">
187
+ <p>&#169; Copyright .</p>
188
+ </div>
189
+
190
+ Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
191
+ <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
192
+ provided by <a href="https://readthedocs.org">Read the Docs</a>.
193
+
194
+
195
+ </footer>
196
+ </div>
197
+ </div>
198
+ </section>
199
+ </div>
200
+ <script>
201
+ jQuery(function () {
202
+ SphinxRtdTheme.Navigation.enable(true);
203
+ });
204
+ </script>
205
+
206
+ </body>
207
+ </html>
main.py DELETED
@@ -1,39 +0,0 @@
1
- from fastapi import FastAPI
2
- from pydantic import BaseModel
3
- import openai
4
- import requests
5
- import os
6
-
7
- app = FastAPI()
8
-
9
- # Set OpenRouter API key securely
10
- OPENROUTER_API_KEY = "sk-or-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" # Replace with new API key
11
- API_URL = "https://openrouter.ai/api/v1/chat/completions"
12
-
13
- class ChatRequest(BaseModel):
14
- user_input: str
15
-
16
- @app.post("/chat")
17
- async def chat(request: ChatRequest):
18
- headers = {
19
- "Authorization": f"Bearer {OPENROUTER_API_KEY}",
20
- "Content-Type": "application/json"
21
- }
22
-
23
- data = {
24
- "model": "openai/gpt-4", # You can change the model if needed
25
- "messages": [{"role": "user", "content": request.user_input}],
26
- "temperature": 0.7
27
- }
28
-
29
- try:
30
- response = requests.post(API_URL, headers=headers, json=data)
31
- response_json = response.json()
32
-
33
- if "choices" in response_json and response_json["choices"]:
34
- return {"response": response_json["choices"][0]["message"]["content"]}
35
- else:
36
- return {"error": "Invalid response from OpenRouter."}
37
-
38
- except Exception as e:
39
- return {"error": str(e)}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
streamlit_app.py DELETED
@@ -1,26 +0,0 @@
1
- import streamlit as st
2
- import requests
3
-
4
- API_URL = "http://127.0.0.1:8000/chat"
5
-
6
- st.set_page_config(page_title="Solar AI Assistant", page_icon="🌞", layout="centered")
7
-
8
- st.title("Solar AI Assistant 🌞")
9
- st.write("Ask me anything about solar energy!")
10
-
11
- user_input = st.text_input("Type your question below:")
12
-
13
- if st.button("Submit"):
14
- if user_input:
15
- with st.spinner("Thinking..."):
16
- try:
17
- response = requests.post(API_URL, json={"user_input": user_input})
18
- if response.status_code == 200:
19
- st.success("Response:")
20
- st.write(response.json().get("response", "No response received."))
21
- else:
22
- st.error("Failed to fetch response from API.")
23
- except Exception as e:
24
- st.error(f"Error: {str(e)}")
25
- else:
26
- st.warning("Please enter a question.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test_openrouter.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+
3
+ # ✅ OpenRouter API Key
4
+ HF_AUTH_TOKEN = "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"
5
+
6
+ # ✅ OpenRouter API Endpoint
7
+ API_URL = "https://openrouter.ai/api/v1/chat/completions"
8
+
9
+ # ✅ Use Dolphin 3.0 R1 Mistral 24B (Free)
10
+ data = {
11
+ "model": "cognitivecomputations/dolphin3.0-r1-mistral-24b:free", # ✅ Corrected Model Name
12
+ "messages": [{"role": "user", "content": "What is solar energy?"}],
13
+ "temperature": 0.7
14
+ }
15
+
16
+ # ✅ Define request headers
17
+ headers = {"Authorization": f"Bearer {HF_AUTH_TOKEN}", "Content-Type": "application/json"}
18
+
19
+ # ✅ Send request and print response
20
+ try:
21
+ response = requests.post(API_URL, headers=headers, json=data)
22
+ print("STATUS CODE:", response.status_code)
23
+ print("RESPONSE JSON:", response.json()) # Print full response
24
+ except Exception as e:
25
+ print("Error:", str(e))