基本信息

来源摘要/节选

公开展示已截断至最多 800 个字符;请访问原始来源查看完整上下文。

这是一套可直接复用的 Spring AI Demo:同一套 API 同时支持 OpenAI 与 Ollama ,按 provider 路由模型,支持 model 运行时覆盖;会话上下文通过 Redis 持久化 ChatMemory 进行多轮对话;同时提供同步与 SSE 流式 接口;并用 AOP 统一记录耗时、token 使用与异常。 下面按项目现有代码结构,把关键实现串起来讲清楚(复制即可跑)。 依赖与版本:Spring Boot 3.5.x + Spring AI 1.1.2 + JDK17 项目用 BOM 锁定 Spring AI 版本,避免依赖漂移: <!– pom.xml –> < parent > < groupId > org.springframework.boot </ groupId > < artifactId > spring-boot-starter-parent </ artifactId > < version > 3.5.8 </ version > < relativePath /> </ parent > < properties > < java.version > 17 </ java.version > < spring-ai.version > 1.1.2 </ spring-ai.version > </ properties > < dependencyManagement > < dependencies > < dependency > < groupId > org.springframework.ai </ groupId > < artifactId > spring-ai-bom </ artifactId > < version > ${spring-ai.version} </ version > < ty…

来源说明

当前只保存了公开页面节选,不代表原文全文。请以原始来源为准。

本页只呈现已做哈希绑定的来源证据,不包含基于旧正文或缺失原文的扩展推断。