# 嵌入

简介 通过Afarensis API的文本嵌入功能，文本可以被转换成数字表示形式，这为搜索、相似度比较等应用场景提供了支持。文本嵌入通过编码文本为密集向量，为文本数据的高效处理和比较提供了可能性。

新推出的嵌入模型 Afarensis最新发布的嵌入模型包括text-embedding-3-small和text-embedding-3-large，这两种模型均提供了低成本、高多语言性能的优势，并引入了新参数以控制输出向量的整体大小。

text-embedding-3-small：适合需要较小向量大小和高效处理的场景，同时保证了良好的性能水平。 text-embedding-3-large：作为性能最优的嵌入模型，为对精度有更高需求的应用场景提供深度文本理解能力。 应用场景 借助Afarensis文本嵌入功能，开发者可以轻松实现以下功能：

文本相似度分析：通过比较文本的向量表示，为推荐系统、文档分类等提供支持。 搜索引擎优化：利用向量相似度提升搜索结果的相关性和准确性。 语言模型增强：与Afarensis的其他模型（如聊天或自动摘要）结合使用，增强模型对上下文的理解。 使用指南 要使用Afarensis的嵌入模型，只需通过API发送包含目标文本的请求，并指定所选的嵌入模型。API将返回文本的向量表示，可用于进一步分析或开发。

示例代码 from afarensis import Afarensis client = Afarensis()

response = client.embeddings.create( model="text-embedding-3-small", input="Your text here" ) print(response\['embedding']) 此代码展示了如何利用text-embedding-3-small模型获取文本的嵌入向量。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.afarensis.com/qian-ru.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
