langchain4j/langchain4j-ollama/pom.xml

153 lines
4.7 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-parent</artifactId>
2024-09-09 16:11:09 +08:00
<version>0.35.0-SNAPSHOT</version>
<relativePath>../langchain4j-parent/pom.xml</relativePath>
</parent>
<artifactId>langchain4j-ollama</artifactId>
<name>LangChain4j :: Integration :: Ollama</name>
2024-01-30 14:20:20 +08:00
<properties>
<skipOllamaITs>false</skipOllamaITs>
</properties>
<dependencies>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-core</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
Migrate ollama to jackson (#1072) ## Issue Closes #1042 ## Change Migrate Ollama module from Gson to Jackson. <img width="999" alt="image" src="https://github.com/langchain4j/langchain4j/assets/77151639/723e622a-506f-47ae-9f98-56e761ae69ed"> Note that there are three things confused me(these issues exist in original ollama module): 1. I observe that some tests with inputTokenCount Assertion (such as `assertThat(tokenUsage.inputTokenCount()).isEqualTo(35)`) failed because of the differencet count of input tokens. I don't know whether it's because Ollama's update. Now I correct it 2. `should_propagate_failure_to_handler_onError` in `Streaming{xxx}ModelIT` failed in my local because `NullPointerException` do not have any message. Is it a problem in my local environment? 3. Somtimes if I run tests **individually**, all tests will pass. But if I run them in the same time(such as using command line rather than IDE), they will failed due to some strange reasons(e.g. input token usage will be null). I think Maybe it's a network problem or `Testcontainers`'s problem. I'm not sure if these problems are due to my local environment, so if you have any suggestions or solutions, please let me know! ## General checklist <!-- Please double-check the following points and mark them like this: [X] --> - [x] There are no breaking changes - [ ] I have added unit and integration tests for my change - [x] I have manually run all the unit and integration tests in the module I have added/changed, and they are all green - [x] I have manually run all the unit and integration tests in the [core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core) and [main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j) modules, and they are all green <!-- Before adding documentation and example(s) (below), please wait until the PR is reviewed and approved. --> - [ ] I have added/updated the [documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs) - [ ] I have added an example in the [examples repo](https://github.com/langchain4j/langchain4j-examples) (only for "big" features)
2024-07-16 15:43:10 +08:00
<artifactId>converter-jackson</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
re #1506 Enable Maven enforcer plugin and fix dependency conflict introduced by `okhttp` dependency in 19 modules. (#1645) ## Issue #1506 ## Change Resolved version conflict: ``` [ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence failed with message: [ERROR] Failed while enforcing releasability. [ERROR] [ERROR] Dependency convergence error for org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.9.10 paths to dependency are: [ERROR] +-dev.langchain4j:langchain4j-ollama:jar:0.34.0-SNAPSHOT [ERROR] +-com.squareup.okhttp3:okhttp:jar:4.12.0:compile [ERROR] +-com.squareup.okio:okio:jar:3.6.0:compile [ERROR] +-com.squareup.okio:okio-jvm:jar:3.6.0:compile [ERROR] +-org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.9.10:compile [ERROR] and [ERROR] +-dev.langchain4j:langchain4j-ollama:jar:0.34.0-SNAPSHOT [ERROR] +-com.squareup.okhttp3:okhttp:jar:4.12.0:compile [ERROR] +-org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.8.21:compile [ERROR] [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <args> -rf :langchain4j-ollama ``` ... caused by 'okhttp' dependency and enabled Maven enforcer plugin in the following modules: - LangChain4j :: Integration :: Anthropic - LangChain4j :: Integration :: ChatGLM - LangChain4j :: Integration :: Chroma - LangChain4j :: Integration :: CloudFlare Workers AI - LangChain4j :: Integration :: Cohere - LangChain4j :: Integration :: DashScope - LangChain4j :: Integration :: Hugging Face - LangChain4j :: Integration :: Jina - LangChain4j :: Integration :: Judge0 - LangChain4j :: Integration :: MistralAI - LangChain4j :: Integration :: Nomic - LangChain4j :: Integration :: OVHcloud AI - LangChain4j :: Integration :: Ollama - LangChain4j :: Integration :: Qianfan - LangChain4j :: Integration :: Vearch - LangChain4j :: Integration :: Vespa - LangChain4j :: Integration :: Zhipu AI - LangChain4j :: Web Search Engine :: SearchApi - LangChain4j :: Web Search Engine :: Tavily ## Note Please note that [issue ](https://github.com/square/okhttp/issues/8288) for this was already created in `httpok` repository but it will not be fixed in 4.x. It's reportedly already tackled in version 5.x. With that in mind I suggest we apply temporary changes proposed in this PR. After upgrading to `httpok` 5.x we will be able to remove these. ## Tests `mvn clean test` passed
2024-08-27 23:44:06 +08:00
<!-- DEPENDENCY CONFLICT RESOLUTION FOR OKHTTP (START) -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
re #1506 Enable Maven enforcer plugin and fix dependency conflict introduced by `okhttp` dependency in 19 modules. (#1645) ## Issue #1506 ## Change Resolved version conflict: ``` [ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence failed with message: [ERROR] Failed while enforcing releasability. [ERROR] [ERROR] Dependency convergence error for org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.9.10 paths to dependency are: [ERROR] +-dev.langchain4j:langchain4j-ollama:jar:0.34.0-SNAPSHOT [ERROR] +-com.squareup.okhttp3:okhttp:jar:4.12.0:compile [ERROR] +-com.squareup.okio:okio:jar:3.6.0:compile [ERROR] +-com.squareup.okio:okio-jvm:jar:3.6.0:compile [ERROR] +-org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.9.10:compile [ERROR] and [ERROR] +-dev.langchain4j:langchain4j-ollama:jar:0.34.0-SNAPSHOT [ERROR] +-com.squareup.okhttp3:okhttp:jar:4.12.0:compile [ERROR] +-org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.8.21:compile [ERROR] [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <args> -rf :langchain4j-ollama ``` ... caused by 'okhttp' dependency and enabled Maven enforcer plugin in the following modules: - LangChain4j :: Integration :: Anthropic - LangChain4j :: Integration :: ChatGLM - LangChain4j :: Integration :: Chroma - LangChain4j :: Integration :: CloudFlare Workers AI - LangChain4j :: Integration :: Cohere - LangChain4j :: Integration :: DashScope - LangChain4j :: Integration :: Hugging Face - LangChain4j :: Integration :: Jina - LangChain4j :: Integration :: Judge0 - LangChain4j :: Integration :: MistralAI - LangChain4j :: Integration :: Nomic - LangChain4j :: Integration :: OVHcloud AI - LangChain4j :: Integration :: Ollama - LangChain4j :: Integration :: Qianfan - LangChain4j :: Integration :: Vearch - LangChain4j :: Integration :: Vespa - LangChain4j :: Integration :: Zhipu AI - LangChain4j :: Web Search Engine :: SearchApi - LangChain4j :: Web Search Engine :: Tavily ## Note Please note that [issue ](https://github.com/square/okhttp/issues/8288) for this was already created in `httpok` repository but it will not be fixed in 4.x. It's reportedly already tackled in version 5.x. With that in mind I suggest we apply temporary changes proposed in this PR. After upgrading to `httpok` 5.x we will be able to remove these. ## Tests `mvn clean test` passed
2024-08-27 23:44:06 +08:00
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<!-- DEPENDENCY CONFLICT RESOLUTION FOR OKHTTP (END) -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>ollama</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-core</artifactId>
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-open-ai</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>tinylog-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>slf4j-tinylog</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
2024-01-30 14:20:20 +08:00
<build>
<plugins>
re #1506 Enable Maven enforcer plugin and fix dependency conflict introduced by `okhttp` dependency in 19 modules. (#1645) ## Issue #1506 ## Change Resolved version conflict: ``` [ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence failed with message: [ERROR] Failed while enforcing releasability. [ERROR] [ERROR] Dependency convergence error for org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.9.10 paths to dependency are: [ERROR] +-dev.langchain4j:langchain4j-ollama:jar:0.34.0-SNAPSHOT [ERROR] +-com.squareup.okhttp3:okhttp:jar:4.12.0:compile [ERROR] +-com.squareup.okio:okio:jar:3.6.0:compile [ERROR] +-com.squareup.okio:okio-jvm:jar:3.6.0:compile [ERROR] +-org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.9.10:compile [ERROR] and [ERROR] +-dev.langchain4j:langchain4j-ollama:jar:0.34.0-SNAPSHOT [ERROR] +-com.squareup.okhttp3:okhttp:jar:4.12.0:compile [ERROR] +-org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.8.21:compile [ERROR] [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <args> -rf :langchain4j-ollama ``` ... caused by 'okhttp' dependency and enabled Maven enforcer plugin in the following modules: - LangChain4j :: Integration :: Anthropic - LangChain4j :: Integration :: ChatGLM - LangChain4j :: Integration :: Chroma - LangChain4j :: Integration :: CloudFlare Workers AI - LangChain4j :: Integration :: Cohere - LangChain4j :: Integration :: DashScope - LangChain4j :: Integration :: Hugging Face - LangChain4j :: Integration :: Jina - LangChain4j :: Integration :: Judge0 - LangChain4j :: Integration :: MistralAI - LangChain4j :: Integration :: Nomic - LangChain4j :: Integration :: OVHcloud AI - LangChain4j :: Integration :: Ollama - LangChain4j :: Integration :: Qianfan - LangChain4j :: Integration :: Vearch - LangChain4j :: Integration :: Vespa - LangChain4j :: Integration :: Zhipu AI - LangChain4j :: Web Search Engine :: SearchApi - LangChain4j :: Web Search Engine :: Tavily ## Note Please note that [issue ](https://github.com/square/okhttp/issues/8288) for this was already created in `httpok` repository but it will not be fixed in 4.x. It's reportedly already tackled in version 5.x. With that in mind I suggest we apply temporary changes proposed in this PR. After upgrading to `httpok` 5.x we will be able to remove these. ## Tests `mvn clean test` passed
2024-08-27 23:44:06 +08:00
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>enforce</id>
<configuration>
<rules>
<dependencyConvergence/>
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
</plugin>
2024-01-30 14:20:20 +08:00
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skipTests>${skipOllamaITs}</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</project>