langchain4j/langchain4j-qianfan/pom.xml

111 lines
3.4 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-25 21:23:52 +08:00
<version>0.36.0-SNAPSHOT</version>
<relativePath>../langchain4j-parent/pom.xml</relativePath>
</parent>
<artifactId>langchain4j-qianfan</artifactId>
<name>LangChain4j :: Integration :: Qianfan</name>
<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>
<artifactId>converter-gson</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) -->
2024-03-10 16:08:01 +08:00
<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
2024-03-10 16:08:01 +08:00
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-sse</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.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</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>
New low-level API to specify tool parameters (#1668) ## Issue Closes #896 Fixes #1480 Fixes #1881 Fixes #1858 Fixes #1865 ## Context Schema for tool parameters in the low-level API (`ChatLanguageModel` + `ToolSpecification`) is currently specified using `ToolParameters` and `JsonSchemaProperty` classes. This API works fine for simple cases, but it does not work well for more complicated cases (e.g., when nested objects or collections or recursion is required). Moreover, [Structured Outputs](https://github.com/langchain4j/langchain4j/pull/1590) feature is using another API and a lot of logic between tools and structured outputs is duplicated and out of sync. ## Change `ToolParameters` and `JsonSchemaProperty` classes are now deprecated in favour of new `JsonSchemaElement` API (which is used for Structured Outputs as well). Most of the logic between this 2 features is now unified. `JsonSchemaElement` represents a schema for a JSON element. It can be of such types: - `JsonArraySchema` - `JsonBooleanSchema` - `JsonEnumSchema` - `JsonIntegerSchema` - `JsonNumberSchema` - `JsonObjectSchema` - `JsonReferenceSchema` - `JsonStringSchema` All model providers that support tools (see the list below) were updated to support the new API. Old API is still supported for backward compatibility, but will be removed in the future. `ToolSpecifications` helper class now generates `ToolSpecification`s using the new API only. Example of the new API: ```java ToolSpecification.builder() .name("weather") .description("Returns the current weather in the specified city") .parameters(JsonObjectSchema.builder() .addStringProperty("city", s -> s.description("The name of the city, e.g., Munich")) .addEnumProperty("units", TemperatureUnit.class) .required("city") // the required properties should be specified explicitly .build()) .build(); ``` `JsonObjectSchema` builder has some helper methods to make it easier to add properties (e.g., `addProperty`, `addStringProperty`, `addIntegerProperty`, etc.), but properties can also be specified using a map: ```java ToolSpecification.builder() .name("weather") .description("Returns the current weather in the specified city") .parameters(JsonObjectSchema.builder() .properties(Map.of( "city", JsonStringSchema.builder().description("The name of the city, e.g., Munich").build(), "units", JsonEnumSchema.builder().enumValues("CELSIUS", "FAHRENHEIT").build() )) .required("city") // the required properties should be specified explicitly .build()) .build(); ``` ### Providers that support new `JsonSchemaElement` for tools - [x] Amazon Bedrock - [X] Anthropic - [X] Azure OpenAI - [X] DashScope - [x] GitHub Models - [X] Google AI Gemini - [X] Google Vertex AI Gemini - [x] Jlama - [x] LocalAI - [X] Mistral AI - [X] Ollama - [X] OpenAI - [x] Qianfan - [x] Zhipu AI ### Tested Providers - [x] Amazon Bedrock - [x] Anthropic - [x] Azure OpenAI - [x] DashScope - [x] GitHub Models - [x] Google AI Gemini - [x] Google Vertex AI Gemini - [x] Jlama - [ ] LocalAI - [x] Mistral AI - [x] Ollama - [x] OpenAI - [x] Qianfan - [x] Zhipu AI ### Additional Changes Several bugs have been fixed along the way (see the list of Github issues on the top). ### Breaking changes - `ToolSpecification.parameters()` method has been renamed into `toolParameters()` ### Potentially breaking changes - `ToolSpecifications` helper class now generates `ToolSpecification`s with parameters defined using the new API (`JsonObjectSchema`) instead of the old API (`ToolParameters`). - If `@Tool` does not have a description (`value` annotation attribute), `ToolSpecifications` will return `ToolSpecification` with `description() == null` ## General checklist - [ ] There are no breaking changes (Most of the use cases should not break) - [x] 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. --> - [x] 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) - [ ] I have added/updated [Spring Boot starter(s)](https://github.com/langchain4j/langchain4j-spring) (if applicable)
2024-10-16 19:30:58 +08:00
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j</artifactId>
<classifier>tests</classifier>
<type>test-jar</type>
<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>
</dependencies>
<licenses>
<license>
<name>Apache-2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
</project>