Skip to content

Integration with LangChain4j to support third-party and local models #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ea9223c
[WIP] Proof of Concept integration with LangChain4j
glaforge May 23, 2025
7381f1e
Merge branch 'google:main' into main
glaforge May 24, 2025
7cd6dc0
Merge branch 'google:main' into main
glaforge May 25, 2025
d705754
[WIP] Proof of Concept integration with LangChain4j
glaforge May 26, 2025
0f265a5
[WIP] Proof of Concept integration with LangChain4j
glaforge May 26, 2025
2b5707e
[WIP] Cover other types of tools
glaforge May 31, 2025
ca16869
[WIP] Move the LangChain4j integration in its own subdirectory.
glaforge May 31, 2025
b0ab694
Merge branch 'google:main' into main
glaforge May 31, 2025
de547a0
[WIP] Further hyperparameter handling and function calling mode
glaforge May 31, 2025
390102f
[WIP] Not all LangChain4j models set their model name as default values
glaforge Jun 2, 2025
6dbe175
[WIP] Adding a test case for sub-agents
glaforge Jun 2, 2025
4a444d9
Merge branch 'google:main' into main
glaforge Jun 2, 2025
b1b3250
[WIP] Streaming model support
glaforge Jun 2, 2025
0bde593
Merge branch 'google:main' into main
glaforge Jun 4, 2025
6b100c7
[WIP] Making function calling work in streaming mode
glaforge Jun 4, 2025
adfba35
Merge branch 'google:main' into main
glaforge Jun 6, 2025
47e8795
[WIP] Add ASL header in test class
glaforge Jun 6, 2025
defb4de
[WIP] Add LangChain4j's @Experimental annotation
glaforge Jun 6, 2025
ab7ecf4
Cleanup pom
kpavlov Jun 9, 2025
7986107
Add unit test
kpavlov Jun 9, 2025
29f8bd0
Run integration test conditionally
kpavlov Jun 9, 2025
cc885a0
Merge pull request #1 from kpavlov/main
glaforge Jun 10, 2025
6eb39a8
Merge branch 'google:main' into main
glaforge Jun 11, 2025
9673f20
Merge branch 'google:main' into main
glaforge Jun 15, 2025
6010793
[WIP] Improve support for multiple modalities, moved run loop in its …
glaforge Jun 15, 2025
1409047
Merge branch 'google:main' into main
glaforge Jun 18, 2025
7ac470c
[WIP] Depend on parent pom.xml
glaforge Jun 18, 2025
069ea36
[WIP] Don't use the demo key for OpenAI
glaforge Jun 18, 2025
85f52ef
[WIP] Use ${project.version} in pom.xml
glaforge Jun 18, 2025
6aeb27e
[WIP] Removing langchain4j mention from core
glaforge Jun 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
384 changes: 384 additions & 0 deletions contrib/langchain4j/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,384 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2025 Google LLC

Licensed 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.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With #155, you could remove a lot more here... if you like - note how both the core/pom.xml and the dev/pom.xml are [much] shorter, now. But it's not very important, if you prefer leaving this as-is, we (me) could also just do this in a later follow-up PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with the simplest thing, but I was wondering what should be moved back to the parent, etc.
If you have a concrete suggestion, I'm happy to apply it!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glaforge in the interest of not holding this up any further, let's leave it as-is for now, and see if maintainers agree to merge as-is. I'll follow up with a "POM clean up" sort of PR later, once this is merged.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

==> #206

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>com.google.adk</groupId>
<artifactId>google-adk-parent</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:google-adk:current} -->
</parent>

<artifactId>google-adk-contrib-langchain4j</artifactId>
<packaging>jar</packaging>

<name>Agent Development Kit - Contributions - LangChain4j</name>
<url>https://github.com/google/adk-java</url>
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>
<scm>
<connection>scm:git:[email protected]/google:adk-java.git</connection>
<developerConnection>
scm:git:[email protected]/google:adk-java.git
</developerConnection>
<url>[email protected]/google:adk-java.git</url>
</scm>
<developers>
<developer>
<organization>Google Inc.</organization>
<organizationUrl>http://www.google.com</organizationUrl>
</developer>
</developers>
<description>
Third-party contributions, integrations, and plugins for Agent Development Kit.
</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<maven.compiler.release>${java.version}</maven.compiler.release>
<mcp-schema.version>0.10.0</mcp-schema.version>
<errorprone.version>2.38.0</errorprone.version>
<google.auth.version>1.33.1</google.auth.version>
<google.cloud.storage.version>2.28.0</google.cloud.storage.version>
<google.genai.version>1.0.0</google.genai.version>
<auto-value.version>1.11.0</auto-value.version>
<protobuf.version>4.31.0-RC1</protobuf.version>
<junit.version>5.11.4</junit.version>
<mockito.version>5.17.0</mockito.version>
<java-websocket.version>1.6.0</java-websocket.version>
<jackson.version>2.19.0</jackson.version>
<okhttp.version>4.12.0</okhttp.version>
<langchain4j.version>1.0.1</langchain4j.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-bom</artifactId>
<version>${langchain4j.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Main dependencies -->
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.adk</groupId>
<artifactId>google-adk</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.adk</groupId>
<artifactId>google-adk-dev</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.genai</groupId>
<artifactId>google-genai</artifactId>
<version>${google.genai.version}</version>
</dependency>
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>${mcp-schema.version}</version>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-anthropic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-open-ai</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-google-ai-gemini</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-ollama</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>1.4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.27.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://google.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<name>Central Repository OSSRH for snapshots</name>
<url>https://google.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<extensions>
<extension>
<groupId>com.google.cloud.artifactregistry</groupId>
<artifactId>artifactregistry-maven-wagon</artifactId>
<version>2.2.0</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<release>${maven.compiler.release}</release>
<parameters>true</parameters>
<annotationProcessorPaths>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${auto-value.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.3</version>
<dependencies>
<dependency>
<groupId>me.fabriciorby</groupId>
<artifactId>maven-surefire-junit5-tree-reporter</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>
<configuration>
<reportFormat>plain</reportFormat>
<statelessTestsetInfoReporter
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter"/>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<configuration>
<doclint>all,-missing</doclint>
<nohelp>true</nohelp>
<outputDirectory>${project.build.directory}/javadoc</outputDirectory>
<doctitle>Agent Development Kit</doctitle>
<source>${maven.compiler.release}</source>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<excludes>
<exclude>*MockitoMock*</exclude>
<exclude>*$$EnhancerByMockitoWithCGLIB$$*</exclude>
<exclude>*$$FastClassByMockitoWithCGLIB$$*</exclude>
<exclude>com/sun/tools/attach/*</exclude>
<exclude>sun/util/resources/cldr/provider/*</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>
<format>HTML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading