> ## Documentation Index
> Fetch the complete documentation index at: https://javaai.pig4cloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 快速入门

本节提供了开始使用Spring AI的切入点。

您应该根据自己的需求按照以下各部分的步骤进行操作。

<Note>Spring AI支持Spring Boot 3.4.x。当Spring Boot 3.5.x发布时，我们也将支持它。</Note>

## Spring Initializr

前往[start.spring.io](https://start.spring.io/)并选择您希望在新应用程序中使用的AI模型和向量存储。

## 制品仓库

### 正式版本 - 使用Maven中央仓库

从1.0.0-M6开始，发布版本可在Maven中央仓库获得。
您的构建文件不需要任何更改。

## 依赖管理

Spring AI物料清单(BOM)声明了Spring AI特定发布版本使用的所有依赖项的推荐版本。
这是一个仅包含BOM的版本，它只包含依赖管理，没有插件声明或对Spring或Spring Boot的直接引用。
您可以使用Spring Boot父POM，或使用Spring Boot的BOM（`spring-boot-dependencies`）来管理Spring Boot版本。

向您的项目添加BOM：

<Tabs>
  <Tab title="Maven">
    ```xml theme={"system"}
    <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-bom</artifactId>
            <version>${spring-ai.version}</version>
            <type>pom</type>
            <scope>import</scope>
          </dependency>
        </dependencies>
      </dependencyManagement>
    ```
  </Tab>

  <Tab title="Gradle">
    ```groovy theme={"system"}
    dependencies {
      implementation platform("org.springframework.ai:spring-ai-bom:1.0.0")
      // 将以下内容替换为您希望使用的特定模块的启动器依赖项
      implementation 'org.springframework.ai:spring-ai-openai'
    }
    ```

    Gradle用户还可以通过利用Gradle（5.0+）原生支持使用Maven BOM声明依赖约束来使用Spring AI BOM。这是通过在Gradle构建脚本的依赖部分添加'platform'依赖处理方法来实现的。
  </Tab>
</Tabs>

## 添加特定组件的依赖项

文档中的以下每个部分都显示了您需要添加到项目构建系统的依赖项。

<CardGroup cols={2}>
  <Card title="聊天模型" icon="comments" href="/spring4ai/api/chatmodel">
    可以生成对话文本响应的模型
  </Card>

  <Card title="嵌入模型" icon="vector-square" href="/spring4ai/api/embeddings">
    将文本转换为向量表示的模型
  </Card>

  <Card title="图像生成模型" icon="image" href="/spring4ai/api/imageclient">
    可以从文本提示生成图像的模型
  </Card>

  <Card title="转录模型" icon="microphone" href="/spring4ai/api/audio/transcriptions">
    将音频转换为文本的模型
  </Card>

  <Card title="文本转语音模型" icon="volume-high" href="/spring4ai/api/audio/speech">
    将文本转换为语音的模型
  </Card>

  <Card title="向量数据库" icon="database" href="/spring4ai/api/vectordbs/index">
    优化用于存储和搜索向量嵌入的数据库
  </Card>
</CardGroup>

## Spring AI示例

请参考[此页面](https://github.com/danvega/awesome-spring-ai)获取更多与Spring AI相关的资源和示例。

<Card title="文档有误？请协助编辑" icon="pencil" href="https://github.com/javaai-pig4cloud-com/javaai-docs/edit/main/spring-ai/getting-started.mdx">
  发现文档问题？点击此处直接在 GitHub 上编辑并提交 PR，帮助我们改进文档！
</Card>
