Enable ZhiPu AI ITs only on ZHIPU_AI_API_KEY env present

This commit is contained in:
Christian Tzolov
2024-05-27 08:40:45 +02:00
parent 22a511a6d7
commit 5226d0b9b3
2 changed files with 5 additions and 1 deletions

View File

@@ -16,6 +16,8 @@
package org.springframework.ai.zhipuai.embedding;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.springframework.ai.embedding.EmbeddingResponse;
import org.springframework.ai.zhipuai.ZhiPuAiEmbeddingModel;
import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Geng Rong
*/
@SpringBootTest
@EnabledIfEnvironmentVariable(named = "ZHIPU_AI_API_KEY", matches = ".+")
class EmbeddingIT {
@Autowired

View File

@@ -81,7 +81,8 @@ public class VectorStoreChatMemoryAdvisor extends AbstractChatMemoryAdvisor<Vect
var searchRequest = SearchRequest.query(request.userText())
.withTopK(this.doGetChatMemoryRetrieveSize(context))
.withFilterExpression(DOCUMENT_METADATA_CONVERSATION_ID + "=='" + this.doGetConversationId(context) + "'");
.withFilterExpression(
"'" + DOCUMENT_METADATA_CONVERSATION_ID + "'=='" + this.doGetConversationId(context) + "'");
List<Document> documents = this.getChatMemoryStore().similaritySearch(searchRequest);