Skip to content

Commit

Permalink
rename --prompt to --explicit-prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Grzegorz Tańczyk committed Jul 13, 2024
1 parent a5704db commit 3d3aa9f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion games/nukes/codegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ The codegen script accepts the following options:
- `--codegen-only`: Limit the scope of codegen to the codegen tool itself (the `codegen/` directory).
- `--game-only`: Limit the scope of codegen to the game itself (the `src/` directory).
- `--chat-gpt`: Use the OpenAI model for code generation instead of Vertex AI with Google's Gemini Pro model.
- `--prompt`: An explicit prompt to use for code generation.
- `--explicit-prompt`: An explicit prompt to use for code generation.
2 changes: 1 addition & 1 deletion games/nukes/codegen/cli-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export const allowFileDelete = params.includes('--allow-file-delete');
export const codegenOnly = params.includes('--codegen-only');
export const gameOnly = params.includes('--game-only');
export const chatGpt = params.includes('--chat-gpt');
export const prompt = params.find((param) => param.startsWith('--prompt'))?.split('=')[1];
export const explicitPrompt = params.find((param) => param.startsWith('--explicit-prompt'))?.split('=')[1];
4 changes: 2 additions & 2 deletions games/nukes/codegen/prompt-codegen.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert';
import { getSourceCode } from './read-files.js';
import { CODEGEN_TRIGGER } from './prompt-consts.js';
import { considerAllFiles, allowFileCreate, allowFileDelete, prompt } from './cli-params.js';
import { considerAllFiles, allowFileCreate, allowFileDelete, explicitPrompt } from './cli-params.js';

/** Get codegen prompt */
export function getCodeGenPrompt() {
Expand All @@ -16,7 +16,7 @@ export function getCodeGenPrompt() {
}

const codeGenPrompt =
(prompt ? prompt + '\n\n' : '') +
(explicitPrompt ? explicitPrompt + '\n\n' : '') +
`${
considerAllFiles
? codeGenFiles.length > 0
Expand Down
2 changes: 1 addition & 1 deletion games/nukes/codegen/validate-cli-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const allowedParameters = [
'--codegen-only',
'--game-only',
'--chat-gpt',
'--prompt='
'--explicit-prompt='
];

// Validate CLI parameters accordingly to those mentioned in README.md, fail the process if not valid, or unknown parameter is passed
Expand Down

0 comments on commit 3d3aa9f

Please sign in to comment.