Structured Output Guide
How to take advantage of Structured Outputs
Linkup’s structured output feature allows you to receive responses in a custom format that you define. This is particularly useful when you need to integrate Linkup’s responses directly into your application’s data structure or when you want to ensure consistency in the response format.
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
output
Basic Examples
Let’s look at some simple examples that demonstrate how to use structured outputs for different use cases:
Advanced Example: Competitive Analysis
This example shows how to extract structured competitive analysis information:
Example response:
Making Fields Required
To make sure that the key fields you defined are filled, you can mark them as required
in your json schema.
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.