generative-ai-python icon indicating copy to clipboard operation
generative-ai-python copied to clipboard

Add support for per-request metadata/headers in GenerativeModel.gener…

Open aaakash06 opened this issue 10 months ago • 0 comments

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

aaakash06 avatar Mar 08 '25 16:03 aaakash06