Skip to content
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

Support @Tool/@P annotations from Lanchain4J #63

Open
jkschneider opened this issue Jan 15, 2025 · 7 comments
Open

Support @Tool/@P annotations from Lanchain4J #63

jkschneider opened this issue Jan 15, 2025 · 7 comments

Comments

@jkschneider
Copy link

I think it could be nice if you supported the @Tool/@P annotations from Langchain4J in addition to @Tool/@ToolArg from Quarkus.

I had a codebase already that had many tools defined using the Langchain4J annotations and I could almost take those classes wholesale and plugin them into MCP server except for the annotation type changes.

Thanks!

@mkouba
Copy link
Contributor

mkouba commented Jan 16, 2025

I'm not quite sure it's a good idea. First of all, we don't want to introduce a dependency on langchain4J. But more importantly, those annotations have different semantics, i.e. the annotated methods have different requirements, execution model, etc.

@geoand WDYT?

@geoand
Copy link
Contributor

geoand commented Jan 16, 2025

What if those annotations were extracted from LangChain4j into some API jar? Then we could avoid coupling to anything implementation specific to LangChain4j.

@mkouba
Copy link
Contributor

mkouba commented Jan 16, 2025

What if those annotations were extracted from LangChain4j into some API jar? Then we could avoid coupling to anything implementation specific to LangChain4j.

Well, we could but I'm still not sure it would help significantly.

I could almost take those classes wholesale and plugin them into MCP server

The "almost" is important here. It could work for simple cases but I don't think you could just share the classes with an existing LangChain4j app.

Maybe we could write some annotation tranfromer like we do for Spring annotations for example?

BTW @P is a terrible name if you ask me ;-).

@geoand
Copy link
Contributor

geoand commented Jan 16, 2025

BTW @p is a terrible name if you ask me ;-).

I couldn't agree more.

@jkschneider
Copy link
Author

First of all, we don't want to introduce a dependency on langchain4J

Sorry, I may have miscommunicated the intent. I'm not suggesting introducing a required dependency on langchain4J, but if one is present, simply be able to pick up these tools. There is no difference in the annotations other than the names.

@geoand
Copy link
Contributor

geoand commented Jan 17, 2025

That is an interesting idea and given how Quarkus works, that should be easy to do.

@geoand
Copy link
Contributor

geoand commented Jan 17, 2025

WDYT @mkouba ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants