Create embedding

HTTP request

POST /ai/text_embedding

Authorization

Include your ACCESS TOKEN in HTTP Authorization header.

Authorization: Bearer Token

Request Parameters

KEY
TYPE
VALUE

text

String

The text for which you want to generate an embedding. Example: “Hello, have a good day!”.

configs

JSON

This parameter is a JSON object encompassing a variety of settings you can adjust to customize the image generation process. It includes several parameters, which we will describe next, allowing you to control different aspects of the generation.

model

String

Specifies the AI model used for generating text embedding. There are two models like: "mistral" and "gte-large". Default is "mistral".

Example Request

{
  "text": "Hello, have a good day.",
  "configs": {
    "model": "mistral"
  }
}

Parrot API

text_embedd_task = parrot.create_text_embedding(text, model)

Response

Returns the ID of the successful task.

{
  "data": {
    "text": "Hello, have a good day!",
    "config": {
      "model": "mistral",
      "task_name": "tasks.parrot_mistral_embeddings_task",
      "task_type": "EMBEDDING"
    },
    "task_id": "1277338fd22f4d25890bfca3e6014ee6"
  },
  "errors": [],
  "error_description": "",
  "start_time": "2024-03-15 20:58:40.044957",
  "end_time": "2024-03-15 20:58:40.065424",
  "host_of_client_call_request": "103.186.100.36",
  "total_time_by_second": 0.020472,
  "status": "success"
}

Last updated

Was this helpful?