-
Notifications
You must be signed in to change notification settings - Fork 261
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
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/src/main/java/com/google/adk/models/langchain4j/LangChain4j.java
Outdated
Show resolved
Hide resolved
contrib/langchain4j/src/test/java/com/google/adk/models/langchain4j/LangChain4jTest.java
Outdated
Show resolved
Hide resolved
contrib/langchain4j/src/test/java/com/google/adk/models/langchain4j/LangChain4jTest.java
Outdated
Show resolved
Hide resolved
contrib/langchain4j/src/test/java/com/google/adk/models/langchain4j/LangChain4jTest.java
Outdated
Show resolved
Hide resolved
core/pom.xml
Outdated
| <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.
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.
@glaforge remove this?
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.
@glaforge sorry not remove, of course, but move from here (core) into the contrib/langchain/pom.xml would be "cleaner", no?
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.
Should it be in core if it's specific to that module?
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.
Given that the langchain4j.version is specific (only) to the contrib/langchain4j/pom.xml, IMHO this "belongs" there (but it's currently in core/pom.xml where IMHO it shouldn't be).
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.
Oh yes, you're right!
contrib/langchain4j/src/test/java/com/google/adk/models/langchain4j/LangChain4jTest.java
Outdated
Show resolved
Hide resolved
contrib/langchain4j/src/test/java/com/google/adk/models/langchain4j/LangChain4jTest.java
Outdated
Show resolved
Hide resolved
(Anthropic doesn't set it, but OpenAI seems to set it)
contrib/langchain4j/src/main/java/com/google/adk/models/langchain4j/LangChain4j.java
Show resolved
Hide resolved
contrib/langchain4j/src/test/java/com/google/adk/models/langchain4j/LangChain4jTest.java
Show resolved
Hide resolved
Add Ollama in test scope to test local models running with Ollama
contrib/langchain4j/src/main/java/com/google/adk/models/langchain4j/LangChain4j.java
Outdated
Show resolved
Hide resolved
Use `@EnabledIfEnvironmentVariable` to conditionally skip tests
Add unit test
…own class, externalized tool function to avoid reflection issues
|
Thanks for the heads up! Good news! |
|
Rebased with the parent |
| limitations under the License. | ||
| --> | ||
|
|
||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
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.
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.
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 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!
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.
@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.
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.
==> #206
vorburger
left a comment
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.
LGTM, as an initial version.
Suggest that we merge this as-is, and then incrementally improve as needed.
| limitations under the License. | ||
| --> | ||
|
|
||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
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.
@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.
Poggecci
left a comment
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.
Need to check in a change to our Copybara before this can get merged in
geragaelms-arch
left a comment
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.
Muy bueno
This is an experimental integration with LangChain4j, to show that it's possible to open up ADK to all the models supported by the LangChain4j framework, and also Ollama or Docker Model Runner exposed models via LangChain4j.