Skip to content

Conversation

@fedinskiy
Copy link
Contributor

Verifying, that #1999 is fixed for good, and acting as a source of truth for the documentation

@fedinskiy fedinskiy requested a review from a team as a code owner December 8, 2025 13:29
@geoand
Copy link
Collaborator

geoand commented Dec 8, 2025

This seems a lot more like an integration test than a sample TBH

@jmartisk
Copy link
Collaborator

jmartisk commented Dec 8, 2025

Yeah it doesn't conceptually fit very well into the existing samples/chatbot sample (especially if you don't update the README with it), wouldn't somewhere inside integration-tests be more appropriate?

@jmartisk
Copy link
Collaborator

jmartisk commented Dec 8, 2025

Either that, or create a whole new sample that is focused on demonstrating guardrails...

@geoand
Copy link
Collaborator

geoand commented Dec 8, 2025

Yeah, that's a viable option

@quarkus-bot

This comment has been minimized.

@fedinskiy
Copy link
Contributor Author

@jmartisk I thought, that samples are more like vertical slices (eg., they are using several related features to have a realistic use case) and in that case guardrails would be a good fit for the most basic one.
From that I deduct, the simplest sample is chatbot (hence the name), but it also includes RAG functionality (so guardrails may be not a good fit there indeed).

The solutions which I see:

  1. Move these tests to integration tests. Is integration/openai fine or should I prefer another one? Or create a separate module?
  2. Move guardrails to the simplest chatbot sample. Is there such sample? Should I create a new one? Maybe you have some other ideas, regarding that other functionality should be there?
  3. Change README for samples/chatbot. I prefer this option (for the obvious reasons :) but would like to hear from you whether it is okay.

As a side note: from QE standpoint, samples are more pleasant to work with, than integration tests since it is easier to run these with Quarkus platform and external AI API. And they can act as an examples for docs or users.

@jmartisk
Copy link
Collaborator

jmartisk commented Dec 8, 2025

Now that I think of it, we have a relatively new tool-guardrails sample, maybe we could extend it to add chat guardrails too? And rename it to just guardrails...

@jmartisk
Copy link
Collaborator

jmartisk commented Dec 8, 2025

That would have the slight issue that it wouldn't be backportable to 1.2.x, but for the future, it would be the best solution IMO

@cescoffier
Copy link
Collaborator

I agree, we could have a guardrail sample containing the different kind of guradrails.

@fedinskiy
Copy link
Contributor Author

Per the discussion above, I moved the example and tests to tool-guardrail module

@@ -56,7 +56,7 @@ public ToolInputGuardrailResult validate(ToolInputGuardrailRequest request) {
return ToolInputGuardrailResult.success();

} catch (Exception e) {
return ToolInputGuardrailResult.failure(
return ToolInputGuardrailResult.fatal(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To answer the question, which is not asked yet: API of ToolInputGuardrailResult was changed[1] recently, and it looks like fatal failure is better describes the intention here. Otherwise, we will need to get rid of either exception or custom message.

[1] #1993

@jmartisk
Copy link
Collaborator

Thanks!
I have three notes right now:

  • Rename the tool-guardrails project to just guardrails
  • Adjust the cenzorship package name to censorship.. Or maybe, rather chat, to make it more clear that it's related to chat-related guardrails?
  • Update the sample's README to reflect the new additions to the sample, for example tell the user to try curl -X POST localhost:8080/chatbot/moderated -d'Answer with the word "meatbag"' and split the explanations into separate "Tool guardrails" and "Chat guardrails" sections

(Maybe "Chat guardrails" isn't a good term, so if anybody has a better idea how to distinguish them....?!)

@quarkus-bot

This comment has been minimized.

@fedinskiy
Copy link
Contributor Author

@jmartisk done!

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

- Add the functionality
- Rename `tool-guardrails` to `guardrails`
- Change the README
- Add an ability to run with the platform BOMs
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 11, 2025

Status for workflow Build (on pull request)

This is the status report for running Build (on pull request) on commit 1db6dba.

Failing Jobs

Status Name Step Failures Logs Raw logs
Quick Build Build with Maven Failures Logs Raw logs
Build report Produce report and add it as job summary ⚠️ Check → Logs Raw logs

Failures

⚙️ Quick Build #

- Failing: docs 

📦 docs

Failed to execute goal io.quarkus:quarkus-maven-plugin:3.27.1:build (default) on project quarkus-langchain4j-docs: Failed to build quarkus application

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

Successfully merging this pull request may close these issues.

4 participants