Skip to content

Commit

Permalink
v1.1.0 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vladikoff committed Dec 8, 2023
1 parent 6830c34 commit 684d497
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.1.0 - December 7, 2023.

- Updated model options

# 1.0.1 - November 26, 2023.

- Open-source release
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ The endpoint option specifies the API endpoint to call. `playwright-ai` will bro

### --model (-m) :: `String`

_Default_: `gpt4`.
_Default_: `gpt-4`.

The LLM model to use to generate the tests.
Available options: `gpt3`, `gpt4`, `claude`.
Available options: `gpt-3`, `gpt-4`, `claude`.

### --tests (-t) :: `Number`

Expand All @@ -68,6 +68,11 @@ Shows CLI version.

See the [CHANGELOG.md](CHANGELOG.md).

## TODO

- Support for other models
- More complex test cases

## License

[MIT](LICENSE)
15 changes: 8 additions & 7 deletions lib/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,21 @@ async function initialPrompt() {
moreComponents: `This is great, let us proceed with an interactive test with several assertions for component that you have not generated a test for already. For example, components could be the navigation bar, the search bar, footer links, the login form. Include a short name of the component in a few words in the response wrapped in "$$" characters, use snake case format inside of test with a JavaScript comment. The HTML is the same as before for a website hosted at ${process.endpoint}:`,
};
let model = process.model;
if (model === "gpt3") {
if (model === "gpt-3") {
model = "gpt-3.5-turbo-0613";
}

api = new ChatGPTAPI({
apiKey: process.env["OPENAI_API_KEY"],
completionParams: {
model: model,
},
});
if (model === "claude") {
api = new Claude({
apiKey: process.env["ANTHROPIC_API_KEY"],
});
} else {
api = new ChatGPTAPI({
apiKey: process.env["OPENAI_API_KEY"],
completionParams: {
model: model || "gpt-4",
},
});
}

await askAi(PROMPTS.start, true);
Expand Down

0 comments on commit 684d497

Please sign in to comment.