import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
embedding_response = client.models.embeddings.create(
model_deployment_id="model_deployment_id",
texts=["string"],
)
print(embedding_response.embeddings){
"embeddings": [
[
"<string>",
[
123
]
]
],
"tokens_used": 0
}Computes the text embeddings for text fragments using the model with the given model_deployment_id.
Users can use this API to execute EMBEDDING type EGP model they have access to. To use this API, pass in the id of a model returned by the V3 Create Model API. An example text embedding request
{
"texts": ["Please compute my embedding vector", "Another text fragment"]
}
import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
embedding_response = client.models.embeddings.create(
model_deployment_id="model_deployment_id",
texts=["string"],
)
print(embedding_response.embeddings){
"embeddings": [
[
"<string>",
[
123
]
]
],
"tokens_used": 0
}