Skip to content

Commit

Permalink
feat: expose models directory in the api
Browse files Browse the repository at this point in the history
  • Loading branch information
axel7083 committed Jan 30, 2024
1 parent 6527e08 commit a579f93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/backend/src/managers/modelsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ export class ModelsManager {
});
}

getModelsDirectory(): string {
return this.#modelsDir;
}

getLocalModelsFromDisk(): void {
if (!fs.existsSync(this.#modelsDir)) {
return;
Expand Down
4 changes: 4 additions & 0 deletions packages/backend/src/studio-api-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,8 @@ export class StudioApiImpl implements StudioAPI {
async deleteLocalModel(modelId: string): Promise<void> {
await this.modelsManager.deleteLocalModel(modelId);
}

async getModelsDirectory(): Promise<string> {
return this.modelsManager.getModelsDirectory();
}
}
2 changes: 2 additions & 0 deletions packages/shared/src/StudioAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ export abstract class StudioAPI {
abstract askPlayground(modelId: string, prompt: string): Promise<number>;
abstract getPlaygroundQueriesState(): Promise<QueryState[]>;
abstract getPlaygroundsState(): Promise<PlaygroundState[]>;

abstract getModelsDirectory(): Promise<string>;
}

0 comments on commit a579f93

Please sign in to comment.