Skip to content

Commit

Permalink
Send Model ID Override to playbook gen/exp API
Browse files Browse the repository at this point in the history
  • Loading branch information
TamiTakamiya committed Sep 26, 2024
1 parent 2bceee6 commit 6f71fc9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/features/lightspeed/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ export class LightSpeedAPI {
console.error("Ansible Lightspeed instance is not initialized.");
return {} as ExplanationResponseParams;
}
// If a Model ID Override is specified, send it to Lightspeed with the request.
if (lightSpeedManager.settingsManager.settings.lightSpeedService.model) {
inputData.model =
lightSpeedManager.settingsManager.settings.lightSpeedService.model;
}

Check warning on line 303 in src/features/lightspeed/api.ts

View check run for this annotation

Codecov / codecov/patch

src/features/lightspeed/api.ts#L301-L303

Added lines #L301 - L303 were not covered by tests
try {
const customPrompt =
lightSpeedManager.settingsManager.settings.lightSpeedService
Expand Down Expand Up @@ -342,6 +347,11 @@ export class LightSpeedAPI {
return {} as GenerationResponseParams;
}
try {
// If a Model ID Override is specified, send it to Lightspeed with the request.
if (lightSpeedManager.settingsManager.settings.lightSpeedService.model) {
inputData.model =
lightSpeedManager.settingsManager.settings.lightSpeedService.model;
}

Check warning on line 354 in src/features/lightspeed/api.ts

View check run for this annotation

Codecov / codecov/patch

src/features/lightspeed/api.ts#L352-L354

Added lines #L352 - L354 were not covered by tests
const customPrompt =
lightSpeedManager.settingsManager.settings.lightSpeedService
.playbookGenerationCustomPrompt;
Expand Down
2 changes: 2 additions & 0 deletions src/interfaces/lightspeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export interface GenerationRequestParams {
generationId: string;
createOutline: boolean;
wizardId?: string;
model?: string;
}

export interface GenerationResponseParams {
Expand All @@ -159,6 +160,7 @@ export interface ExplanationRequestParams {
content: string;
customPrompt?: string;
explanationId: string;
model?: string;
}

export interface ExplanationResponseParams {
Expand Down

0 comments on commit 6f71fc9

Please sign in to comment.