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

Enhance functions Documentation and Improve Error Messages #350

Merged
merged 5 commits into from
May 21, 2024

Conversation

Faisal-Alsrheed
Copy link
Contributor

@Faisal-Alsrheed Faisal-Alsrheed commented May 18, 2024

Description

  • While reviewing the API documentation for Google's Generative AI Python API, I noticed that several functions were missing docstrings, while others required improvements to enhance clarity and understanding.
  • While trying the API, I also noticed that there is room to enhance error feedback for better debugging and developer guidance.

Proposed Changes:

  1. Added Missing Docstrings:

    • Introduced docstrings for previously undocumented functions to enhance the completeness of API documentation.
  2. Enhanced Existing Docstrings:

    • Updated and detailed existing docstrings to improve clarity and the understanding of API functions.
  3. Improved Error Messages:

    • Refined error messages to be more descriptive, aiding in quicker debugging and resolution.

Changed files

  1. google/generativeai/answer.py - 13 changes (6 additions & 7 deletions)
  2. google/generativeai/client.py - 10 changes (7 additions & 3 deletions)
  3. google/generativeai/discuss.py - 34 changes (21 additions & 13 deletions)
  4. google/generativeai/embedding.py - 11 changes (6 additions & 5 deletions)
  5. google/generativeai/files.py - 5 changes (4 additions & 1 deletion)
  6. google/generativeai/generative_models.py - 48 changes (25 additions & 23 deletions)
  7. google/generativeai/models.py - 48 changes (29 additions & 19 deletions)
  8. google/generativeai/operations.py - 8 changes (6 additions & 2 deletions)
  9. google/generativeai/permission.py - 8 changes (3 additions & 5 deletions)
  10. google/generativeai/responder.py - 12 changes (6 additions & 6 deletions)
  11. google/generativeai/retriever.py - 16 changes (6 additions & 10 deletions)
  12. google/generativeai/text.py - 8 changes (6 additions & 2 deletions)
  13. google/generativeai/types/content_types.py - 85 changes (50 additions & 35 deletions)
  14. google/generativeai/types/file_types.py - 6 changes (5 additions & 1 deletion)
  15. google/generativeai/types/generation_types.py - 33 changes (14 additions & 19 deletions)
  16. google/generativeai/types/helper_types.py - 5 changes (4 additions & 1 deletion)
  17. google/generativeai/types/model_types.py - 18 changes (14 additions & 4 deletions)
  18. google/generativeai/types/permission_types.py - 9 changes (4 additions & 5 deletions)
  19. google/generativeai/types/retriever_types.py - 63 changes (38 additions & 25 deletions)
  20. google/generativeai/utils.py - 2 changes (2 additions & 0 deletions)
  21. tests/test_client.py - 2 changes (1 addition & 1 deletion)

Checklist

  • Code formatted with Black
  • All tests passing with pytest
  • Documentation successfully built with build_docs.py

@Faisal-Alsrheed Faisal-Alsrheed marked this pull request as ready for review May 18, 2024 12:17
@github-actions github-actions bot added status:awaiting review PR awaiting review from a maintainer component:python sdk Issue/PR related to Python SDK labels May 18, 2024
@Faisal-Alsrheed Faisal-Alsrheed changed the title Enhance Documentation: Add and Improve Docstrings in Google's Generative AI Python API Enhance Documentation and Improve Error Messages for Google's Generative AI Python API May 18, 2024
@Faisal-Alsrheed Faisal-Alsrheed changed the title Enhance Documentation and Improve Error Messages for Google's Generative AI Python API Enhance Documentation and Improve Error Messages May 18, 2024
@Faisal-Alsrheed Faisal-Alsrheed changed the title Enhance Documentation and Improve Error Messages Enhance functions Documentation and Improve Error Messages May 19, 2024
Copy link
Collaborator

@MarkDaoust MarkDaoust left a comment

Choose a reason for hiding this comment

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

Thanks again!

LGTM, one comment to resolve.

google/generativeai/types/content_types.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@MarkDaoust MarkDaoust left a comment

Choose a reason for hiding this comment

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

Thanks!

@MarkDaoust MarkDaoust merged commit f361642 into google-gemini:main May 21, 2024
7 checks passed
@github-actions github-actions bot removed the status:awaiting review PR awaiting review from a maintainer label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:python sdk Issue/PR related to Python SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants