MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / fetchLogsZip

Function fetchLogsZip

frontend/src/utils/apiFunctions.js:372–400  ·  view source on GitHub ↗
(sessionId)

Source from the content-addressed store, hash-verified

370
371// Download execution logs
372export async function fetchLogsZip(sessionId) {
373 try {
374 const response = await fetch(apiUrl(`/api/sessions/${encodeURIComponent(sessionId)}/download`))
375
376 if (!response.ok) {
377 throw new Error(`Download failed: ${response.status} ${response.statusText}`)
378 }
379
380 // Get zip file data
381 const blob = await response.blob()
382 const url = window.URL.createObjectURL(blob)
383
384 // Create a download link and trigger download
385 const link = document.createElement('a')
386 link.href = url
387 link.download = `execution_logs_${sessionId}.zip`
388 document.body.appendChild(link)
389 link.click()
390
391 // Cleanup
392 document.body.removeChild(link)
393 window.URL.revokeObjectURL(url)
394
395 return { success: true }
396 } catch (error) {
397 console.error('Failed to download execution logs:', error)
398 throw error
399 }
400}
401
402// Fetch session attachments
403export async function getAttachment(sessionId, attachmentId) {

Callers

nothing calls this directly

Calls 2

apiUrlFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected