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

[Vertex AI] Add Citation.publicationDate #13893

Merged
merged 8 commits into from
Oct 15, 2024
Merged

[Vertex AI] Add Citation.publicationDate #13893

merged 8 commits into from
Oct 15, 2024

Conversation

andrewheard
Copy link
Contributor

@andrewheard andrewheard commented Oct 15, 2024

Added publicationDate to Citation.

@andrewheard andrewheard marked this pull request as ready for review October 15, 2024 18:52
@andrewheard andrewheard requested a review from paulb777 October 15, 2024 18:52
@andrewheard
Copy link
Contributor Author

I updated the public API to use DateComponents instead of Date. Devs can call publicationDate?.date to get a Date but also have the ability to inspect individual properties like day for nil if they want to adjust how to format dates in UIs, etc.

@andrewheard andrewheard merged commit 4ca1413 into main Oct 15, 2024
38 checks passed
@andrewheard andrewheard deleted the ah/vertex-pub-date branch October 15, 2024 22:45
@ncooke3
Copy link
Member

ncooke3 commented Oct 15, 2024

@paulb777 Note: Android is defaulting values to 1 if not specified (https://github.com/firebase/firebase-android-sdk/blob/2dd9beb5525a5bcadb436ab118cda11945d4a5d5/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/internal/util/conversions.kt#L256-L265) prior to converting to their platform type for dates (Calendar) rather than throwing.

JS isn't doing any conversions: https://github.com/firebase/firebase-js-sdk/blob/9c645aa3589ab234b6b4055bb31a96511cdd5812/packages/vertexai/src/types/responses.ts#L179-L187

Note that excluding a field in a DateComponents instance will default to 1. Matching the behavior in Android.

Screenshot 2024-10-15 at 6 46 55 PM
MojtabaHs pushed a commit to MojtabaHs/firebase-ios-sdk that referenced this pull request Oct 17, 2024
@firebase firebase locked and limited conversation to collaborators Nov 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants