Documentations
Text embedding(Beta)
Service: agent.api.yating.tw/v1/
Request
URL: /embeddings
Method: POST
Header
Name
| Type
| Info
|
*key | String
| Bearer {key}
|
Body
Name
| Type
| Info
|
*model | String
| Similarity:
text-encoder-v1
Question answering:
text-encoder-question-v1, text-encoder-answer-v1 |
inputs
| Int
| 每個item長度至多 512 tokens,計算方式是:1. 一個中文字算一個token2. 英文一個 wordpiece 算一個token,例如embedding算三個 (em, bed, ding) ** for English, You can think of tokens as pieces of words used for natural language processing. For English text, 1 token is approximately 4 characters or 0.75 words. As a point of reference, the collected works of Shakespeare are about 900,000 words or 1.2M tokens |
Example
|
Response
Name
| Type
| Info
|
data | String
| |
data.embedding
| list
| embeddings
|
data.index
| Int
| |
usage
| String
| Total tokens generated in this request.
|
Example
|