All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| get_text_embeddings | POST /embeddings | Get Text Embeddings |
object get_text_embeddings(open_ai_embeddings_request, tracking_id=tracking_id)
Get Text Embeddings
Create embeddings based on text(s)
- OAuth Authentication (OAuth2PasswordBearer):
- Api Key Authentication (APIKeyCookie):
import cms_client
from cms_client.models.open_ai_embeddings_request import OpenAIEmbeddingsRequest
from cms_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = cms_client.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Configure API key authorization: APIKeyCookie
configuration.api_key['APIKeyCookie'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyCookie'] = 'Bearer'
# Enter a context with an instance of the API client
with cms_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = cms_client.EmbeddingsApi(api_client)
open_ai_embeddings_request = cms_client.OpenAIEmbeddingsRequest() # OpenAIEmbeddingsRequest |
tracking_id = 'tracking_id_example' # str | The tracking ID of the requested task (optional)
try:
# Get Text Embeddings
api_response = api_instance.get_text_embeddings(open_ai_embeddings_request, tracking_id=tracking_id)
print("The response of EmbeddingsApi->get_text_embeddings:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EmbeddingsApi->get_text_embeddings: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| open_ai_embeddings_request | OpenAIEmbeddingsRequest | ||
| tracking_id | str | The tracking ID of the requested task | [optional] |
object
OAuth2PasswordBearer, APIKeyCookie
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]