-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/admin/model-create-and-edit-dropdown (#744)
* feat: provide available model options from api and populate usage field Signed-off-by: Ryan Hopper-Lowe <[email protected]> * chore: remove unused models code * enhance: prevent unnecessary cache revalidations for available models * chore: upgrade model provider api usage --------- Signed-off-by: Ryan Hopper-Lowe <[email protected]>
- Loading branch information
1 parent
1a7a2ea
commit 13e341a
Showing
8 changed files
with
121 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ModelUsage } from "~/lib/model/models"; | ||
import { EntityMeta } from "~/lib/model/primitives"; | ||
|
||
export type AvailableModel = EntityMeta<{ usage?: ModelUsage }> & { | ||
object: string; | ||
owned_by: string; | ||
permission: string[]; | ||
root: string; | ||
parent: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ModelProvider } from "~/lib/model/models"; | ||
import { ApiRoutes } from "~/lib/routers/apiRoutes"; | ||
import { request } from "~/lib/service/api/primitives"; | ||
|
||
async function getModelProviders() { | ||
const { data } = await request<{ items?: ModelProvider[] }>({ | ||
url: ApiRoutes.modelProviders.getModelProviders().url, | ||
}); | ||
|
||
return data.items ?? []; | ||
} | ||
getModelProviders.key = () => ({ | ||
url: ApiRoutes.modelProviders.getModelProviders().path, | ||
}); | ||
|
||
export const ModelProviderApiService = { getModelProviders }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters