Skip to content

Commit

Permalink
Merge branch 'feat/apex-oas' into phale/W-17756721-annotation-params
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxuanzhangsfdx committed Feb 7, 2025
2 parents 0ce0b3a + 254305a commit bbb919b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class ApexActionController {

// Step 6: use the strategy to generate the OAS
const openApiDocument = await promptGenerationOrchestrator.generateOASWithStrategySelectedByBidRule(
BidRule.MOST_CALLS
BidRule.METHOD_BY_METHOD
);

// Step 7: Process the OAS document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import {

export enum BidRule {
LEAST_CALLS,
MOST_CALLS
MOST_CALLS,
METHOD_BY_METHOD
}

// An orchestrator that coordinates the generation of prompts for Apex classes.
Expand Down Expand Up @@ -70,6 +71,8 @@ export class PromptGenerationOrchestrator {
return this.getLeastCalls(bids);
case BidRule.MOST_CALLS:
return this.getMostCalls(bids);
case BidRule.METHOD_BY_METHOD:
return this.getMethodByMethod(bids);
}
}

Expand All @@ -85,7 +88,8 @@ export class PromptGenerationOrchestrator {
}
}
}
return bestStrategy ?? GenerationStrategy.METHOD_BY_METHOD;
// TODO: define which to pick when both strategies have same call counts
return GenerationStrategy.METHOD_BY_METHOD; // METHOD_BY_METHOD is the default strategy
}

getMostCalls(bids: Map<GenerationStrategy, PromptGenerationStrategyBid>): GenerationStrategy {
Expand All @@ -100,7 +104,11 @@ export class PromptGenerationOrchestrator {
}
}
}
return bestStrategy ?? GenerationStrategy.METHOD_BY_METHOD;
return GenerationStrategy.METHOD_BY_METHOD;
}

getMethodByMethod(bids: Map<GenerationStrategy, PromptGenerationStrategyBid>): GenerationStrategy {
return GenerationStrategy.METHOD_BY_METHOD;
}

private cleanupYaml(doc: string): string {
Expand Down

0 comments on commit bbb919b

Please sign in to comment.