From 31ab44430000ed1888d927203fc98cfddc0abe35 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Mon, 30 Sep 2024 20:45:51 +0800 Subject: [PATCH] fix: together ai models --- src/renderer/src/providers/OpenAIProvider.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/renderer/src/providers/OpenAIProvider.ts b/src/renderer/src/providers/OpenAIProvider.ts index 8bfd947c4..a17d44c05 100644 --- a/src/renderer/src/providers/OpenAIProvider.ts +++ b/src/renderer/src/providers/OpenAIProvider.ts @@ -283,6 +283,18 @@ export default class OpenAIProvider extends BaseProvider { .filter(isSupportedModel) } + if (this.provider.id === 'together') { + // @ts-ignore key is not typed + return response?.body + .map((model: any) => ({ + id: model.id, + description: model.display_name, + object: 'model', + owned_by: model.organization + })) + .filter(isSupportedModel) + } + const models = response?.data || [] return models.filter(isSupportedModel)