fix: add missing hardcodings for popular OpenAI models (#1863)

This commit is contained in:
Charles Packer
2024-10-10 10:19:41 -07:00
committed by GitHub
parent 117134810c
commit fb8ba76e42
2 changed files with 27 additions and 0 deletions

View File

@@ -70,6 +70,12 @@ class OpenAIProvider(Provider):
configs.append(
LLMConfig(model=model_name, model_endpoint_type="openai", model_endpoint=self.base_url, context_window=context_window_size)
)
# for OpenAI, sort in reverse order
if self.base_url == "https://api.openai.com/v1":
# alphnumeric sort
configs.sort(key=lambda x: x.model, reverse=True)
return configs
def list_embedding_models(self) -> List[EmbeddingConfig]: