Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions library/runner-cli/advanced_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ async function main(): Promise<void> {
"-a, --additionalContext <context>",
"A short description of the conversation to add context."
)
.option("-v, --vertexProject <project>", "The Vertex Project name.");
.option("-v, --vertexProject <project>", "The Vertex Project name.")
.option("-m, --modelName <model>", "The name of the model to use (defaults to gemini-2.5-pro-preview-06-05).");
program.parse(process.argv);
const options = program.opts();

Expand Down Expand Up @@ -187,7 +188,8 @@ async function main(): Promise<void> {
options.vertexProject,
comments,
undefined,
options.additionalContext
options.additionalContext,
options.modelName
);
writeFileSync(options.outputBasename + "-summary.json", JSON.stringify(summary, null, 2));
}
Expand Down
3 changes: 2 additions & 1 deletion library/runner-cli/categorization_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ async function main(): Promise<void> {
.option("-o, --outputFile <file>", "The output file name.")
.option("-i, --inputFile <file>", "The input file name.")
.option("-t, --topics <comma separated list>", "Optional list of top-level topics.")
.option("-m, --modelName <model>", "The name of the model to use (defaults to gemini-2.5-pro-preview-06-05).")
.option(
"-d, --topicDepth [number]",
"If set, will learn only topics (1), topics and subtopics (2), or topics, subtopics, and subsubtopics (3). The default is 2.",
Expand Down Expand Up @@ -80,7 +81,7 @@ async function main(): Promise<void> {

// Learn topics and categorize comments.
const sensemaker = new Sensemaker({
defaultModel: new VertexModel(options.vertexProject, "global"),
defaultModel: new VertexModel(options.vertexProject, "global", options.modelName),
});
const topics = options.topics ? getTopics(options.topics) : undefined;
const categorizedComments = await sensemaker.categorizeComments(
Expand Down
6 changes: 4 additions & 2 deletions library/runner-cli/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ async function main(): Promise<void> {
"-a, --additionalContext <context>",
"A short description of the conversation to add context."
)
.option("-v, --vertexProject <project>", "The Vertex Project name.");
.option("-v, --vertexProject <project>", "The Vertex Project name.")
.option("-m, --modelName <model>", "The name of the model to use (defaults to gemini-2.5-pro-preview-06-05).");
program.parse(process.argv);
const options = program.opts();

Expand All @@ -63,7 +64,8 @@ async function main(): Promise<void> {
options.vertexProject,
comments,
undefined,
options.additionalContext
options.additionalContext,
options.modelName
);

const markdownContent = summary.getText("MARKDOWN");
Expand Down
12 changes: 8 additions & 4 deletions library/runner-cli/runner_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,16 @@ export function writeSummaryToGroundedCSV(summary: Summary, outputFilePath: stri
* Identify topics and subtopics when input data has not already been categorized.
* @param project The Vertex GCloud project name
* @param comments The comments from which topics need to be identified
* @param modelName Optional name of the model to use (defaults to gemini-2.5-pro-preview-06-05)
* @returns Promise resolving to a Topic collection containing the newly discovered topics and subtopics for the given comments
*/
export async function getTopicsAndSubtopics(
project: string,
comments: Comment[]
comments: Comment[],
modelName?: string
): Promise<Topic[]> {
const sensemaker = new Sensemaker({
defaultModel: new VertexModel(project, "global"),
defaultModel: new VertexModel(project, "global", modelName),
});
return await sensemaker.learnTopics(comments, true);
}
Expand All @@ -144,16 +146,18 @@ export async function getTopicsAndSubtopics(
* @param comments The comments to summarize
* @param topics The input topics to categorize against
* @param additionalContext Additional context about the conversation to pass through
* @param modelName Optional name of the model to use (defaults to gemini-2.5-pro-preview-06-05)
* @returns Promise resolving to a Summary object containing the summary of the comments
*/
export async function getSummary(
project: string,
comments: Comment[],
topics?: Topic[],
additionalContext?: string
additionalContext?: string,
modelName?: string
): Promise<Summary> {
const sensemaker = new Sensemaker({
defaultModel: new VertexModel(project, "global"),
defaultModel: new VertexModel(project, "global", modelName),
});
// TODO: Make the summariation type an argument and add it as a flag in runner.ts. The data
// requirements (like requiring votes) would also need updated.
Expand Down
Loading