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

Function getAttachment

frontend/src/utils/apiFunctions.js:403–424  ·  view source on GitHub ↗
(sessionId, attachmentId)

Source from the content-addressed store, hash-verified

401
402// Fetch session attachments
403export async function getAttachment(sessionId, attachmentId) {
404 try {
405 if (!sessionId) {
406 throw new Error('Missing session id')
407 }
408 if (!attachmentId) {
409 throw new Error('Missing attachment id')
410 }
411
412 const response = await fetch(apiUrl(`/api/sessions/${encodeURIComponent(sessionId)}/artifacts/${encodeURIComponent(attachmentId)}`))
413
414 if (!response.ok) {
415 throw new Error(`Failed to fetch attachment: ${response.status} ${response.statusText}`)
416 }
417
418 const data = await response.json()
419 return data?.data_uri
420 } catch (error) {
421 console.error('Failed to fetch attachment:', error)
422 throw error
423 }
424}
425
426// Batch workflow execution
427export async function postBatchWorkflow({ file, sessionId, yamlFile, maxParallel, logLevel }) {

Callers

nothing calls this directly

Calls 2

apiUrlFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected