Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,16 +3,25 @@ import requests
|
|
| 3 |
|
| 4 |
# Function to call the LLM API
|
| 5 |
def call_llm_api(prompt):
|
| 6 |
-
# Replace with your LLM API endpoint and key
|
| 7 |
api_url = "https://api.example.com/generate"
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Function to perform a Google search
|
| 12 |
def google_search(query):
|
| 13 |
-
# Replace with your Google Search API endpoint and key
|
| 14 |
api_url = "https://api.example.com/search"
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
return response.json().get("results", [])
|
| 17 |
|
| 18 |
# Streamlit app layout
|
|
@@ -73,7 +82,7 @@ if st.button("Generate Business Plan"):
|
|
| 73 |
st.subheader("Generated Business Plan")
|
| 74 |
st.write(business_plan)
|
| 75 |
|
| 76 |
-
#
|
| 77 |
search_results = google_search(business_name)
|
| 78 |
st.subheader("Google Search Results")
|
| 79 |
for result in search_results:
|
|
|
|
| 3 |
|
| 4 |
# Function to call the LLM API
|
| 5 |
def call_llm_api(prompt):
|
|
|
|
| 6 |
api_url = "https://api.example.com/generate"
|
| 7 |
+
headers = {
|
| 8 |
+
"Content-Type": "application/json",
|
| 9 |
+
"API-Key": "your_api_key_here"
|
| 10 |
+
}
|
| 11 |
+
response = requests.post(api_url, headers=headers, json={"prompt": prompt})
|
| 12 |
+
return response.json().get("result", "")
|
| 13 |
|
| 14 |
# Function to perform a Google search
|
| 15 |
def google_search(query):
|
|
|
|
| 16 |
api_url = "https://api.example.com/search"
|
| 17 |
+
headers = {
|
| 18 |
+
"API-Key": "your_api_key_here"
|
| 19 |
+
}
|
| 20 |
+
params = {
|
| 21 |
+
"q": query,
|
| 22 |
+
"num_results": 5
|
| 23 |
+
}
|
| 24 |
+
response = requests.get(api_url, headers=headers, params=params)
|
| 25 |
return response.json().get("results", [])
|
| 26 |
|
| 27 |
# Streamlit app layout
|
|
|
|
| 82 |
st.subheader("Generated Business Plan")
|
| 83 |
st.write(business_plan)
|
| 84 |
|
| 85 |
+
# Perform a Google search for additional insights
|
| 86 |
search_results = google_search(business_name)
|
| 87 |
st.subheader("Google Search Results")
|
| 88 |
for result in search_results:
|