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

[OPIK-628] Fix update LLM provider api key endpoint #901

Conversation

BorisTkachenko
Copy link
Contributor

Details

Fix update LLM provider api key endpoint

@BorisTkachenko BorisTkachenko self-assigned this Dec 17, 2024
@BorisTkachenko BorisTkachenko requested a review from a team as a code owner December 17, 2024 09:16
Copy link
Collaborator

@andrescrz andrescrz left a comment

Choose a reason for hiding this comment

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

Please be more explicit in the PR description about the issue you're trying to fix.

Without context, it's hard to know that this only fixes the toString implementation.


@Builder(toBuilder = true)
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
@Getter
Copy link
Collaborator

@andrescrz andrescrz Dec 17, 2024

Choose a reason for hiding this comment

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

I assume that you just want to fix the lack of proper toString implementation.

You could have maintained the previous approach just by changing @Getter annotation by @Data. The advantage is not requiring a custom toString implementation and just relying on @ToString.Exclude. The downside is having a mutable POJO.

You record approach has the reversed pros and cons.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andrescrz Unfortunately no:)
Endpoint was failing with {"code":400,"message":"Unable to process JSON"} on deserialization. What's worse, integration tests were ok for the same payload. But in dev or if you run Opik locally with docker-compose issue was reproducible. I tried to play with toString and encryption, but with no result.
The only thing that helped is when I changed regular Java class to record. I double checked locally and with dev deployment before merging.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, probably the issue is that there was no proper setter, so it couldn't be converted from Json to Java POJO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a weird error, Setter doesn't help here too.
And the most disturbing is that our integration tests are passing and can deserialize it properly. Also if you use JsonUtils, then deserialization works fine as well. Issue only happens with dockerised Opik.

Copy link
Contributor

@idoberko2 idoberko2 left a comment

Choose a reason for hiding this comment

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

LGTM

@BorisTkachenko BorisTkachenko merged commit c8ea285 into main Dec 17, 2024
11 checks passed
@BorisTkachenko BorisTkachenko deleted the boryst/OPIK-628-updating-a-provider-api-key-sends-400-error branch December 17, 2024 09:50
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.

3 participants