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

[BUG] Failures in Vertex AI Gemini calls due to unsupported @SystemMessage #757

Closed
ddobrin opened this issue Mar 14, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@ddobrin
Copy link

ddobrin commented Mar 14, 2024

@UserMessage is supported and can be used with VertexAiGeminiChatModel
@SystemMessage is not supported for Vertex.

Behaviour: call fails and indicates the reason for the failure as SystemMessage not being supported in Vertex.

Suggestion:
As all ChatMessage implementation will be send to the model via Vertex, suggest converting, transparent to the developer, the @SystemMessage to a @Usermessage.

Future:
Code will remain unchanged for a developer if Vertex adds support for @SystemMessage and Langchain4J updates the codebase.

  • LangChain4j version: 0.28.0
  • Java version: 21
  • Spring Boot version: 3.2.3
@ddobrin ddobrin added the bug Something isn't working label Mar 14, 2024
@langchain4j
Copy link
Owner

Hi @ddobrin, system and user messages are very different in nature. This exception is thrown to let the developer aware that system messages are not supported by this model, so he should avoid using them. I would avoid silently converting one to another.

@ddobrin
Copy link
Author

ddobrin commented Mar 15, 2024

Hello, thank you for the quick reply. The distinction between the 2 is understood, certainly.

The rationale for opening this issue comes down to the fact that developers would have to change their code when testing with different models, or when building tests using Testcontainers and testing different models, which could lead to a diminished UX

@langchain4j
Copy link
Owner

@ddobrin good point!

@langchain4j
Copy link
Owner

cc @glaforge I plan to fix this today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants