无法找到 org.springframework.ai

我在尝试通过使用以下文档将 Llama3 集成到我的 Spring 应用程序中:https://docs.spring.io/spring-ai/reference/1.0-SNAPSHOT/api/chat/ollama-chat.html

在添加依赖后构建应用程序时:

 implementation 'org.springframework.ai:spring-ai-ollama-spring-boot-starter'

我遇到了以下错误:

Execution failed for task ':compileJava'.> Could not resolve all files for configuration ':compileClasspath'.   > Could not find org.springframework.ai:spring-ai-ollama-spring-boot-starter:.

这个 GitHub 问题 https://github.com/spring-projects/spring-ai/issues/194 也没有帮助。根据其中的一个评论更改路径后:

    implementation 'org.springframework.experimental.ai:spring-ai-ollama-spring-boot-starter'

我得到了以下错误:

Execution failed for task ':compileJava'.> Could not resolve all files for configuration ':compileClasspath'.   > Could not find org.springframework.experimental.ai:spring-ai-ollama-spring-boot-starter:

回答:

如果你访问提到的依赖的 Maven 仓库,你会发现该依赖已被重新定位。要解决这个问题,只需将依赖位置更改为正确的路径:

implementation 'io.springboot.ai:spring-ai-ollama-spring-boot-starter:1.0.3'

还值得考虑包含 Spring AI 物料清单 (BOM),正如 @M.Deinum 的评论所指出的,这样可以避免你自己指定和维护依赖版本:

    implementation platform("io.springboot.ai:spring-ai-bom:1.0.3")    // 将以下内容替换为你希望使用的特定模块的启动器依赖    implementation 'io.springboot.ai:spring-ai-ollama-spring-boot-starter'

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注