mirror of
https://github.com/primedigitaltech/FileChat.git
synced 2026-01-19 13:03:19 +08:00
Delete file after parsing because of ZhipuAI's limitation
This commit is contained in:
parent
917b628818
commit
7d95b4a03c
@ -38,6 +38,7 @@ def main():
|
|||||||
if "messages" not in st.session_state:
|
if "messages" not in st.session_state:
|
||||||
file_object = client.files.create(file=uploaded_file, purpose="file-extract")
|
file_object = client.files.create(file=uploaded_file, purpose="file-extract")
|
||||||
file_content = json.loads(client.files.content(file_id=file_object.id).content)["content"]
|
file_content = json.loads(client.files.content(file_id=file_object.id).content)["content"]
|
||||||
|
client.files.delete(file_id=file_object.id)
|
||||||
message_content = f"请对\n{file_content}\n的内容进行分析,并撰写一份论文摘要。"
|
message_content = f"请对\n{file_content}\n的内容进行分析,并撰写一份论文摘要。"
|
||||||
response = client.chat.completions.create(
|
response = client.chat.completions.create(
|
||||||
model="glm-4-long",
|
model="glm-4-long",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user