refac
This commit is contained in:
1 parent
d3ab9f4b96
commit
1d08376860
3 files changed
+23
-1
No files matched your search
@@ -257,7 +257,7 @@ class FilesTable:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def update_file_hash_by_id(
|
def update_file_hash_by_id(
|
||||||
self, id: str, hash: str, db: Optional[Session] = None
|
self, id: str, hash: Optional[str], db: Optional[Session] = None
|
||||||
) -> Optional[FileModel]:
|
) -> Optional[FileModel]:
|
||||||
with get_db_context(db) as db:
|
with get_db_context(db) as db:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1794,6 +1794,8 @@ def process_file(
|
|||||||
{"status": "failed"},
|
{"status": "failed"},
|
||||||
db=db,
|
db=db,
|
||||||
)
|
)
|
||||||
|
# Clear the hash so the file can be re-uploaded after fixing the issue
|
||||||
|
Files.update_file_hash_by_id(file.id, None, db=db)
|
||||||
|
|
||||||
if "No pandoc was found" in str(e):
|
if "No pandoc was found" in str(e):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|||||||
@@ -2721,6 +2721,26 @@ async def process_chat_response(
|
|||||||
"arguments"
|
"arguments"
|
||||||
] += delta_arguments
|
] += delta_arguments
|
||||||
|
|
||||||
|
# Emit pending tool calls in real-time
|
||||||
|
if response_tool_calls:
|
||||||
|
pending_content_blocks = content_blocks + [
|
||||||
|
{
|
||||||
|
"type": "tool_calls",
|
||||||
|
"content": response_tool_calls,
|
||||||
|
"pending": True,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
await event_emitter(
|
||||||
|
{
|
||||||
|
"type": "chat:completion",
|
||||||
|
"data": {
|
||||||
|
"content": serialize_content_blocks(
|
||||||
|
pending_content_blocks
|
||||||
|
),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
image_urls = get_image_urls(
|
image_urls = get_image_urls(
|
||||||
delta.get("images", []), request, metadata, user
|
delta.get("images", []), request, metadata, user
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user