Data Output Component #5779
mstachowiak
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be helpful to have a
Data Output
component for API based access of flows. When accessing a flow via the API, you're often only interested in receiving the structured data output as valid JSON and you're not interested in plain text.Currently, to receive data in the output of a flow, you have to run it through a
Parse Data
component to convert it to text, then pipe it to eitherChat Output
orText Output
. However, when accessing this processed data via the API, the data is put inside a string and proper JSON formatting is destroyed. It's not properly escaped but rather converted to a string with all double quotes converted to single quotes, making it un-parsable.As an alternative approach, when invoking a flow via the API, you can use the
output_component
specifier to get the output from a particular component within the flow. This generally works well as a way to get valid, well structured JSON, as you can retrieve data before it gets mangled by an Output Component. However, when you have a conditional flow that forks, there is often more than one component you potentially need to retrieve data from, which is not possible withoutput_component
parameter, as it only accepts a single value.Beta Was this translation helpful? Give feedback.
All reactions