Skip to content
Agentmart
Submit a tool

spring-ai

Provides comprehensive guidance for Spring AI including AI model integration, prompt templates, vector stores, and AI applications.

Skill by full-stack-skills

IndexedApache-2.0★ 3
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/full-stack-skills-spring-ai

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Provides comprehensive guidance for Spring AI including AI model integration, prompt templates, vector stores, and AI applications. Use when the user asks about Spring AI, needs to integrate AI models, implement RAG applications, or work with AI services in Spring.

Use cases: ml, agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/spring-ai

What's inside

Skill name
spring-ai
Description
Provides comprehensive guidance for Spring AI including AI model integration, prompt templates, vector stores, and AI applications. Use when the user asks about Spring AI, needs to integrate AI models, implement RAG applications, or work with AI services in Spring.
License
Apache-2.0
Instructions
395 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • openai.yaml · agents/

SKILL.md (first lines)

# Spring AI 开发指南

## 概述

Spring AI 是 Spring 官方提供的 AI 应用开发框架,简化了与各种大语言模型(LLM)的集成,包括 OpenAI、Anthropic、Azure OpenAI 等。

## 核心功能

### 1. 项目创建

**依赖**:

```xml
<dependency>
    <groupId>org.springframework.ai</groupId>
    <artifactId>spring-ai-openai-spring-boot-starter</artifactId>
</dependency>
```

**或使用 Gradle**:

```gradle
dependencies {
    implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
}
```

### 2. Chat Client

**配置**:

```yaml
spring:
  ai:
    openai:
      api-key: ${OPENAI_API_KEY}
      chat:
        options:
          model: gpt-4
          temperature: 0.7
```

**使用 ChatClient**:

```java
@Service
public class ChatService {
    private final ChatClient chatClient;

    public ChatService(ChatClient chatClient) {
        this.chatClient = chatClient;
    }

    public String chat(String message) {
        return chatClient.call(message);
    }

    public String chatWithPrompt(String userMessage) {
        Prompt prompt = new Prompt(new UserMessage(userMessage));
        ChatResponse response = chatClient.call(prompt);
        return response.getResult().getOutput().getContent();
    }
}
```

**流式响应**:

```java
@Service
public class ChatService {
    private final StreamingChatClient streamingChatClient;

    public ChatService(StreamingChatClient streamingChatClient) {
        this.streamingChatClient = streamingChatClient;
    }

    public Flux<String> streamChat(String message) {
        return streamingChatClient.stream(message)
            .map(response -> response.getResult().getOutput().getContent());
    }
}
```

### 3. Prompt Template

**定义模板**:

```java
@Service
public class PromptService {
    private final PromptTemplate promptTemplate;

    public PromptService() {
        this.promptTemplate = new PromptTemplate(
            "请用{style}风格回答以下问题:{question}"
        );
    }

    public String generatePrompt(String style, String question) {
        Map<String, Object> variables = Map.of(
            "style", style,
            "question", question
        );
        return promptTemplate.render(variables);
    }
}
```

**使用 ChatClient**:

```java
@Service
public class ChatService {
    private final ChatClient chatClient;
    private final PromptTemplate promptTemplate;

    public ChatService(ChatClient chatClient) {
        this.chatClient = chatClient;
        this.promptTemplate = new PromptTemplate(
            "请用{style}风格回答以下问题:{question}"

From full-stack-skills/spring-skills, Apache-2.0.

More from full-stack-skills/spring-skills

Signals

Stars
3
Forks
3
Open issues
0
Last commit (this folder)
Oct 3, 2026 (25 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from full-stack-skills

Cite this page

spring-ai skill. Agent Mart. https://agentmart.dev/skills/full-stack-skills-spring-ai (last updated 2026-10-24)