Learn how to query your collections in WetroCloud for both free text and structured responses.
query
endpoint allows you to retrieve information from a collection (your resources) via the WetroCloud API.Parameter | Type | Description |
---|---|---|
collection_id (required) | String | The unique ID of the collection to query. |
request_query (required) | String | The search term or query text. |
stream (optional) | Boolean | Enables streaming response if True, it’s False by default |
model (optional) | String | Specific model you desire to query response Check out our list of supported models here |
Field | Description |
---|---|
response | Conversational response to the query. |
tokens | Number of tokens used for processing. |
success | Indicates whether the query was successful. |
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 (required) | String | The unique ID of the collection to query obtained from the /collection/create/ endpoint. |
request_query (required) | String | The search term or query text. |
json_schema (required) | String | The desired structure for the JSON response. |
json_schema_rules (required) | 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 |
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. |