- Add optional client_session, transport, and connector parameters to constructor
- Implement session ownership tracking to prevent closing user-provided sessions
- Add comprehensive session resolution hierarchy (dynamic > instance > create new)
- Include transport control for advanced HTTP stack management
- Add 29 comprehensive tests covering all injection scenarios
- Maintain backward compatibility with existing code
This enhancement allows users to inject their own configured aiohttp sessions,
transports, and connectors for fine-grained control over connection pooling,
SSL settings, proxy configurations, and other HTTP stack parameters.
When a Gemini model supports system messages, messages with the
system role get filtered out from the list of messages, so never
appended to the content (and passed as system_instructions instead).
This causes a 400 error, as both generateContent and streamGenerateContent
require contents (the systemInstruction object is optional).
This is a quick fix that does not check whether there was a system msg
or if the model supports it. It simply makes sure that if the list
of messages passed to _gemini_convert_messages_with_history()
yields no contents, that there is at least a single (empty space)
user message set to prevent the call from failing.
The potential side effect of this is that we will not fail
a call lacking any message at all, but if that needs to be checked
(and AFAIU the OpenAI spec messages are required) it should be done
elsewhere (e.g. validate_and_fix_openai_messages() @ litellm/utils.py).
PS: Applied `make format` (`poetry run black [file changed]`) only to
files changed by me. The `make lint` command identified a bunch of
files requiring formatting that I am not modifying as I did not touch
them.
- Change exception logging to debug level during shutdown cancellation
- Add clear_queue() call to process remaining coroutines during shutdown
- Prevents 'RuntimeWarning: coroutine was never awaited' messages
- Add comprehensive tests for graceful shutdown behavior
Fixes#13970
- Implemented VolcEngineEmbeddingHandler for synchronous and asynchronous embedding requests.
- Created VolcEngineEmbeddingConfig for transforming requests and responses to/from Volcengine format.
- Added integration tests for embedding functionality, covering various scenarios including error handling and parameter validation.
- Established test structure for Volcengine embedding, ensuring compliance with LiteLLM testing patterns.
- Included comprehensive tests for parameter mapping, request transformation, and response handling.