Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: analyticdb+postgresql vectore #74

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions spring-ai-alibaba-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@
<version>4.12.0</version>
</dependency>

<dependency>
<groupId>com.aliyun</groupId>
<artifactId>gpdb20160503</artifactId>
<version>3.0.0</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.75</version>
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>org.springframework.ai</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
package com.alibaba.cloud.ai.dashscope.rag;

/**
* @author HeYQ
* @version 1.0
* @since 2024-10-23 20:22
*/
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.HashMap;
import java.util.Map;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class AnalyticdbConfig {

private String accessKeyId;

private String accessKeySecret;

private String regionId;

private String DBInstanceId;

private String managerAccount;

private String managerAccountPassword;

private String namespace;

private String namespacePassword;

private String metrics = "cosine";

private Integer readTimeout = 60000;

private Long embeddingDimension = 1536L;

private String userAgent = "index";

public AnalyticdbConfig() {

}

public AnalyticdbConfig(String accessKeyId, String accessKeySecret, String regionId, String DBInstanceId,
String managerAccount, String managerAccountPassword, String namespace, String namespacePassword,
String metrics, Integer readTimeout, Long embeddingDimension, String userAgent) {
this.accessKeyId = accessKeyId;
this.accessKeySecret = accessKeySecret;
this.regionId = regionId;
this.DBInstanceId = DBInstanceId;
this.managerAccount = managerAccount;
this.managerAccountPassword = managerAccountPassword;
this.namespace = namespace;
this.namespacePassword = namespacePassword;
this.metrics = metrics;
this.readTimeout = readTimeout;
this.embeddingDimension = embeddingDimension;
this.userAgent = userAgent;
}

public Map<String, Object> toAnalyticdbClientParams() {
Map<String, Object> params = new HashMap<>();
params.put("accessKeyId", this.accessKeyId);
params.put("accessKeySecret", this.accessKeySecret);
params.put("regionId", this.regionId);
params.put("readTimeout", this.readTimeout);
params.put("userAgent", this.userAgent);
return params;
}

public String getAccessKeyId() {
return accessKeyId;
}

public AnalyticdbConfig setAccessKeyId(String accessKeyId) {
this.accessKeyId = accessKeyId;
return this;
}

public String getAccessKeySecret() {
return accessKeySecret;
}

public AnalyticdbConfig setAccessKeySecret(String accessKeySecret) {
this.accessKeySecret = accessKeySecret;
return this;
}

public String getRegionId() {
return regionId;
}

public AnalyticdbConfig setRegionId(String regionId) {
this.regionId = regionId;
return this;
}

public String getDBInstanceId() {
return DBInstanceId;
}

public AnalyticdbConfig setDBInstanceId(String DBInstanceId) {
this.DBInstanceId = DBInstanceId;
return this;
}

public String getManagerAccount() {
return managerAccount;
}

public AnalyticdbConfig setManagerAccount(String managerAccount) {
this.managerAccount = managerAccount;
return this;
}

public String getManagerAccountPassword() {
return managerAccountPassword;
}

public AnalyticdbConfig setManagerAccountPassword(String managerAccountPassword) {
this.managerAccountPassword = managerAccountPassword;
return this;
}

public String getNamespace() {
return namespace;
}

public AnalyticdbConfig setNamespace(String namespace) {
this.namespace = namespace;
return this;
}

public String getNamespacePassword() {
return namespacePassword;
}

public AnalyticdbConfig setNamespacePassword(String namespacePassword) {
this.namespacePassword = namespacePassword;
return this;
}

public String getMetrics() {
return metrics;
}

public AnalyticdbConfig setMetrics(String metrics) {
this.metrics = metrics;
return this;
}

public Integer getReadTimeout() {
return readTimeout;
}

public AnalyticdbConfig setReadTimeout(Integer readTimeout) {
this.readTimeout = readTimeout;
return this;
}

public Long getEmbeddingDimension() {
return embeddingDimension;
}

public AnalyticdbConfig setEmbeddingDimension(Long embeddingDimension) {
this.embeddingDimension = embeddingDimension;
return this;
}

public String getUserAgent() {
return userAgent;
}

public AnalyticdbConfig setUserAgent(String userAgent) {
this.userAgent = userAgent;
return this;
}

}
Loading