通过yml开关控制使用哪些模型和向量库
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.jeesite.modules.cms.ai.properties;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
|
||||
@ConfigurationProperties("spring.ai")
|
||||
public class CmsAiProperties {
|
||||
@@ -20,6 +21,12 @@ public class CmsAiProperties {
|
||||
*/
|
||||
private String defaultPromptTemplate = "";
|
||||
|
||||
/**
|
||||
* 向量数据库设置
|
||||
*/
|
||||
@NestedConfigurationProperty
|
||||
private final Vectorstore vectorstore = new Vectorstore();
|
||||
|
||||
public Boolean getToolCalls() {
|
||||
return toolCalls;
|
||||
}
|
||||
@@ -43,4 +50,24 @@ public class CmsAiProperties {
|
||||
public void setDefaultPromptTemplate(String defaultPromptTemplate) {
|
||||
this.defaultPromptTemplate = defaultPromptTemplate;
|
||||
}
|
||||
|
||||
public Vectorstore getVectorstore() {
|
||||
return vectorstore;
|
||||
}
|
||||
|
||||
public static class Vectorstore {
|
||||
|
||||
/**
|
||||
* 向量库类型选择:chroma、pgvector、elasticsearch、milvus
|
||||
*/
|
||||
private String type;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
spring:
|
||||
ai:
|
||||
|
||||
# 模型选择:openai、ollama
|
||||
model:
|
||||
chat: ollama
|
||||
embedding: ${spring.ai.model.chat}
|
||||
image: ${spring.ai.model.chat}
|
||||
audio: ${spring.ai.model.chat}
|
||||
|
||||
# 在线大模型【请在 pom.xml 中打开 openai 的注释,并注释上其它模型】
|
||||
openai:
|
||||
|
||||
@@ -83,6 +90,9 @@ spring:
|
||||
# 向量数据库配置
|
||||
vectorstore:
|
||||
|
||||
# 向量库类型:chroma、pgvector、elasticsearch、milvus
|
||||
type: chroma
|
||||
|
||||
# Chroma 向量数据库【请在 pom.xml 中打开 chroma 的注释,并注释上其它向量库】
|
||||
chroma:
|
||||
client:
|
||||
|
||||
Reference in New Issue
Block a user