mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-31 19:15:17 +02:00
configure per-service model defaults for signed-in users
When signed in, default assistant to gpt-5.4, knowledge graph agents to gpt-5.4-nano, inline task agent to gpt-5.4-mini, and meeting notes to gpt-5.4. Add meetingNotesModel config field. Fix summarize_meeting to use gateway provider when signed in. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1259939e28
commit
4b81cf37cf
4 changed files with 23 additions and 6 deletions
|
|
@ -850,13 +850,21 @@ export async function* streamAgent({
|
||||||
const tools = await buildTools(agent);
|
const tools = await buildTools(agent);
|
||||||
|
|
||||||
// set up provider + model
|
// set up provider + model
|
||||||
const provider = await isSignedIn()
|
const signedIn = await isSignedIn();
|
||||||
|
const provider = signedIn
|
||||||
? await getGatewayProvider()
|
? await getGatewayProvider()
|
||||||
: createProvider(modelConfig.provider);
|
: createProvider(modelConfig.provider);
|
||||||
const knowledgeGraphAgents = ["note_creation", "email-draft", "meeting-prep", "labeling_agent", "note_tagging_agent", "agent_notes_agent"];
|
const knowledgeGraphAgents = ["note_creation", "email-draft", "meeting-prep", "labeling_agent", "note_tagging_agent", "agent_notes_agent"];
|
||||||
const modelId = (knowledgeGraphAgents.includes(state.agentName!) && modelConfig.knowledgeGraphModel)
|
const isKgAgent = knowledgeGraphAgents.includes(state.agentName!);
|
||||||
|
const isInlineTaskAgent = state.agentName === "inline_task_agent";
|
||||||
|
const defaultModel = signedIn ? "gpt-5.4" : modelConfig.model;
|
||||||
|
const defaultKgModel = signedIn ? "gpt-5.4-nano" : defaultModel;
|
||||||
|
const defaultInlineTaskModel = signedIn ? "gpt-5.4-mini" : defaultModel;
|
||||||
|
const modelId = isInlineTaskAgent
|
||||||
|
? defaultInlineTaskModel
|
||||||
|
: (isKgAgent && modelConfig.knowledgeGraphModel)
|
||||||
? modelConfig.knowledgeGraphModel
|
? modelConfig.knowledgeGraphModel
|
||||||
: modelConfig.model;
|
: isKgAgent ? defaultKgModel : defaultModel;
|
||||||
const model = provider.languageModel(modelId);
|
const model = provider.languageModel(modelId);
|
||||||
logger.log(`using model: ${modelId}`);
|
logger.log(`using model: ${modelId}`);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import { generateText } from 'ai';
|
||||||
import container from '../di/container.js';
|
import container from '../di/container.js';
|
||||||
import type { IModelConfigRepo } from '../models/repo.js';
|
import type { IModelConfigRepo } from '../models/repo.js';
|
||||||
import { createProvider } from '../models/models.js';
|
import { createProvider } from '../models/models.js';
|
||||||
|
import { isSignedIn } from '../account/account.js';
|
||||||
|
import { getGatewayProvider } from '../models/gateway.js';
|
||||||
import { WorkDir } from '../config/config.js';
|
import { WorkDir } from '../config/config.js';
|
||||||
|
|
||||||
const CALENDAR_SYNC_DIR = path.join(WorkDir, 'calendar_sync');
|
const CALENDAR_SYNC_DIR = path.join(WorkDir, 'calendar_sync');
|
||||||
|
|
@ -137,8 +139,13 @@ function loadCalendarEventContext(calendarEventJson: string): string {
|
||||||
export async function summarizeMeeting(transcript: string, meetingStartTime?: string, calendarEventJson?: string): Promise<string> {
|
export async function summarizeMeeting(transcript: string, meetingStartTime?: string, calendarEventJson?: string): Promise<string> {
|
||||||
const repo = container.resolve<IModelConfigRepo>('modelConfigRepo');
|
const repo = container.resolve<IModelConfigRepo>('modelConfigRepo');
|
||||||
const config = await repo.getConfig();
|
const config = await repo.getConfig();
|
||||||
const provider = createProvider(config.provider);
|
const signedIn = await isSignedIn();
|
||||||
const model = provider.languageModel(config.model);
|
const provider = signedIn
|
||||||
|
? await getGatewayProvider()
|
||||||
|
: createProvider(config.provider);
|
||||||
|
const modelId = config.meetingNotesModel
|
||||||
|
|| (signedIn ? "gpt-5.4" : config.model);
|
||||||
|
const model = provider.languageModel(modelId);
|
||||||
|
|
||||||
// If a specific calendar event was linked, use it directly.
|
// If a specific calendar event was linked, use it directly.
|
||||||
// Otherwise fall back to scanning events within ±3 hours.
|
// Otherwise fall back to scanning events within ±3 hours.
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ export class FSModelConfigRepo implements IModelConfigRepo {
|
||||||
model: config.model,
|
model: config.model,
|
||||||
models: config.models,
|
models: config.models,
|
||||||
knowledgeGraphModel: config.knowledgeGraphModel,
|
knowledgeGraphModel: config.knowledgeGraphModel,
|
||||||
|
meetingNotesModel: config.meetingNotesModel,
|
||||||
};
|
};
|
||||||
|
|
||||||
const toWrite = { ...config, providers: existingProviders };
|
const toWrite = { ...config, providers: existingProviders };
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,5 @@ export const LlmModelConfig = z.object({
|
||||||
model: z.string(),
|
model: z.string(),
|
||||||
models: z.array(z.string()).optional(),
|
models: z.array(z.string()).optional(),
|
||||||
knowledgeGraphModel: z.string().optional(),
|
knowledgeGraphModel: z.string().optional(),
|
||||||
|
meetingNotesModel: z.string().optional(),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue