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

Auditing is clunky and needs to be revisited #1217

Closed
edeandrea opened this issue Jan 14, 2025 · 1 comment · Fixed by #1280
Closed

Auditing is clunky and needs to be revisited #1217

edeandrea opened this issue Jan 14, 2025 · 1 comment · Fixed by #1280

Comments

@edeandrea
Copy link
Collaborator

I was starting to implement some of the auditing features in Quarkus LC4j but quickly realized that it is very clunky.

The Audit class, which is intended to be extended, is the class that contains all of the event receiver methods (initialMessages, addRelevantDocument , addLLMToApplicationMessage, etc). This class is not a CDI bean. Instead, its created by the AuditService.

If I wanted to, say, store those audit events into a database (or publish them to a Kafka topic), I really can't because its not a CDI bean. I can't inject an Emitter or a panache repository.

Wouldn't it be better that the pojo which holds the event data be separate from the listener class which handles the events, that way the event handler could be ApplicationScoped and could receive generic events?

Design idea

I was thinking of using CDI events instead. We could create records for each of the various event types which would capture the necessary data for each kind of event. Then applications could register to observe whichever events they wanted.

@geoand / @cescoffier/ @jmartisk thoughts?

If we agree on the approach this is something I could take up, although it will be a bit before I could get to it. Probably not until February sometime.

@geoand
Copy link
Collaborator

geoand commented Jan 22, 2025

+1

edeandrea added a commit to edeandrea/quarkus-langchain4j that referenced this issue Feb 13, 2025
edeandrea added a commit to edeandrea/quarkus-langchain4j that referenced this issue Feb 13, 2025
edeandrea added a commit to edeandrea/quarkus-langchain4j that referenced this issue Feb 13, 2025
edeandrea added a commit to edeandrea/quarkus-langchain4j that referenced this issue Feb 13, 2025
edeandrea added a commit to edeandrea/quarkus-langchain4j that referenced this issue Feb 13, 2025
edeandrea added a commit to edeandrea/quarkus-langchain4j that referenced this issue Feb 13, 2025
Closes quarkiverse#1217

# Conflicts:
#	core/deployment/src/main/java/io/quarkiverse/langchain4j/deployment/AiServicesProcessor.java
edeandrea added a commit to edeandrea/quarkus-langchain4j that referenced this issue Feb 13, 2025
Closes quarkiverse#1217

# Conflicts:
#	core/deployment/src/main/java/io/quarkiverse/langchain4j/deployment/AiServicesProcessor.java
edeandrea added a commit to edeandrea/quarkus-langchain4j that referenced this issue Feb 13, 2025
Closes quarkiverse#1217

# Conflicts:
#	core/deployment/src/main/java/io/quarkiverse/langchain4j/deployment/AiServicesProcessor.java
edeandrea added a commit to edeandrea/quarkus-langchain4j that referenced this issue Feb 13, 2025
Closes quarkiverse#1217

# Conflicts:
#	core/deployment/src/main/java/io/quarkiverse/langchain4j/deployment/AiServicesProcessor.java
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 a pull request may close this issue.

2 participants