Skip to content

[Vertex AI] Add Citation.publicationDate#13893

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

Merged
merged 8 commits into from
Oct 15, 2024
Merged

Conversation

andrewheard
Copy link
Contributor

@andrewheardandrewheard commented Oct 15, 2024

Added publicationDate to Citation.

@andrewheardandrewheard marked this pull request as ready for review October 15, 2024 18:52
@andrewheard
Copy link
ContributorAuthor

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.

@andrewheardandrewheard merged commit 4ca1413 into mainOct 15, 2024
38 checks passed
@andrewheardandrewheard 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
@firebasefirebase locked and limited conversation to collaborators Nov 15, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
@andrewheard@ncooke3@paulb777
close