Query
The query endpoints provide advanced AI-driven search, conversation, and summarization capabilities for documents and media stored in SmartBuckets. It enables users and agents to interact naturally with content through conversational chat (DocumentChat), semantic search (RagSearch), and multi-modal queries across text, images, and audio (document_query). The service also supports intelligent summarization of search results (summarize_page) and paginated result navigation. Designed for seamless integration into AI workflows, these endpoints make complex document exploration, PII detection, and knowledge extraction accessible via simple APIs, eliminating the need for custom pipelines or infrastructure.
POST /v1/document_query
Enables natural conversational interactions with documents stored in SmartBuckets. This endpoint allows users to ask questions, request summaries, and explore document content through an intuitive conversational interface. The system understands context and can handle complex queries about document contents.
The query system maintains conversation context throught the request_id, enabling follow-up questions and deep exploration of document content. It works across all supported file types and automatically handles multi-page documents, making complex file interaction as simple as having a conversation.
The system will:
- Maintain conversation history for context when using the same request_id
- Process questions against file content
- Generate contextual, relevant responses
Document query is supported for all file types, including PDFs, images, and audio files.
Schema Reference
Request Body
bucketLocation
(object
) Required
Details
Description
The storage bucket containing the target document. Must be a valid, registered Smart Bucket. Used to identify which bucket to query against
Example
{ "bucket": { "name": "my-smartbucket", "version": "01jxanr45haeswhay4n0q8340y", "application_name": "my-app" }}
objectId
(string
) Required
Details
Description
Document identifier within the bucket. Typically matches the storage path or key. Used to identify which document to chat with
Example
document.pdf
input
(string
) Required
Details
Description
User’s input or question about the document. Can be natural language questions, commands, or requests. The system will process this against the document content
Example
What are the key points in this document?
requestId
(string
) Required
Details
Description
Client-provided conversation session identifier. Required for maintaining context in follow-up questions. We recommend using a UUID or ULID for this value
Example
<YOUR-REQUEST-ID>
answer
(string
)
Details
Description
AI-generated response that may include direct document quotes, content summaries, contextual explanations, references to specific sections, and related content suggestions
Example
Based on the document, the key points are...
code
(string
)
Details
Description
Status codes and their meanings:
Code | Number | Description |
---|---|---|
OK | 0 | No error occurred. |
CANCELLED | 1 | The operation was cancelled, typically by the caller. |
UNKNOWN | 2 | Unknown error. Usually means a server error not mapped to a known code. |
INVALID_ARGUMENT | 3 | Client specified an invalid argument. |
DEADLINE_EXCEEDED | 4 | Deadline expired before operation could complete. |
NOT_FOUND | 5 | Requested entity was not found. |
ALREADY_EXISTS | 6 | Entity that a client attempted to create already exists. |
PERMISSION_DENIED | 7 | Caller doesn’t have permission. |
RESOURCE_EXHAUSTED | 8 | Some resource has been exhausted (e.g., quota, memory). |
FAILED_PRECONDITION | 9 | Operation rejected because system not in required state. |
ABORTED | 10 | Operation aborted, usually due to concurrency issues. |
OUT_OF_RANGE | 11 | Argument out of acceptable range. |
UNIMPLEMENTED | 12 | Operation not implemented or supported. |
INTERNAL | 13 | Internal error. |
UNAVAILABLE | 14 | Service is currently unavailable. |
DATA_LOSS | 15 | Unrecoverable data loss or corruption. |
UNAUTHENTICATED | 16 | Request does not have valid authentication credentials. |
import Raindrop from '@liquidmetal-ai/lm-raindrop';
const client = new Raindrop();
const response = await client.query.documentQuery({ bucketLocation: { bucket: { name: 'my-smartbucket' } }, input: 'What are the key points in this document?', objectId: 'document.pdf', requestId: '<YOUR-REQUEST-ID>',});
console.log(response.answer);
from raindrop import Raindrop
client = Raindrop()response = client.query.document_query( bucket_location={ "bucket": { "name": "my-smartbucket" } }, input="What are the key points in this document?", object_id="document.pdf", request_id="<YOUR-REQUEST-ID>",)print(response.answer)
package main
import ( "context" "fmt"
"github.com/LiquidMetal-AI/lm-raindrop-go-sdk" "github.com/LiquidMetal-AI/lm-raindrop-go-sdk/option")
func main() { client := raindrop.NewClient( option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RAINDROP_API_KEY") ) response, err := client.Query.DocumentQuery(context.TODO(), raindrop.QueryDocumentQueryParams{ BucketLocation: raindrop.BucketLocatorUnionParam{ OfBucket: &raindrop.BucketLocatorBucketParam{ Bucket: raindrop.BucketLocatorBucketBucketParam{ Name: "my-smartbucket", }, }, }, Input: "What are the key points in this document?", ObjectID: "document.pdf", RequestID: "<YOUR-REQUEST-ID>", }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Answer)}
package com.raindrop.api.example;
import com.raindrop.api.client.RaindropClient;import com.raindrop.api.client.okhttp.RaindropOkHttpClient;import com.raindrop.api.models.query.BucketLocator;import com.raindrop.api.models.query.QueryDocumentQueryParams;import com.raindrop.api.models.query.QueryDocumentQueryResponse;
public final class Main { private Main() {}
public static void main(String[] args) { // Configures using the `RAINDROP_API_KEY` and `RAINDROP_BASE_URL` environment variables RaindropClient client = RaindropOkHttpClient.fromEnv();
QueryDocumentQueryParams params = QueryDocumentQueryParams.builder() .bucketLocation(BucketLocator.Bucket.builder() .bucket(BucketLocator.Bucket.InnerBucket.builder() .name("my-bucket") .build()) .build()) .input("What are the key points in this document?") .objectId("document.pdf") .requestId("<YOUR-REQUEST-ID>") .build(); QueryDocumentQueryResponse response = client.query().documentQuery(params); }}
# Query a document in a bucketnpx raindrop query document "What are the key points in this document?" \ -b my-bucket \ --object-id document.pdf
curl -X POST "https://api.raindrop.run/v1/document_query" \ -H "Authorization: Bearer lm_apikey_..." \ -H "Content-Type: application/json" \ -d '{ "bucket_location": { "bucket": { "name": "my-smartbucket", "version": "01jxanr45haeswhay4n0q8340y", "application_name": "my-app" } }, "object_id": "document.pdf", "input": "What are the key points in this document?", "request_id": "<YOUR-REQUEST-ID>"}'
Response Examples
{ "answer": "Based on the document, the key points are..."}
POST /v1/chunk_search
Chunk Search provides search capabilities that serve as a complete drop-in replacement for traditional RAG pipelines. This system enables AI agents to leverage private data stored in SmartBuckets with zero additional configuration.
Each input query is processed by our AI agent to determine the best way to search the data. The system will then return the most relevant results from the data ranked by relevance on the input query.
Schema Reference
Request Body
input
(string
) Required
Details
Description
Natural language query or question. Can include complex criteria and relationships. The system will optimize the search strategy based on this input
Example
Find documents about revenue in Q4 2023
requestId
(string
) Required
Details
Description
Client-provided search session identifier. Required for pagination and result tracking. We recommend using a UUID or ULID for this value
Example
<YOUR-REQUEST-ID>
bucketLocations
(array
) Required
Details
Description
The buckets to search. If provided, the search will only return results from these buckets
Example
[ { "bucket": { "name": "my-smartbucket", "version": "01jxanr45haeswhay4n0q8340y", "application_name": "my-app" } }]
results
(array
)
Details
Description
Ordered list of relevant text segments. Each result includes full context and metadata
Example
[ { "chunkSignature": "chunk_123abc", "text": "Sample text", "score": 0.95 }]
code
(string
)
Details
Description
Status codes and their meanings:
Code | Number | Description |
---|---|---|
OK | 0 | No error occurred. |
CANCELLED | 1 | The operation was cancelled, typically by the caller. |
UNKNOWN | 2 | Unknown error. Usually means a server error not mapped to a known code. |
INVALID_ARGUMENT | 3 | Client specified an invalid argument. |
DEADLINE_EXCEEDED | 4 | Deadline expired before operation could complete. |
NOT_FOUND | 5 | Requested entity was not found. |
ALREADY_EXISTS | 6 | Entity that a client attempted to create already exists. |
PERMISSION_DENIED | 7 | Caller doesn’t have permission. |
RESOURCE_EXHAUSTED | 8 | Some resource has been exhausted (e.g., quota, memory). |
FAILED_PRECONDITION | 9 | Operation rejected because system not in required state. |
ABORTED | 10 | Operation aborted, usually due to concurrency issues. |
OUT_OF_RANGE | 11 | Argument out of acceptable range. |
UNIMPLEMENTED | 12 | Operation not implemented or supported. |
INTERNAL | 13 | Internal error. |
UNAVAILABLE | 14 | Service is currently unavailable. |
DATA_LOSS | 15 | Unrecoverable data loss or corruption. |
UNAUTHENTICATED | 16 | Request does not have valid authentication credentials. |
import Raindrop from '@liquidmetal-ai/lm-raindrop';
const client = new Raindrop();
const response = await client.query.chunkSearch({ bucketLocations: [{ bucket: { name: 'my-smartbucket' } }], input: 'Find documents about revenue in Q4 2023', requestId: '<YOUR-REQUEST-ID>',});
console.log(response.results);
from raindrop import Raindrop
client = Raindrop()response = client.query.chunk_search( bucket_locations=[{ "bucket": { "name": "my-smartbucket" } }], input="Find documents about revenue in Q4 2023", request_id="<YOUR-REQUEST-ID>",)print(response.results)
package main
import ( "context" "fmt"
"github.com/LiquidMetal-AI/lm-raindrop-go-sdk" "github.com/LiquidMetal-AI/lm-raindrop-go-sdk/option")
func main() { client := raindrop.NewClient( option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RAINDROP_API_KEY") ) response, err := client.Query.ChunkSearch(context.TODO(), raindrop.QueryChunkSearchParams{ BucketLocations: []raindrop.BucketLocatorUnionParam{raindrop.BucketLocatorUnionParam{ OfBucket: &raindrop.BucketLocatorBucketParam{ Bucket: raindrop.BucketLocatorBucketBucketParam{ Name: "my-smartbucket", }, }, }}, Input: "Find documents about revenue in Q4 2023", RequestID: "<YOUR-REQUEST-ID>", }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Results)}
package com.raindrop.api.example;
import com.raindrop.api.client.RaindropClient;import com.raindrop.api.client.okhttp.RaindropOkHttpClient;import com.raindrop.api.models.query.BucketLocator;import com.raindrop.api.models.query.QueryChunkSearchParams;import com.raindrop.api.models.query.QueryChunkSearchResponse;
public final class Main { private Main() {}
public static void main(String[] args) { // Configures using the `RAINDROP_API_KEY` and `RAINDROP_BASE_URL` environment variables RaindropClient client = RaindropOkHttpClient.fromEnv();
QueryChunkSearchParams params = QueryChunkSearchParams.builder() .addBucketLocation(BucketLocator.Bucket.builder() .bucket(BucketLocator.Bucket.InnerBucket.builder() .name("my-smartbucket") .build()) .build()) .input("Find documents about revenue in Q4 2023") .requestId("<YOUR-REQUEST-ID>") .build(); QueryChunkSearchResponse response = client.query().chunkSearch(params); }}
# Run a RAG search querynpx raindrop query chunk-search "What is LiquidMetal?" -b my-bucket
curl -X POST "https://api.raindrop.run/v1/chunk_search" \ -H "Authorization: Bearer lm_apikey_..." \ -H "Content-Type: application/json" \ -d '{ "input": "Find documents about revenue in Q4 2023", "request_id": "<YOUR-REQUEST-ID>", "bucket_locations": [ { "bucket": { "name": "my-smartbucket", "version": "01jxanr45haeswhay4n0q8340y", "application_name": "my-app" } } ]}'
Response Examples
{ "results": [ { "chunkSignature": "chunk_123abc", "text": "Sample text", "score": 0.95 } ]}
POST /v1/summarize_page
Generates intelligent summaries of search result pages, helping users quickly understand large result sets without reading through every document. The system analyzes the content of all results on a given page and generates a detailed overview.
The summary system:
- Identifies key themes and topics
- Extracts important findings
- Highlights document relationships
- Provides content type distribution
- Summarizes metadata patterns
This is particularly valuable when dealing with:
- Large document collections
- Mixed content types
- Technical documentation
- Research materials
Schema Reference
Request Body
page
(integer
) Required
Details
Description
Target page number (1-based)
Example
1
pageSize
(integer
) Required
Details
Description
Results per page. Affects summary granularity
Example
10
requestId
(string
) Required
Details
Description
Original search session identifier from the initial search
Example
<YOUR-REQUEST-ID>
summary
(string
)
Details
Description
AI-generated summary including key themes and topics, content type distribution, important findings, and document relationships
Example
The search results contain information about...
code
(string
)
Details
Description
Status codes and their meanings:
Code | Number | Description |
---|---|---|
OK | 0 | No error occurred. |
CANCELLED | 1 | The operation was cancelled, typically by the caller. |
UNKNOWN | 2 | Unknown error. Usually means a server error not mapped to a known code. |
INVALID_ARGUMENT | 3 | Client specified an invalid argument. |
DEADLINE_EXCEEDED | 4 | Deadline expired before operation could complete. |
NOT_FOUND | 5 | Requested entity was not found. |
ALREADY_EXISTS | 6 | Entity that a client attempted to create already exists. |
PERMISSION_DENIED | 7 | Caller doesn’t have permission. |
RESOURCE_EXHAUSTED | 8 | Some resource has been exhausted (e.g., quota, memory). |
FAILED_PRECONDITION | 9 | Operation rejected because system not in required state. |
ABORTED | 10 | Operation aborted, usually due to concurrency issues. |
OUT_OF_RANGE | 11 | Argument out of acceptable range. |
UNIMPLEMENTED | 12 | Operation not implemented or supported. |
INTERNAL | 13 | Internal error. |
UNAVAILABLE | 14 | Service is currently unavailable. |
DATA_LOSS | 15 | Unrecoverable data loss or corruption. |
UNAUTHENTICATED | 16 | Request does not have valid authentication credentials. |
import Raindrop from '@liquidmetal-ai/lm-raindrop';
const client = new Raindrop();
const response = await client.query.sumarizePage({ page: 1, pageSize: 10, requestId: '<YOUR-REQUEST-ID>' });
console.log(response.summary);
from raindrop import Raindrop
client = Raindrop()response = client.query.sumarize_page( page=1, page_size=10, request_id="<YOUR-REQUEST-ID>",)print(response.summary)
package main
import ( "context" "fmt"
"github.com/LiquidMetal-AI/lm-raindrop-go-sdk" "github.com/LiquidMetal-AI/lm-raindrop-go-sdk/option")
func main() { client := raindrop.NewClient( option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RAINDROP_API_KEY") ) response, err := client.Query.SumarizePage(context.TODO(), raindrop.QuerySumarizePageParams{ Page: 1, PageSize: 10, RequestID: "<YOUR-REQUEST-ID>", }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Summary)}
package com.raindrop.api.example;
import com.raindrop.api.client.RaindropClient;import com.raindrop.api.client.okhttp.RaindropOkHttpClient;import com.raindrop.api.models.query.QuerySumarizePageParams;import com.raindrop.api.models.query.QuerySumarizePageResponse;
public final class Main { private Main() {}
public static void main(String[] args) { // Configures using the `RAINDROP_API_KEY` and `RAINDROP_BASE_URL` environment variables RaindropClient client = RaindropOkHttpClient.fromEnv();
QuerySumarizePageParams params = QuerySumarizePageParams.builder() .page(1) .pageSize(10) .requestId("<YOUR-REQUEST-ID>") .build(); QuerySumarizePageResponse response = client.query().sumarizePage(params); }}
# coming soon!
curl -X POST "https://api.raindrop.run/v1/summarize_page" \ -H "Authorization: Bearer lm_apikey_..." \ -H "Content-Type: application/json" \ -d '{ "page": 1, "page_size": 10, "request_id": "<YOUR-REQUEST-ID>"}'
Response Examples
{ "summary": "The search results contain information about..."}
POST /v1/search
Primary search endpoint that provides advanced search capabilities across all document types stored in SmartBuckets.
Supports recursive object search within objects, enabling nested content search like embedded images, text content, and personally identifiable information (PII).
The system supports complex queries like:
- ‘Show me documents containing credit card numbers or social security numbers’
- ‘Find images of landscapes taken during sunset’
- ‘Get documents mentioning revenue forecasts from Q4 2023’
- ‘Find me all PDF documents that contain pictures of a cat’
- ‘Find me all audio files that contain information about the weather in SF in 2024’
Key capabilities:
- Natural language query understanding
- Content-based search across text, images, and audio
- Automatic PII detection
- Multi-modal search (text, images, audio)
Schema Reference
Request Body
input
(string
) Required
Details
Description
Natural language search query that can include complex criteria. Supports queries like finding documents with specific content types, PII, or semantic meaning
Example
All my files
requestId
(string
) Required
Details
Description
Client-provided search session identifier. Required for pagination and result tracking. We recommend using a UUID or ULID for this value
Example
<YOUR-REQUEST-ID>
bucketLocations
(array
) Required
Details
Description
The buckets to search. If provided, the search will only return results from these buckets
Example
[ { "bucket": { "name": "my-smartbucket", "version": "01jxanr45haeswhay4n0q8340y", "application_name": "my-app" } }]
results
(array
)
Details
Description
Matched results with metadata
Example
[ { "chunkSignature": "35a494ab4de3ff1157b3cf23e5e94600e24a5552cbb6db645599547075a8c3ad", "text": "", "source": { "bucket": { "moduleId": "01jxanr4xbf44jj3p62vwzh8j5", "bucketName": "my-smartbucket", "applicationVersionId": "01jxanr45haeswhay4n0q8340y", "applicationName": "my-app" }, "object": "my-file.pdf" } }]
pagination
(object
)
Details
Description
Pagination details for result navigation
Example
{ "total": 100, "page": 1, "pageSize": 10, "totalPages": 10}
code
(string
)
Details
Description
Status codes and their meanings:
Code | Number | Description |
---|---|---|
OK | 0 | No error occurred. |
CANCELLED | 1 | The operation was cancelled, typically by the caller. |
UNKNOWN | 2 | Unknown error. Usually means a server error not mapped to a known code. |
INVALID_ARGUMENT | 3 | Client specified an invalid argument. |
DEADLINE_EXCEEDED | 4 | Deadline expired before operation could complete. |
NOT_FOUND | 5 | Requested entity was not found. |
ALREADY_EXISTS | 6 | Entity that a client attempted to create already exists. |
PERMISSION_DENIED | 7 | Caller doesn’t have permission. |
RESOURCE_EXHAUSTED | 8 | Some resource has been exhausted (e.g., quota, memory). |
FAILED_PRECONDITION | 9 | Operation rejected because system not in required state. |
ABORTED | 10 | Operation aborted, usually due to concurrency issues. |
OUT_OF_RANGE | 11 | Argument out of acceptable range. |
UNIMPLEMENTED | 12 | Operation not implemented or supported. |
INTERNAL | 13 | Internal error. |
UNAVAILABLE | 14 | Service is currently unavailable. |
DATA_LOSS | 15 | Unrecoverable data loss or corruption. |
UNAUTHENTICATED | 16 | Request does not have valid authentication credentials. |
import Raindrop from '@liquidmetal-ai/lm-raindrop';
const client = new Raindrop();
const response = await client.query.search({ bucketLocations: [{ bucket: { name: 'my-smartbucket' } }], input: 'All my files', requestId: '<YOUR-REQUEST-ID>',});
console.log(response.pagination);
from raindrop import Raindrop
client = Raindrop()response = client.query.search( bucket_locations=[{ "bucket": { "name": "my-smartbucket" } }], input="All my files", request_id="<YOUR-REQUEST-ID>",)print(response.pagination)
package main
import ( "context" "fmt"
"github.com/LiquidMetal-AI/lm-raindrop-go-sdk" "github.com/LiquidMetal-AI/lm-raindrop-go-sdk/option")
func main() { client := raindrop.NewClient( option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RAINDROP_API_KEY") ) response, err := client.Query.Search(context.TODO(), raindrop.QuerySearchParams{ BucketLocations: []raindrop.BucketLocatorUnionParam{raindrop.BucketLocatorUnionParam{ OfBucket: &raindrop.BucketLocatorBucketParam{ Bucket: raindrop.BucketLocatorBucketBucketParam{ Name: "my-smartbucket", }, }, }}, Input: "All my files", RequestID: "<YOUR-REQUEST-ID>", }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Pagination)}
package com.raindrop.api.example;
import com.raindrop.api.client.RaindropClient;import com.raindrop.api.client.okhttp.RaindropOkHttpClient;import com.raindrop.api.models.query.BucketLocator;import com.raindrop.api.models.query.QuerySearchParams;import com.raindrop.api.models.query.QuerySearchResponse;
public final class Main { private Main() {}
public static void main(String[] args) { // Configures using the `RAINDROP_API_KEY` and `RAINDROP_BASE_URL` environment variables RaindropClient client = RaindropOkHttpClient.fromEnv();
QuerySearchParams params = QuerySearchParams.builder() .addBucketLocation(BucketLocator.Bucket.builder() .bucket(BucketLocator.Bucket.InnerBucket.builder() .name("my-smartbucket") .build()) .build()) .input("All my files") .requestId("<YOUR-REQUEST-ID>") .build(); QuerySearchResponse response = client.query().search(params); }}
# Run a new search querynpx raindrop query search "Find documents about revenue in Q4 2023" -b customer-data
# Get paginated results using request IDnpx raindrop query search --requestId 01HNG4V2RJXS5T --page 2
curl -X POST "https://api.raindrop.run/v1/search" \ -H "Authorization: Bearer lm_apikey_..." \ -H "Content-Type: application/json" \ -d '{ "input": "All my files", "request_id": "<YOUR-REQUEST-ID>", "bucket_locations": [ { "bucket": { "name": "my-smartbucket", "version": "01jxanr45haeswhay4n0q8340y", "application_name": "my-app" } } ]}'
Response Examples
{ "results": [ { "chunkSignature": "35a494ab4de3ff1157b3cf23e5e94600e24a5552cbb6db645599547075a8c3ad", "text": "", "source": { "bucket": { "moduleId": "01jxanr4xbf44jj3p62vwzh8j5", "bucketName": "my-smartbucket", "applicationVersionId": "01jxanr45haeswhay4n0q8340y", "applicationName": "my-app" }, "object": "my-file.pdf" } } ], "pagination": { "total": 100, "page": 1, "pageSize": 10, "totalPages": 10 }}
POST /v1/search_get_page
Retrieve additional pages from a previous search. This endpoint enables navigation through large result sets while maintaining search context and result relevance. Retrieving paginated results requires a valid request_id from a previously completed search.
Schema Reference
Request Body
requestId
(string
) Required
Details
Description
Original search session identifier from the initial search
Example
<YOUR-REQUEST-ID>
page
(integer
(nullable)) Required
Details
Description
Requested page number
Example
1
pageSize
(integer
(nullable)) Required
Details
Description
Results per page
Example
10
results
(array
)
Details
Description
Page results with full metadata
Example
[ { "chunkSignature": "chunk_123abc", "text": "Sample text", "score": 0.95 }]
pagination
(object
)
Details
Description
Updated pagination information
Example
{ "total": 100, "page": 2, "pageSize": 10, "totalPages": 10}
code
(string
)
Details
Description
Status codes and their meanings:
Code | Number | Description |
---|---|---|
OK | 0 | No error occurred. |
CANCELLED | 1 | The operation was cancelled, typically by the caller. |
UNKNOWN | 2 | Unknown error. Usually means a server error not mapped to a known code. |
INVALID_ARGUMENT | 3 | Client specified an invalid argument. |
DEADLINE_EXCEEDED | 4 | Deadline expired before operation could complete. |
NOT_FOUND | 5 | Requested entity was not found. |
ALREADY_EXISTS | 6 | Entity that a client attempted to create already exists. |
PERMISSION_DENIED | 7 | Caller doesn’t have permission. |
RESOURCE_EXHAUSTED | 8 | Some resource has been exhausted (e.g., quota, memory). |
FAILED_PRECONDITION | 9 | Operation rejected because system not in required state. |
ABORTED | 10 | Operation aborted, usually due to concurrency issues. |
OUT_OF_RANGE | 11 | Argument out of acceptable range. |
UNIMPLEMENTED | 12 | Operation not implemented or supported. |
INTERNAL | 13 | Internal error. |
UNAVAILABLE | 14 | Service is currently unavailable. |
DATA_LOSS | 15 | Unrecoverable data loss or corruption. |
UNAUTHENTICATED | 16 | Request does not have valid authentication credentials. |
import Raindrop from '@liquidmetal-ai/lm-raindrop';
const client = new Raindrop();
// Automatically fetches more pages as needed.for await (const queryGetPaginatedSearchResponse of client.query.getPaginatedSearch({ page: 1, pageSize: 10, requestId: '<YOUR-REQUEST-ID>',})) { console.log(queryGetPaginatedSearchResponse.chunkSignature);}
from raindrop import Raindrop
client = Raindrop()page = client.query.get_paginated_search( page=1, page_size=10, request_id="<YOUR-REQUEST-ID>",)page = page.results[0]print(page.chunk_signature)
package main
import ( "context" "fmt"
"github.com/LiquidMetal-AI/lm-raindrop-go-sdk" "github.com/LiquidMetal-AI/lm-raindrop-go-sdk/option")
func main() { client := raindrop.NewClient( option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RAINDROP_API_KEY") ) page, err := client.Query.GetPaginatedSearch(context.TODO(), raindrop.QueryGetPaginatedSearchParams{ Page: raindrop.Int(1), PageSize: raindrop.Int(10), RequestID: "<YOUR-REQUEST-ID>", }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page)}
package com.raindrop.api.example;
import com.raindrop.api.client.RaindropClient;import com.raindrop.api.client.okhttp.RaindropOkHttpClient;import com.raindrop.api.models.query.QueryGetPaginatedSearchPage;import com.raindrop.api.models.query.QueryGetPaginatedSearchParams;
public final class Main { private Main() {}
public static void main(String[] args) { // Configures using the `RAINDROP_API_KEY` and `RAINDROP_BASE_URL` environment variables RaindropClient client = RaindropOkHttpClient.fromEnv();
QueryGetPaginatedSearchParams params = QueryGetPaginatedSearchParams.builder() .page(1) .pageSize(10) .requestId("<YOUR-REQUEST-ID>") .build(); QueryGetPaginatedSearchPage page = client.query().getPaginatedSearch(params); }}
curl -X POST "https://api.raindrop.run/v1/search_get_page" \ -H "Authorization: Bearer lm_apikey_..." \ -H "Content-Type: application/json" \ -d '{ "request_id": "<YOUR-REQUEST-ID>", "page": 1, "page_size": 10}'
Response Examples
{ "results": [ { "chunkSignature": "chunk_123abc", "text": "Sample text", "score": 0.95 } ], "pagination": { "total": 100, "page": 2, "pageSize": 10, "totalPages": 10 }}
POST /v1/answer
Answers a question based on the entire content of a bucket. This combines a chunk search and an LLM to answer the question.
Schema Reference
Request Body
bucketLocation
(object
) Required
Details
Description
The bucket to search. Must be a valid, registered Smart Bucket.
Example
{ "bucket": { "name": "my-bucket", "version": "01jtgtraw3b5qbahrhvrj3ygbb", "applicationName": "my-app" }}
input
(string
) Required
Details
Description
The question to answer.
Example
What is the capital of France?
answer
(string
)
Details
Description
The answer to the question based on all your documents in your bucket.
Example
The capital of France is Paris.
code
(string
)
Details
Description
Status codes and their meanings:
Code | Number | Description |
---|---|---|
OK | 0 | No error occurred. |
CANCELLED | 1 | The operation was cancelled, typically by the caller. |
UNKNOWN | 2 | Unknown error. Usually means a server error not mapped to a known code. |
INVALID_ARGUMENT | 3 | Client specified an invalid argument. |
DEADLINE_EXCEEDED | 4 | Deadline expired before operation could complete. |
NOT_FOUND | 5 | Requested entity was not found. |
ALREADY_EXISTS | 6 | Entity that a client attempted to create already exists. |
PERMISSION_DENIED | 7 | Caller doesn’t have permission. |
RESOURCE_EXHAUSTED | 8 | Some resource has been exhausted (e.g., quota, memory). |
FAILED_PRECONDITION | 9 | Operation rejected because system not in required state. |
ABORTED | 10 | Operation aborted, usually due to concurrency issues. |
OUT_OF_RANGE | 11 | Argument out of acceptable range. |
UNIMPLEMENTED | 12 | Operation not implemented or supported. |
INTERNAL | 13 | Internal error. |
UNAVAILABLE | 14 | Service is currently unavailable. |
DATA_LOSS | 15 | Unrecoverable data loss or corruption. |
UNAUTHENTICATED | 16 | Request does not have valid authentication credentials. |
import Raindrop from '@liquidmetal-ai/lm-raindrop';
const client = new Raindrop();
const answer = await client.answer.create({ bucketLocation: { bucket: { name: 'my-bucket' } }, input: 'What is the capital of France?',});
console.log(answer.answer);
from raindrop import Raindrop
client = Raindrop()answer = client.answer.create( bucket_location={ "bucket": { "name": "my-bucket" } }, input="What is the capital of France?",)print(answer.answer)
package main
import ( "context" "fmt"
"github.com/LiquidMetal-AI/lm-raindrop-go-sdk" "github.com/LiquidMetal-AI/lm-raindrop-go-sdk/option")
func main() { client := raindrop.NewClient( option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RAINDROP_API_KEY") ) answer, err := client.Answer.New(context.TODO(), raindrop.AnswerNewParams{ BucketLocation: raindrop.BucketLocatorUnionParam{ OfBucket: &raindrop.BucketLocatorBucketParam{ Bucket: raindrop.BucketLocatorBucketBucketParam{ Name: "my-bucket", }, }, }, Input: "What is the capital of France?", }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", answer.Answer)}
package com.raindrop.api.example;
import com.raindrop.api.client.RaindropClient;import com.raindrop.api.client.okhttp.RaindropOkHttpClient;import com.raindrop.api.models.answer.AnswerCreateParams;import com.raindrop.api.models.answer.AnswerCreateResponse;import com.raindrop.api.models.query.BucketLocator;
public final class Main { private Main() {}
public static void main(String[] args) { // Configures using the `RAINDROP_API_KEY` and `RAINDROP_BASE_URL` environment variables RaindropClient client = RaindropOkHttpClient.fromEnv();
AnswerCreateParams params = AnswerCreateParams.builder() .bucketLocation(BucketLocator.Bucket.builder() .bucket(BucketLocator.Bucket.InnerBucket.builder() .name("my-bucket") .build()) .build()) .input("What is the capital of France?") .build(); AnswerCreateResponse answer = client.answer().create(params); }}
# Coming soon
curl -X POST https://api-stage.raindrop.run/v1/answer \ -H "Authorization: Bearer lm_apikey_..." \ -H "Content-Type: application/json" \ -d '{ "bucket_location": { "name": "my-smart-bucket" }, "input": "What is liquidmetal?" }'
Response Examples
{ "answer": "LiquidMetal is a platform for building and deploying serverless applications and AI agents."}