generative-ai-python
generative-ai-python copied to clipboard
Add support for per-request metadata/headers in GenerativeModel.gener…
re: #698
Description of the change
Modified the GenerativeModel.generate_content and GenerativeModel.generate_content_async method to accept an additional parameter extra_headers that would be passed to the underlying client method. This would allow users to set headers on a per-request basis while maintaining backward compatibility.
Added the required tests in test_generative_model.py and test_generative_model_async.py
Type of change
Feature request