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

[FEATURE] UX: validate AI Service configuration before runtime #987

Open
langchain4j opened this issue Apr 19, 2024 · 0 comments
Open

[FEATURE] UX: validate AI Service configuration before runtime #987

langchain4j opened this issue Apr 19, 2024 · 0 comments
Labels
enhancement New feature or request P2 High priority

Comments

@langchain4j
Copy link
Owner

When AI Service method is wrongly configured (e.g. multiple parameters withtout any annotations), an exception will be thrown at runtime, right before this method is called:

dev.langchain4j.exception.IllegalConfigurationException: Parameter 'arg0' of method 'translate' should be annotated with @V or @UserMessage or @UserName or @MemoryId
	at dev.langchain4j.exception.IllegalConfigurationException.illegalConfiguration(IllegalConfigurationException.java:16)
	at dev.langchain4j.service.DefaultAiServices.validateParameters(DefaultAiServices.java:51)
	at dev.langchain4j.service.DefaultAiServices$1.invoke(DefaultAiServices.java:85)

Ideally this validation should be performed as early as possible, at the time of AI Service creation or even better, during compilation.

@langchain4j langchain4j added enhancement New feature or request P2 High priority labels Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2 High priority
Projects
None yet
Development

No branches or pull requests

1 participant