EmbeddingApi
All URIs are relative to https://app.coactive.ai
get_embedding_by_id
EmbeddingResponse get_embedding_by_id(embedding_id)
Get embedding by id
Example
- Bearer Authentication (HTTPBearer):
| import time
import coactive
from coactive.apis import EmbeddingApi
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse
from coactive.model.embedding_response import EmbeddingResponse
# Defining the host is optional and defaults to https://app.coactive.ai.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: HTTPBearer
# See configuration.py for a list of all supported configuration parameters.
from YOUR_ENV import CLIENT_ID, CLIENT_SECRET
configuration = coactive.Configuration(
host = "https://app.coactive.ai",
access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)
# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = EmbeddingApi(api_client)
embedding_id = "b78a6e5f-5434-46c4-9e4f-ded092147584"
# example passing only required values which don't have defaults set
try:
# Get embedding by id
api_response = api_instance.get_embedding_by_id(embedding_id)
print(api_response)
except coactive.ApiException as e:
print("Exception when calling EmbeddingApi->get_embedding_by_id: %s\n" % e)
|
Parameters
Name |
Type |
Description |
Notes |
embedding_id |
str |
The unique identifier for the embedding |
|
Return type
EmbeddingResponse
Authorization
HTTPBearer
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
200 |
The embedding |
- |
403 |
Authentication error |
- |
401 |
Unauthorized |
- |
404 |
Embedding not found |
- |
422 |
Validation Error |
- |
[Back to top] [Back to API list] [Back to Model list] [Back to home]
get_embeddings_by_dataset_id
EmbeddingListResponse get_embeddings_by_dataset_id(dataset_id)
Get embeddings by dataset id
Example
- Bearer Authentication (HTTPBearer):
| import time
import coactive
from coactive.apis import EmbeddingApi
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse
from coactive.model.embedding_list_response import EmbeddingListResponse
# Defining the host is optional and defaults to https://app.coactive.ai.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: HTTPBearer
# See configuration.py for a list of all supported configuration parameters.
from YOUR_ENV import CLIENT_ID, CLIENT_SECRET
configuration = coactive.Configuration(
host = "https://app.coactive.ai",
access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)
# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = EmbeddingApi(api_client)
dataset_id = "556f4d52-a557-461e-a204-69236fd9c1e2"
offset = 0 # (optional) if omitted the server will use the default value of 0
limit = 100 # (optional) if omitted the server will use the default value of 100
# example passing only required values which don't have defaults set
try:
# Get embeddings by dataset id
api_response = api_instance.get_embeddings_by_dataset_id(dataset_id)
print(api_response)
except coactive.ApiException as e:
print("Exception when calling EmbeddingApi->get_embeddings_by_dataset_id: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Get embeddings by dataset id
api_response = api_instance.get_embeddings_by_dataset_id(dataset_id, offset=offset, limit=limit)
print(api_response)
except coactive.ApiException as e:
print("Exception when calling EmbeddingApi->get_embeddings_by_dataset_id: %s\n" % e)
|
Parameters
Name |
Type |
Description |
Notes |
dataset_id |
str |
The unique identifier for the dataset |
|
offset |
int, none_type |
Starting index to return |
[optional] if omitted the server will use the default value of 0 |
limit |
int, none_type |
Max number of items to return |
[optional] if omitted the server will use the default value of 100 |
Return type
EmbeddingListResponse
Authorization
HTTPBearer
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
200 |
A list of embeddings |
- |
403 |
Authentication error |
- |
401 |
Unauthorized |
- |
404 |
Dataset not found |
- |
422 |
Validation Error |
- |
[Back to top] [Back to API list] [Back to Model list] [Back to home]
get_encoder_for_embedding
bool, date, datetime, dict, float, int, list, str, none_type get_encoder_for_embedding(embedding_id)
Get encoder for embedding
Example
- Bearer Authentication (HTTPBearer):
| import time
import coactive
from coactive.apis import EmbeddingApi
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse
# Defining the host is optional and defaults to https://app.coactive.ai.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: HTTPBearer
# See configuration.py for a list of all supported configuration parameters.
from YOUR_ENV import CLIENT_ID, CLIENT_SECRET
configuration = coactive.Configuration(
host = "https://app.coactive.ai",
access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)
# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = EmbeddingApi(api_client)
embedding_id = "b78a6e5f-5434-46c4-9e4f-ded092147584"
# example passing only required values which don't have defaults set
try:
# Get encoder for embedding
api_response = api_instance.get_encoder_for_embedding(embedding_id)
print(api_response)
except coactive.ApiException as e:
print("Exception when calling EmbeddingApi->get_encoder_for_embedding: %s\n" % e)
|
Parameters
Name |
Type |
Description |
Notes |
embedding_id |
str |
The unique identifier for the embedding |
|
Return type
bool, date, datetime, dict, float, int, list, str, none_type
Authorization
HTTPBearer
- Content-Type: Not defined
- Accept: application/json, application/octet-stream
HTTP response details
Status code |
Description |
Response headers |
200 |
Streaming response of encoder |
- |
403 |
Authentication error |
- |
401 |
Unauthorized |
- |
404 |
Encoder not found |
- |
422 |
Validation Error |
- |
[Back to top] [Back to API list] [Back to Model list] [Back to home]
update_embedding_by_id
EmbeddingResponse update_embedding_by_id(embedding_id, update_embedding_request)
Update embedding by id
Example
- Bearer Authentication (HTTPBearer):
| import time
import coactive
from coactive.apis import EmbeddingApi
from coactive.model.update_embedding_request import UpdateEmbeddingRequest
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse
from coactive.model.embedding_response import EmbeddingResponse
# Defining the host is optional and defaults to https://app.coactive.ai.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: HTTPBearer
# See configuration.py for a list of all supported configuration parameters.
from YOUR_ENV import CLIENT_ID, CLIENT_SECRET
configuration = coactive.Configuration(
host = "https://app.coactive.ai",
access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)
# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = EmbeddingApi(api_client)
embedding_id = "b78a6e5f-5434-46c4-9e4f-ded092147584"
update_embedding_request = UpdateEmbeddingRequest(
description="A collection of embeddings using the default encoder",
)
# example passing only required values which don't have defaults set
try:
# Update embedding by id
api_response = api_instance.update_embedding_by_id(embedding_id, update_embedding_request)
print(api_response)
except coactive.ApiException as e:
print("Exception when calling EmbeddingApi->update_embedding_by_id: %s\n" % e)
|
Parameters
Name |
Type |
Description |
Notes |
embedding_id |
str |
The unique identifier for the embedding |
|
update_embedding_request |
UpdateEmbeddingRequest |
|
|
Return type
EmbeddingResponse
Authorization
HTTPBearer
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
200 |
The updated embedding |
- |
403 |
Authentication error |
- |
401 |
Unauthorized |
- |
404 |
Embedding not found |
- |
422 |
Validation Error |
- |
[Back to top] [Back to API list] [Back to Model list] [Back to home]