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:
Added Missing Docstrings:
Introduced docstrings for previously undocumented functions to enhance the completeness of API documentation.
Enhanced Existing Docstrings:
Updated and detailed existing docstrings to improve clarity and the understanding of API functions.
Improved Error Messages:
Refined error messages to be more descriptive, aiding in quicker debugging and resolution.
Description
Proposed Changes:
Added Missing Docstrings:
Enhanced Existing Docstrings:
Improved Error Messages:
Changed files
google/generativeai/answer.py
- 13 changes (6 additions & 7 deletions)google/generativeai/client.py
- 10 changes (7 additions & 3 deletions)google/generativeai/discuss.py
- 34 changes (21 additions & 13 deletions)google/generativeai/embedding.py
- 11 changes (6 additions & 5 deletions)google/generativeai/files.py
- 5 changes (4 additions & 1 deletion)google/generativeai/generative_models.py
- 48 changes (25 additions & 23 deletions)google/generativeai/models.py
- 48 changes (29 additions & 19 deletions)google/generativeai/operations.py
- 8 changes (6 additions & 2 deletions)google/generativeai/permission.py
- 8 changes (3 additions & 5 deletions)google/generativeai/responder.py
- 12 changes (6 additions & 6 deletions)google/generativeai/retriever.py
- 16 changes (6 additions & 10 deletions)google/generativeai/text.py
- 8 changes (6 additions & 2 deletions)google/generativeai/types/content_types.py
- 85 changes (50 additions & 35 deletions)google/generativeai/types/file_types.py
- 6 changes (5 additions & 1 deletion)google/generativeai/types/generation_types.py
- 33 changes (14 additions & 19 deletions)google/generativeai/types/helper_types.py
- 5 changes (4 additions & 1 deletion)google/generativeai/types/model_types.py
- 18 changes (14 additions & 4 deletions)google/generativeai/types/permission_types.py
- 9 changes (4 additions & 5 deletions)google/generativeai/types/retriever_types.py
- 63 changes (38 additions & 25 deletions)google/generativeai/utils.py
- 2 changes (2 additions & 0 deletions)tests/test_client.py
- 2 changes (1 addition & 1 deletion)Checklist
Black
pytest
build_docs.py