How It Works
To use structured outputs:- Set
outputType
tostructured
in your API request - Provide a JSON schema string in the
structuredOutputSchema
parameter - The API will return a response that strictly follows your schema
Write your query so that its answer contains the information requested in the
structuredOutputSchema
- the system will use the query response to fill the
outputBasic Examples
Let’s look at some simple examples that demonstrate how to use structured outputs for different use cases:Company Revenue Example
Company Revenue Example
This example extracts company classification information:
Movie Information Example
Movie Information Example
This example shows how to retrieve basic information about a movie:
Weather Information Example
Weather Information Example
This example retrieves weather information for travel planning:
Advanced Example: Competitive Analysis
This example shows how to extract structured competitive analysis information:Making Fields Required
To make sure that the key fields you defined are filled, you can mark them asrequired
in your json schema.
Required Fields Highlight
Best Practices
-
Schema Design:
- Keep your schema as simple as possible while meeting your needs
- Add descriptions to the fields to limit ambiguity
- Use appropriate data types (string, number, boolean, etc.)
- When in doubt, refer to the JSON documentation
-
Query Formulation:
- Write your query so that its answer contains the information requested in the
structuredOutputSchema
- the system will use the query response to fill the output - Provide clear context in your query and use explicit instructions
- Write your query so that its answer contains the information requested in the
Common Use Cases
- Company classification and categorization
- Competitive analysis
- Market research
- Product comparisons
- Company performance assessments
Facing issues? Reach out to our engineering team at support@linkup.so or via our Discord or book a 15 minutes call with a member of our technical team.