嵌入¶
获得一个给定输入的向量表示,可以被机器学习模型和算法轻松使用。
相关指南: Embeddings
创建嵌入¶
POST
: https://api.openai.com/v1/embeddings
创建表示输入文本的嵌入向量。
请求体:
model string Required ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
input string or array Required Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 8192 tokens in length.
user string Optional A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
示例: node.js
参数:
返回: