File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ dependencies = [
1717 " deprecated>=1.2.18" ,
1818 " google-adk>=1.10.0" , # For basic agent architecture
1919 " google-adk<=1.19.0" , # For basic agent architecture
20- " litellm>=1.79 .3" , # For model inference
20+ " litellm>=1.74 .3" , # For model inference
2121 " loguru>=0.7.3" , # For better logging
2222 " opentelemetry-exporter-otlp>=1.35.0" ,
2323 " opentelemetry-instrumentation-logging>=0.56b0" ,
@@ -72,6 +72,9 @@ dev = [
7272 " pytest-xdist>=3.8.0" ,
7373]
7474
75+ responses = [
76+ " litellm>=1.79.3"
77+ ]
7578
7679[dependency-groups ]
7780dev = [
Original file line number Diff line number Diff line change @@ -158,6 +158,30 @@ def model_post_init(self, __context: Any) -> None:
158158
159159 if not self .model :
160160 if self .enable_responses :
161+ min_version = "1.79.3"
162+ from packaging .version import InvalidVersion
163+ from packaging .version import parse as parse_version
164+ import pkg_resources
165+
166+ try :
167+ installed = parse_version (
168+ pkg_resources .get_distribution ("litellm" ).version
169+ )
170+ except pkg_resources .DistributionNotFound :
171+ raise ImportError (
172+ "litellm installation not detected, please install it first: pip install litellm>=1.79.3"
173+ ) from None
174+ except InvalidVersion as e :
175+ raise ValueError (
176+ f"Invalid format of litellm version number:{ e } "
177+ ) from None
178+ required = parse_version (min_version )
179+ if installed < required :
180+ raise ValueError (
181+ "You have used `enable_responses=True`. If you want to use the `responses_api`, please install the relevant support:"
182+ "\n pip install veadk-python[responses]"
183+ )
184+
161185 from veadk .models .ark_llm import ArkLlm
162186
163187 self .model = ArkLlm (
You can’t perform that action at this time.
0 commit comments