Update funtions.py
Browse files- funtions.py +20 -0
funtions.py
CHANGED
|
@@ -30,6 +30,26 @@ def call_llm(prompt):
|
|
| 30 |
)
|
| 31 |
return completion.choices[0].message.content
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
def generate_executive_summary(data):
|
| 34 |
prompt = f"""
|
| 35 |
Generate a concise executive summary for a PhD research proposal based on the following information:
|
|
|
|
| 30 |
)
|
| 31 |
return completion.choices[0].message.content
|
| 32 |
|
| 33 |
+
|
| 34 |
+
import requests
|
| 35 |
+
from IPython.display import HTML
|
| 36 |
+
|
| 37 |
+
# Function to upload files to transfer.sh
|
| 38 |
+
def upload_files_to_transfer_sh(file_paths):
|
| 39 |
+
urls = []
|
| 40 |
+
html_content = "<form>"
|
| 41 |
+
|
| 42 |
+
# Iterate over each file and upload to transfer.sh
|
| 43 |
+
for file_path in file_paths:
|
| 44 |
+
with open(file_path, 'rb') as file:
|
| 45 |
+
response = requests.post('https://transfer.sh/', files={'file': file})
|
| 46 |
+
response.raise_for_status() # Check for any upload errors
|
| 47 |
+
urls.append(response.text)
|
| 48 |
+
html_content += f"<p>File: {file_path} <br> Upload URL: <a href='{response.text}'>{response.text}</a></p>"
|
| 49 |
+
|
| 50 |
+
html_content += "</form>"
|
| 51 |
+
return urls, html_content
|
| 52 |
+
|
| 53 |
def generate_executive_summary(data):
|
| 54 |
prompt = f"""
|
| 55 |
Generate a concise executive summary for a PhD research proposal based on the following information:
|