Expose imageModel to system prompt

This commit is contained in:
Alex Gleason committed 2025-12-09 00:33:54 -06:00
1 parent d8bf0d0432
commit 62b1a19f2d
2 files changed
+11 -3

No files matched your search

+6 -2
View File
@@ -63,7 +63,7 @@ export class SessionManager {
private listeners: Partial<Record<keyof SessionManagerEvents, Set<(...args: unknown[]) => void>>> = {};
private fs: JSRuntimeFS;
private nostr: NPool;
private getSettings: () => { providers: AIProvider[] };
private getSettings: () => { providers: AIProvider[]; imageModel?: string };
private getConfig: () => AppConfig;
private getDefaultConfig: () => AppConfig;
private getProviderModels?: () => Array<{ id: string; provider: string; contextLength?: number; pricing?: { prompt: import('decimal.js').Decimal; completion: import('decimal.js').Decimal } }>;
@@ -72,7 +72,7 @@ export class SessionManager {
constructor(
fs: JSRuntimeFS,
nostr: NPool,
getSettings: () => { providers: AIProvider[] },
getSettings: () => { providers: AIProvider[]; imageModel?: string },
getConfig: () => AppConfig,
getDefaultConfig: () => AppConfig,
getProviderModels?: () => Array<{ id: string; provider: string; contextLength?: number; pricing?: { prompt: import('decimal.js').Decimal; completion: import('decimal.js').Decimal } }>,
@@ -289,6 +289,9 @@ export class SessionManager {
baseURL: provider.baseURL,
};
// Get imageModel from settings
const settings = this.getSettings();
const systemPrompt = await makeSystemPrompt({
cwd: `${config.fsPathProjects}/${projectId}`,
fs: this.fs,
@@ -303,6 +306,7 @@ export class SessionManager {
projectTemplate,
model: modelInfo,
provider: providerInfo,
imageModel: settings.imageModel,
});
// Helper function to filter out unsupported image formats (keep only JPG/JPEG/PNG)