Mayuresh Agashe

Results 14 comments of Mayuresh Agashe

```python model = genai.GenerativeModel(model_name, system_instruction="Talk in rhymes") model.count_tokens("") ``` I think this would still raise the following : https://github.com/google-gemini/generative-ai-python/blob/efead6bea6768f6f4a3d90d348647b0a54fe2435/google/generativeai/types/content_types.py#L267-L269

> It goes through to_contentS first, that catches None I don't think it will(tested it locally): `""` is not None. It will go to `to_content` method and would raise the...

> Wait I need to look at that TODO before merging this. The one in the permission_types? I should submit it in a separate PR. @Faisal-Alsrheed thank you for the...

yeah...protos mark `contents` as optional when passed individually, but is a required field when passing with the entire `GenerateContentRequest`. Current implementation converts passed params to `GenerateContentRequest` regardless. A possible fix...