How to Insert Text Content

To insert text content into a collection, make a POST request to the /v1/resource/insert/ endpoint with the required parameters in the body. The resource should be the text content you want to index and make sure you use the text type.

Request Example

from wetro import Wetrocloud
    
# Initialize the Wetrocloud client
client = Wetrocloud(api_key="your_api_key")
    
# Insert text content into a Collection
insert_response = client.collection.insert_resource(
    collection_id="my_unique_collection_id",
    resource="Rise of LLM models", 
    type="text"
)
    
print(insert_response)

Successful Response

A successful response confirms the operation and tracks token usage. Example Response
{
  "resource_id": "79621681-b680-4918-948d-d7f8c482426a",
  "success": true,
  "tokens": 35
}
FieldDescription
successIndicates whether the resource was inserted successfully.
tokensNumber of tokens consumed during the operation.
resource_idUnique ID for the resource, this is required when removing a resource