/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

apply plugin: 'java-library'

description = 'Indexing/Query time integration with LLM'

dependencies {
  compileOnly libs.stephenc.jcip.annotations
  implementation platform(project(':platform'))
  implementation project(':solr:core')
  implementation project(':solr:solrj')

  implementation libs.apache.lucene.core

  implementation libs.langchain4j.core
  runtimeOnly libs.langchain4j.cohere
  runtimeOnly libs.langchain4j.hugging.face
  runtimeOnly libs.langchain4j.mistral.ai
  runtimeOnly libs.langchain4j.open.ai

  implementation libs.slf4j.api

  testImplementation project(':solr:test-framework')
  testImplementation libs.junit.junit
  testImplementation libs.commonsio.commonsio
  
}

// langchain4j has reflection issues, and requires the following permissions
// https://docs.gradle.org/current/userguide/upgrading_version_7.html#removes_implicit_add_opens_for_test_workers
tasks.withType(Test).configureEach {
  jvmArgs(["--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"])
}
