- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.7k
chore(ai): Add unit tests for Live API #15411
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
Conversation
| Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either  
 Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a  Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. | 
        
          
                FirebaseAI/Tests/Unit/Types/Live/BidiGenerateContentServerMessageTests.swift
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …ageTests.swift Co-authored-by: Andrew Heard <[email protected]>
Co-authored-by: Andrew Heard <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds valuable unit tests for the Live API's encoding and decoding logic, focusing on VoiceConfig and BidiGenerateContentServerMessage. The tests are well-structured and cover the primary use cases effectively. I've added one minor suggestion to enhance the test coverage for BidiGenerateContentServerMessage by testing a minimal payload to ensure optional fields are handled correctly. Overall, this is a solid contribution to the project's test suite.
This PR adds unit tests for the Live API decoding/encoding. Since a lot of the API surface is covered by implicit
Encodable(or alternatives) markers, this PR only really addresses the structs that have custom decoding or encoding logic.Namely, this means
VoiceConfigandBidiGenerateContentServerMessageboth have had unit tests added. This basically just ensures they encode/decode correctly.#no-changelog