英文:
how do i delete transcripts automatically from assemblyai
问题
我目前正在使用命令行生成文字记录。我该如何定期从服务器上删除这些文字记录?
我目前正在使用本地的 Python 文件。
我需要一种方法,可以自动化排除最后的 10 条文字记录,最好是按 ID 数量,或者如果不行,按日期排除。
英文:
I'm currently using cmd line to generate transcripts. How would i go abotu periodically deleting transcripts from their servers?
I'm currently using local python files
I need some kind of method i can automate that excludes the last 10, ideally by ID count, or failing that by date somehow?
答案1
得分: 1
从API中检索分段的转录文本
endpoint = f"https://api.assemblyai.com/v2/transcript/{transcript_id}"
使用标头向API端点发出DELETE请求
response = requests.delete(endpoint, headers=headers)
print(response.json())
英文:
https://www.assemblyai.com/docs/Models/speech_recognition#deleting-transcripts-from-the-api
It’s in their docs. But essentially:
# Retrieving transcript broken down into paragraphs
endpoint = f"https://api.assemblyai.com/v2/transcript/{transcript_id}"
# Make a DELETE request to the API endpoint with the headers
response = requests.delete(endpoint, headers=headers)
print(response.json())
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论