- Keep **kwargs approach (no exec()) for security
- Integrate path traversal validation from main branch
- Add URL encoding for path parameters
- Merge both test suites (edge cases + security tests)
- All 14 tests passing
- Move BaseBatchesConfig, BaseContainerConfig, BaseEmbeddingConfig, BaseImageEditConfig, BaseImageGenerationConfig, BaseImageVariationConfig, BasePassthroughConfig, BaseRealtimeConfig, BaseRerankConfig, BaseVectorStoreConfig, BaseVectorStoreFilesConfig, BaseVideoConfig to lazy loading
- Move ANTHROPIC_API_ONLY_HEADERS, AnthropicThinkingParam, RerankResponse to lazy loading
- Move ChatCompletionDeltaToolCallChunk, ChatCompletionToolCallChunk, ChatCompletionToolCallFunctionChunk, LiteLLM_Params to lazy loading
- Add type stubs to TYPE_CHECKING block for mypy support
- Add lazy loading handlers in __getattr__ method
- These imports are not used in utils.py runtime code, only in type annotations (safe with from __future__ import annotations)
* refactor(utils): lazy load 15 additional imports to improve import time
- Move Rules, AsyncHTTPHandler, HTTPHandler to lazy loading via __getattr__
- Move get_num_retries_from_retry_policy, reset_retry_policy to lazy loading
- Move get_secret to lazy loading
- Move cached_imports functions (get_coroutine_checker, get_litellm_logging_class, get_set_callbacks) to lazy loading
- Move core_helpers functions (get_litellm_metadata_from_kwargs, map_finish_reason, process_response_headers) to lazy loading
- Move dot_notation_indexing functions (delete_nested_value, is_nested_path) to lazy loading
- Move get_litellm_params functions to lazy loading
- Move _ensure_extra_body_is_safe, get_formatted_prompt, get_response_headers, update_response_metadata to lazy loading
- Move executor to lazy loading
- Move BaseAnthropicMessagesConfig, BaseAudioTranscriptionConfig to lazy loading
- Add type stubs in TYPE_CHECKING block for mypy type checking
- These functions/classes are exported for other modules but not used internally in utils.py, so lazy loading is safe and improves startup performance
* fix(utils): use getattr for Rules and get_coroutine_checker in client decorator
- Update Rules() instantiation in client decorator to use getattr for lazy loading
- Update Rules.has_pre_call_rules() usage in function_setup to use getattr
- Update get_coroutine_checker() usage in client decorator to use getattr
- Fixes NameError: name 'Rules' is not defined error that occurs when Rules is lazy-loaded
* fix(utils): use getattr for get_litellm_logging_class in function_setup
- Update get_litellm_logging_class() usage in function_setup to use getattr for lazy loading
- Fixes NameError: name 'get_litellm_logging_class' is not defined error that occurs when get_litellm_logging_class is lazy-loaded
* fix(utils): use getattr for get_set_callbacks in function_setup
- Update get_set_callbacks() usage in function_setup to use getattr for lazy loading
- Fixes NameError: name 'get_set_callbacks' is not defined error that occurs when get_set_callbacks is lazy-loaded
* fix(utils): use getattr for all lazy-loaded imports in utils.py
- Update update_response_metadata (4 occurrences) to use getattr
- Update executor.submit (1 occurrence) to use getattr
- Update get_num_retries_from_retry_policy (2 occurrences) to use getattr
- Update reset_retry_policy (2 occurrences) to use getattr
- Update is_nested_path and delete_nested_value (1 occurrence each) to use getattr
- Update _ensure_extra_body_is_safe (1 occurrence) to use getattr
Fixes NameError errors that occur when these functions/classes are lazy-loaded but used directly in utils.py
* fix(utils): use getattr for _get_base_model_from_litellm_call_metadata in _get_base_model_from_metadata
- Update _get_base_model_from_litellm_call_metadata usage to use getattr for lazy loading
- Fixes NameError: name '_get_base_model_from_litellm_call_metadata' is not defined
* fix(utils): use getattr for second _get_base_model_from_litellm_call_metadata usage
- Fix the second occurrence of _get_base_model_from_litellm_call_metadata on line 7052
- Both occurrences in _get_base_model_from_metadata now use getattr for lazy loading
* fix(utils): fix indentation in _get_base_model_from_metadata function
* fix(utils): use getattr for get_litellm_metadata_from_kwargs in _get_litellm_params
- Update get_litellm_metadata_from_kwargs usage to use getattr for lazy loading
- Fixes NameError: name 'get_litellm_metadata_from_kwargs' is not defined
* fix(utils): fix syntax error in get_litellm_metadata_from_kwargs fix
- Move getattr call before cast statement to fix syntax error