refactor: change model name extraction to use list comprehension (#4067)

Refactor model name extraction to use list comprehension for improved readability
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-10-08 10:05:37 -03:00 committed by GitHub
commit e84148ed6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,11 +28,7 @@ response = requests.get(url)
data = json.loads(response.text)
# Extract the model names into a Python list
litellm_model_names = []
for model, _ in data.items():
if model != "sample_spec":
# litellm_model_names.append(f"{details['litellm_provider']}/{model}")
litellm_model_names.append(model)
litellm_model_names = [model for model, _ in data.items() if model != "sample_spec"]
# To store the class names that extend ToolInterface