Test Write PDF Text
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
wantedBy = ["networking-online.target"];
|
||||
enable = true;
|
||||
serviceConfig = {
|
||||
WorkingDirectory = "handyhelper";
|
||||
ExecStart = ''
|
||||
${handy_py}/bin/handyhelper
|
||||
'';
|
||||
|
||||
@@ -43,6 +43,10 @@ async def getPDF(url):
|
||||
resp = req.get(url, stream=True)
|
||||
pdf = io.BytesIO(resp.content)
|
||||
pages = pdftotext.PDF(pdf)
|
||||
|
||||
with open("./test.txt","w") as f:
|
||||
f.write("\n\n".join(pages))
|
||||
|
||||
return "\n\n".join(pages)
|
||||
|
||||
async def summarize(pdf):
|
||||
@@ -53,9 +57,13 @@ async def summarize(pdf):
|
||||
---
|
||||
{pdf}
|
||||
"""}
|
||||
]
|
||||
],
|
||||
user="HandyHelper"
|
||||
)
|
||||
return completion
|
||||
|
||||
eprint(completion.usage)
|
||||
|
||||
return completion.choices[0].message
|
||||
|
||||
@bot.event
|
||||
async def on_ready():
|
||||
|
||||
Reference in New Issue
Block a user