|
@@ -61,7 +61,7 @@ public class VectorStoreServiceImpl implements VectorStoreService {
|
|
|
@Value("${file.base-url}")
|
|
@Value("${file.base-url}")
|
|
|
private String baseUrl;
|
|
private String baseUrl;
|
|
|
|
|
|
|
|
- @Value("${file.xinference-url}")
|
|
|
|
|
|
|
+ @Value("${enflame.url}")
|
|
|
private String xinferenceUrl;
|
|
private String xinferenceUrl;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -832,10 +832,10 @@ public class VectorStoreServiceImpl implements VectorStoreService {
|
|
|
|
|
|
|
|
|
|
|
|
|
// 4️⃣ 生成向量
|
|
// 4️⃣ 生成向量
|
|
|
- List<Double> vector;
|
|
|
|
|
|
|
+ List<Double> exampleVector;
|
|
|
try {
|
|
try {
|
|
|
- vector = xinferenceClient.getEmbedding(modelName, ruleContent);
|
|
|
|
|
- List<Double> exampleVector = xinferenceClient.getEmbedding(modelName, exampleContent);
|
|
|
|
|
|
|
+// vector = xinferenceClient.getEmbedding(modelName, ruleContent);
|
|
|
|
|
+ exampleVector = xinferenceClient.getEmbedding(modelName, exampleContent);
|
|
|
properties.put("exampleVector", exampleVector);
|
|
properties.put("exampleVector", exampleVector);
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
log.error("❌ 第 {} 条生成向量失败: {}", i, e.getMessage());
|
|
log.error("❌ 第 {} 条生成向量失败: {}", i, e.getMessage());
|
|
@@ -846,7 +846,7 @@ public class VectorStoreServiceImpl implements VectorStoreService {
|
|
|
Result<WeaviateObject> result = client.data().creator()
|
|
Result<WeaviateObject> result = client.data().creator()
|
|
|
.withClassName(classname)
|
|
.withClassName(classname)
|
|
|
.withProperties(properties)
|
|
.withProperties(properties)
|
|
|
- .withVector(toFloatArray(vector))
|
|
|
|
|
|
|
+ .withVector(toFloatArray(exampleVector))
|
|
|
.run();
|
|
.run();
|
|
|
|
|
|
|
|
if (result.hasErrors()) {
|
|
if (result.hasErrors()) {
|
|
@@ -1020,8 +1020,7 @@ public class VectorStoreServiceImpl implements VectorStoreService {
|
|
|
" ruleContent%n" +
|
|
" ruleContent%n" +
|
|
|
" type%n" +
|
|
" type%n" +
|
|
|
" exampleContent%n" +
|
|
" exampleContent%n" +
|
|
|
- " exampleVector%n" +
|
|
|
|
|
- " _additional { id distance certainty vector }%n" + // ✅ 加上vector
|
|
|
|
|
|
|
+ " _additional { id distance certainty }%n" +
|
|
|
" }%n" +
|
|
" }%n" +
|
|
|
" }%n" +
|
|
" }%n" +
|
|
|
"}",
|
|
"}",
|