MCPcopy Create free account
hub / github.com/langgenius/dify / stringifyFormattedOutput

Function stringifyFormattedOutput

cli/src/framework/output.ts:86–100  ·  view source on GitHub ↗
(output: FormattedOutput<FormattedPrintable>)

Source from the content-addressed store, hash-verified

84}
85
86function stringifyFormattedOutput(output: FormattedOutput<FormattedPrintable>): string {
87 switch (output.format) {
88 case '':
89 case OutputFormat.TEXT:
90 return output.data.text()
91 case OutputFormat.JSON:
92 return `${JSON.stringify(output.data.json(), null, 2)}\n`
93 case OutputFormat.YAML:
94 return yaml.dump(output.data.json(), { indent: 2, lineWidth: -1 })
95 case OutputFormat.NAME:
96 return `${toName(output.data)}\n`
97 default:
98 throw new OutputFormatNotSupportedError(output.format)
99 }
100}
101
102function stringifyTableOutput(output: TableOutput<TablePrintable>): string {
103 switch (output.format) {

Callers 1

stringifyOutputFunction · 0.85

Calls 4

toNameFunction · 0.85
textMethod · 0.45
jsonMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected