slight refactoring

This commit is contained in:
LangChain4j 2024-09-04 15:23:06 +02:00
parent b29d31029f
commit 8e8b7a526d
3 changed files with 10 additions and 7 deletions

View File

@ -16,7 +16,7 @@ import java.util.Base64;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.params.provider.EnumSource.Mode.EXCLUDE;
@Disabled("expensive to run very often")
@Disabled("Run manually before release. Expensive to run very often.")
public class AzureOpenAiImageModelIT {
@Test

View File

@ -15,7 +15,7 @@ import static dev.ai4j.openai4j.image.ImageModel.*;
import static dev.langchain4j.model.openai.OpenAiImageModelName.DALL_E_2;
import static org.assertj.core.api.Assertions.assertThat;
@Disabled("expensive to run very often")
@Disabled("Run manually before release. Expensive to run very often.")
class OpenAiImageModelIT {
Logger log = LoggerFactory.getLogger(OpenAiImageModelIT.class);

View File

@ -13,15 +13,18 @@ import org.junit.jupiter.api.Disabled;
import static dev.langchain4j.internal.Utils.randomUUID;
@Disabled("Free sandbox expires every 14 days. Run manually before release.")
@Disabled("Run manually before release. Free sandbox expires every 14 days.")
class CloudWeaviateEmbeddingStoreIT extends EmbeddingStoreIT {
private static final String WEAVIATE_API_KEY = "";
private static final String WEAVIATE_HOST = "";
String objectClass = "Test" + randomUUID().replace("-", "");
EmbeddingStore<TextSegment> embeddingStore = WeaviateEmbeddingStore.builder()
.apiKey(System.getenv("WEAVIATE_API_KEY"))
.apiKey(WEAVIATE_API_KEY)
.scheme("https")
.host(System.getenv("WEAVIATE_HOST"))
.host(WEAVIATE_HOST)
.objectClass(objectClass)
.metadataKeys(LocalWeaviateEmbeddingStoreIT.METADATA_KEYS)
.build();
@ -41,7 +44,7 @@ class CloudWeaviateEmbeddingStoreIT extends EmbeddingStoreIT {
@Override
protected void clearStore() {
try {
WeaviateClient client = WeaviateAuthClient.apiKey(new Config("https", System.getenv("WEAVIATE_HOST")), System.getenv("WEAVIATE_API_KEY"));
WeaviateClient client = WeaviateAuthClient.apiKey(new Config("https", WEAVIATE_HOST), WEAVIATE_API_KEY);
client.batch().objectsBatchDeleter()
.withClassName(objectClass)
.run();
@ -52,6 +55,6 @@ class CloudWeaviateEmbeddingStoreIT extends EmbeddingStoreIT {
@Override
protected void ensureStoreIsEmpty() {
// TODO fix
}
}