Learn how to retrieve structured data from a collection using the Wetrocloud API
json_schema
and json_schema_rules
you provide.
To use the structured output feature you need to provide the following parameters:
Parameter | Type | Description |
---|---|---|
collection_id | String | The unique ID of the collection to query obtained from the /collection/create/ endpoint. |
request_query | String | The search term or query text. |
json_schema | String | The desired structure for the JSON response. |
json_schema_rules | String | Custom rules to guide the response’s adherence to the specified JSON schema. |
model (optional) | String | Specific model you desire to query response Check out our list of supported models here |
json_schema
json_schema
parameter defines the structure of the response you want the system to return. This parameter helps ensure the output matches your application’s requirements.
json_schema_rules
json_schema_rules
parameter allows you to define custom rules for how the schema is applied. Another way to think about this is that it is a set of instructions for the LLM to follow when generating the response. This can also be in form of a more detailed prompt This can include constraints on the data, additional formatting, or validation logic.
Field | Description |
---|---|
response | JSON object structured as per the provided schema. |
tokens | Number of tokens used for processing. |
success | Indicates whether the query was successful. |