0

I have a question about Quarkus Langchain4j.

I have made this Quarkus (Java 25) project with the purpose of exposing an API that receives a search text, processes it with an "extractor” AI service, then talks to an external GraphQL microservice (via a client) to obtain a list of objects, and returns it to the REST API user.

I couldn't get it to work, the calls are made to the AI (Mistral), but they always return an empty body and tools-calling says null, so I gather the tools are not being called. I also tried deleting the ExtractorAiService altogether, so as to have only one @Tool to begin with (you can check the commit history in v2_api branch.

What am I missing? It is my first experience with Quarkus Langchain4j and I've been with this a couple of days to be honest.

REST API - AI service (Quarkus-Langchain4j) https://github.com/wadajo/ai-tourism-madrid

GraphQL API (Quarkus) https://github.com/wadajo/turismo-madrid

6
  • Have you tried enabling logging (quarkus.langchain4j.log-requests=true and quarkus.langchain4j.log-responses=true) ? Commented Nov 24 at 9:33
  • Yes, thank you, they are enabled. I see the call to api.mistral.ai , and also that’s why I believe the tool is not being called, because the logged response says: - body: {"id":"0f615fb3c06a4d31884553a60e025c44","created":1763978578,"model":"open-mistral-7b","usage":{"prompt_tokens":308,"total_tokens":308,"completion_tokens":0},"object":"chat.completion","choices":[{"index":0,"finish_reason":"stop","message":{"role":"assistant","tool_calls":null,"content":""}}]} Commented Nov 24 at 10:04
  • Any chance you can try your example with some other model (like OpenAI)? Commented Nov 24 at 11:43
  • OK I will try that and I’ll update... Commented Nov 24 at 14:07
  • Well, apparently it works, at least it manages to call the remote GraphQL API correctly and the logs show the response. Bad thing is the API response is 500 Error; logs show that I have “insufficient quota” or I exceed some kind of limit. I didn’t know free tier would be so scarce. Anyways, what about Mistral? Commented Nov 24 at 20:16

1 Answer 1

0

Which @Tool annotation are you using? For internal AI agent services you need the one from

dev.langchain4j.agent.tool.Tool;
and not the one from io.quarkiverse.mcp.server

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, Heiko, I am using dev.langchain4j.agent.tool.Tool indeed. Full code is in the Github repo in the main question if you’d like to check it out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.