Update app.py
Browse files
app.py
CHANGED
@@ -25,42 +25,33 @@ def web_search(query):
|
|
25 |
response = requests.post(url, json=payload)
|
26 |
|
27 |
if response.status_code == 200:
|
28 |
-
|
29 |
-
if isinstance(results, list):
|
30 |
-
return results
|
31 |
-
else:
|
32 |
-
return results.get('results') # Assuming 'results' contain relevant info
|
33 |
else:
|
34 |
return {"error": f"Error: {response.status_code}"}
|
35 |
|
36 |
# Main function
|
37 |
def main():
|
38 |
-
st.
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
#
|
49 |
-
message
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
# Display the report
|
61 |
-
st.write(report)
|
62 |
-
else:
|
63 |
-
st.write("Please enter a search query.")
|
64 |
|
65 |
if __name__ == "__main__":
|
66 |
-
main()
|
|
|
25 |
response = requests.post(url, json=payload)
|
26 |
|
27 |
if response.status_code == 200:
|
28 |
+
return response.json().get('results') # Assuming 'results' contain relevant info
|
|
|
|
|
|
|
|
|
29 |
else:
|
30 |
return {"error": f"Error: {response.status_code}"}
|
31 |
|
32 |
# Main function
|
33 |
def main():
|
34 |
+
query = st.text_area("Enter resume content:")
|
35 |
+
if query:
|
36 |
+
prompt = f"Please provide a comprehensive review of the following resume and suggest improvements. The goal is to enhance its effectiveness in conveying the candidate's skills and experiences. Here's the resume content: {query}"
|
37 |
+
|
38 |
+
# Perform web search
|
39 |
+
search_results = web_search(query)
|
40 |
+
|
41 |
+
# Extract relevant information and convert it into a message
|
42 |
+
message = "" # Create an empty string to store the message
|
43 |
+
for result in search_results:
|
44 |
+
# Assuming each result is a string, you might adjust this part accordingly
|
45 |
+
message += result + ". " # Concatenate results with a period
|
46 |
+
|
47 |
+
# Combine prompt and message for AI conversation
|
48 |
+
full_message = prompt + " " + message
|
49 |
+
|
50 |
+
# Pass the combined message to the AI for generating a report
|
51 |
+
report = chat_with_ai(full_message)
|
52 |
+
|
53 |
+
# Display the report
|
54 |
+
st.write(report)
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
if __name__ == "__main__":
|
57 |
+
main()
|