-
Notifications
You must be signed in to change notification settings - Fork 23
[WIP] Proof of Concept integration with LangChain4j #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
base: main
Are you sure you want to change the base?
Conversation
This is awesome, created a contrib/ folder, we can put it there first then gradually iterate. |
@cornellgit Good idea, my contribution will make more sense in a contrib folder! 😉 |
Moved this code into the new contrib directory
@cornellgit Moved my WIP experiment in the new |
Accidently moved the model class in the test directory
contrib/pom.xml
Outdated
<packaging>jar</packaging> | ||
<name>Agent Development Kit - Contributions</name> | ||
<url>https://github.com/google/adk-java</url> | ||
<licenses> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing this here makes me think that we should have a root parent POM to define everything that's not specific to core or dev or contrib. I can propose a PR for that, if there is agreement that this would make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an expert in Maven, but I definitely agree we need to make the build a little more modular to avoid repeating things, and more clearly separating the different artifacts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #155! Let's wait for that to get reviewed & merged, and then take this from there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Indeed, we'll have to get it reviewed & merged.
It would be easier if we could work on the same PR.
Or maybe I can cherry pick the changes in your PR... hmm...
@@ -0,0 +1,324 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that we would want this to be contrib/langchain4j
, not just contrib/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely a good point.
I'll make that change now, but I'd be happy if you could look into the Maven parent pom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed the directory change
LlmAgent agent = LlmAgent.builder() | ||
.name("science-app") | ||
.description("Science teacher agent") | ||
.model(new LangChain4j(claudeModel, CLAUDE_3_7_SONNET_20250219)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.model(new LangChain4j(claudeModel, CLAUDE_3_7_SONNET_20250219)) | |
.model(new LangChain4j(claudeModel)) |
BaseAgent agent = LlmAgent.builder() | ||
.name("friendly-weather-app") | ||
.description("Friend agent that knows about the weather") | ||
.model(new LangChain4j(claudeModel, CLAUDE_3_7_SONNET_20250219)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.model(new LangChain4j(claudeModel, CLAUDE_3_7_SONNET_20250219)) | |
.model(new LangChain4j(claudeModel)) |
BaseAgent agent = LlmAgent.builder() | ||
.name("friendly-weather-app") | ||
.description("Friend agent that knows about the weather") | ||
.model(new LangChain4j(gptModel, "gpt-3.5-turbo")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.model(new LangChain4j(gptModel, "gpt-3.5-turbo")) | |
.model(new LangChain4j(gptModel)) |
@@ -63,6 +63,7 @@ | |||
<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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wouldn't go here... witht the contrib/langchain4j
"module" it (now) belongs in that POM, agreed?
Maybe it's easier to wait for #155, first; up to you.
@BeforeAll | ||
public static void setUp() { | ||
assertNotNull(System.getenv("ANTHROPIC_API_KEY")); | ||
assertNotNull(System.getenv("GOOGLE_API_KEY")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertNotNull(System.getenv("GOOGLE_API_KEY")); | |
assertNotNull(System.getenv("GOOGLE_API_KEY")); | |
assertNotNull(System.getenv("OPENAI_API_KEY")); |
public static final String GPT_4_O_MINI = "gpt-4o-mini"; | ||
|
||
@BeforeAll | ||
public static void setUp() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this to pass on CI, we'll need to put someone's x3 API keys as secrets into the configuration of this repo.
That's going to be fun to sort out... 🤣
[DON'T MERGE]
This is a proof of concept of an integration with LangChain4j, to show that it's possible to open up ADK to all the models supported by the LangChain4j framework.