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

Function fetchYaml

frontend/src/utils/apiFunctions.js:250–277  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

248
249// Fetch YAML for the specified workflow
250export async function fetchYaml(filename) {
251 try {
252 const yamlFilename = addYamlSuffix(filename)
253 const response = await fetch(apiUrl(`/api/workflows/${encodeURIComponent(yamlFilename)}/get`))
254
255 const data = await response.json().catch(() => ({}))
256
257 if (response.ok) {
258 return {
259 success: true,
260 content: data?.content
261 }
262 }
263
264 return {
265 success: false,
266 detail: data?.detail,
267 message: data?.message || 'Failed to fetch YAML file',
268 status: response.status
269 }
270 } catch (error) {
271 console.error('Error fetching YAML file:', error)
272 return {
273 success: false,
274 message: 'API error'
275 }
276 }
277}
278
279// Fetch the VueFlow graph
280export async function fetchVueGraph(key) {

Callers

nothing calls this directly

Calls 3

addYamlSuffixFunction · 0.85
apiUrlFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected