Coroutine-native client covering the full Hanzo /v1 cloud surface, for JVM and Android. Generated with openapi-generator kotlin (library=jvm-okhttp4, useCoroutines=true). Coordinate: ai.hanzo:sdk. Base URL: https://api.hanzo.ai. Co-authored-by: Hanzo Dev <[email protected]>
5.9 KiB
CollectionsApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| vectorCreateCollection | PUT /v1/vector/collections/{collection_name} | Create collection |
| vectorDeleteCollection | DELETE /v1/vector/collections/{collection_name} | Delete collection |
| vectorGetCollection | GET /v1/vector/collections/{collection_name} | Get collection info |
| vectorListCollections | GET /v1/vector/collections | List collections |
vectorCreateCollection
VectorCreateCollection200Response vectorCreateCollection(collectionName, vectorCreateCollectionRequest)
Create collection
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CollectionsApi()
val collectionName : kotlin.String = collectionName_example // kotlin.String |
val vectorCreateCollectionRequest : VectorCreateCollectionRequest = // VectorCreateCollectionRequest |
try {
val result : VectorCreateCollection200Response = apiInstance.vectorCreateCollection(collectionName, vectorCreateCollectionRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling CollectionsApi#vectorCreateCollection")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CollectionsApi#vectorCreateCollection")
e.printStackTrace()
}
Parameters
| collectionName | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| vectorCreateCollectionRequest | VectorCreateCollectionRequest |
Return type
VectorCreateCollection200Response
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
vectorDeleteCollection
VectorCreateCollection200Response vectorDeleteCollection(collectionName)
Delete collection
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CollectionsApi()
val collectionName : kotlin.String = collectionName_example // kotlin.String |
try {
val result : VectorCreateCollection200Response = apiInstance.vectorDeleteCollection(collectionName)
println(result)
} catch (e: ClientException) {
println("4xx response calling CollectionsApi#vectorDeleteCollection")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CollectionsApi#vectorDeleteCollection")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| collectionName | kotlin.String |
Return type
VectorCreateCollection200Response
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
vectorGetCollection
VectorGetCollection200Response vectorGetCollection(collectionName)
Get collection info
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CollectionsApi()
val collectionName : kotlin.String = collectionName_example // kotlin.String |
try {
val result : VectorGetCollection200Response = apiInstance.vectorGetCollection(collectionName)
println(result)
} catch (e: ClientException) {
println("4xx response calling CollectionsApi#vectorGetCollection")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CollectionsApi#vectorGetCollection")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| collectionName | kotlin.String |
Return type
VectorGetCollection200Response
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
vectorListCollections
VectorListCollections200Response vectorListCollections()
List collections
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CollectionsApi()
try {
val result : VectorListCollections200Response = apiInstance.vectorListCollections()
println(result)
} catch (e: ClientException) {
println("4xx response calling CollectionsApi#vectorListCollections")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CollectionsApi#vectorListCollections")
e.printStackTrace()
}
Parameters
This endpoint does not need any parameter.
Return type
VectorListCollections200Response
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json