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

AiServiceRegisteredEvent #89

Merged

Conversation

catofdestruction
Copy link
Contributor

@catofdestruction catofdestruction commented Nov 26, 2024

Closes langchain4j/langchain4j#2112

Publish a AiServiceRegisteredEvent Spring Event after registering the AiService bean in AiServicesAutoConfig.
This event contains the AiService class and its corresponding tools description information.

Once a user implements the even listener to listen for this event, they can receive the event during the Spring Boot startup phase and handle their business logic as needed.

catofdestruction and others added 8 commits November 21, 2024 19:32
…icesAutoConfig.

This event contains the AiService class and its corresponding tools description information.

Once a user implements the AiServiceRegisteredEventListener to listen for this event, they can receive the event during the Spring Boot startup phase and handle their business logic as needed.

original PR link: langchain4j#77
Issues link: langchain4j/langchain4j#2112
…uction/langchain4j-spring into tools_enhanced_by_aop_support
@catofdestruction
Copy link
Contributor Author

Closes langchain4j/langchain4j#2112

Publish a Spring Event after registering the AiService Bean in AiServicesAutoConfig. This event contains the AiService class and its corresponding tools description information.

Once a user implements the AiServiceRegisteredEventListener to listen for this event, they can receive the event during the Spring Boot startup phase and handle their business logic as needed.

@langchain4j The unit tests are working fine locally, but I see that there are many errors in the CI.
If there are any issues that need my attention, feel free to let me know.

@langchain4j
Copy link
Owner

@catofdestruction thank you! I will try to look into this PR during the week

Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

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

@catofdestruction thank you!

@langchain4j langchain4j changed the title Tools enhanced by aop support & add AiServiceRegisteredEvent AiServiceRegisteredEvent Dec 20, 2024
@langchain4j
Copy link
Owner

@catofdestruction thanks a lot!

After a second thought, I think it will be safer to rollback to the ApplicationEventPublisherAware approach and wrap toolSpecifications.add(ToolSpecifications.toolSpecificationFrom(beanMethod)); line into a try-catch block, just in case (IDK, gut feeling...)

@langchain4j langchain4j merged commit a4280ba into langchain4j:main Dec 20, 2024
1 of 5 checks passed
langchain4j pushed a commit to langchain4j/langchain4j that referenced this pull request Dec 20, 2024
…2203)

PR: langchain4j/langchain4j-spring#89

## Issue
original PR link:
langchain4j/langchain4j-spring#77
Issues link: #2112

## Change
update spring-boot-integration.md for [add AiServiceRegisteredEvent]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Get all metadata of AiService & Tool when the Spring Boot starts
2 participants