Is there a release date for the support of OpenAI's Structured Outputs? Can this be done manually? #3414
Replies: 1 comment
-
Hi @taylorbayouth! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this together! Langflow v1.0.15 already supports OpenAI's Function Calling and Structured Outputs. You can enable Structured Outputs by providing an However, there is no reference to the For integrating models like If you need to manually set up Structured Outputs, you can use the following configuration snippet: DictInput(
name="output_schema",
is_list=True,
display_name="Schema",
advanced=True,
info="The schema for the Output of the model. You must pass the word JSON in the prompt. If left blank, JSON mode will be disabled.",
) And the corresponding code to enable structured output: output_schema_dict: dict[str, str] = reduce(operator.ior, self.output_schema or {}, {})
json_mode = bool(output_schema_dict)
if json_mode:
output = output.with_structured_output(schema=output_schema_dict, method="json_mode") This setup should help you retain the functionality you need while using Langflow. |
Beta Was this translation helpful? Give feedback.
-
We're rebuilding an existing app with LangFlow. The existing app uses OpenAI's new Structured Outputs (https://openai.com/index/introducing-structured-outputs-in-the-api/) and it is working VERY well for us. It has solved a lot of our problems. However, moving to LangFlow seems to mean that we will lose this capability. Does Langflow support Function Calling?
Here's the bit that we need to do:
1. Function calling: Structured Outputs via tools is available by setting strict: true within your function definition. This feature works with all models that support tools, including all models gpt-4-0613 and gpt-3.5-turbo-0613 and later. When Structured Outputs are enabled, model outputs will match the supplied tool definition.
Beta Was this translation helpful? Give feedback.
All reactions