Skip to content

Commit

Permalink
docs: update docs (#105)
Browse files Browse the repository at this point in the history
* Update CONTRIBUTING.md

* Update quick-start.mdx

* Update prompting-tips.md

* Update API.md
  • Loading branch information
FarukhS52 authored Oct 11, 2024
1 parent c9a38b0 commit 18b5e92
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Midscene Contribution Guide

Thanks for that you are interested in contributing to Midscene. Before starting your contribution, please take a moment to read the following guidelines.
Thanks for showing interest in contributing to Midscene. Before starting your contribution, please take a moment to read the following guidelines.

---

Expand Down Expand Up @@ -58,7 +58,7 @@ What this will do:

Please make sure you have your email set up in `<https://github.com/settings/emails>`. This will be needed later when you want to submit a pull request.

Check that your git client is already configured the email:
Check that your git client is already configured with the email:

```sh
git config --list | grep email
Expand Down Expand Up @@ -132,7 +132,7 @@ pnpm run test
pnpm run test:all
```

You can also run the unit tests of single package:
You can also run the unit tests of a single package:

```sh
npx nx test @midscene/web
Expand Down
6 changes: 3 additions & 3 deletions apps/site/docs/en/docs/getting-started/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Remember to prepare an API key that is eligible for accessing OpenAI's GPT-4o be
Config the OpenAI API key, or [customize model vendor](../usage/model-vendor.html)

```bash
# replace by your own
# replace with your own
export OPENAI_API_KEY="sk-abcdefghijklmnopqrstuvwxyz"
```

Expand Down Expand Up @@ -192,7 +192,7 @@ npx ts-node demo.ts
# it should print
# [
# {
# itemTitle: 'JBL Tour Pro 2 - True wireless Noise Cancelling earbuds with Smart Charging Case',
# itemTitle: 'JBL Tour Pro 2 - True Wireless Noise Cancelling earbuds with Smart Charging Case',
# price: 551.21
# },
# {
Expand All @@ -212,4 +212,4 @@ Alternatively, you can import the `./midscene_run/report/latest.web-dump.json` f

Click the 'Load Demo' button in the [Visualization Tool](/visualization/), you will be able to see the results of the previous code as well as some other samples.

![](/view-demo-visualization.gif)
![](/view-demo-visualization.gif)
4 changes: 2 additions & 2 deletions apps/site/docs/en/docs/more/prompting-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The natural language parameter passed to Midscene will be part of the prompt sen

Since AI has the nature of heuristic, the purpose of prompt tuning should be to obtain stable responses from the AI model across runs. In most cases, to expect a consistent response from LLM by using a good prompt is entirely feasible.

### Detailed description and samples are welcome
### Detailed descriptions and samples are welcome

Detailed descriptions and examples are always welcome.

Expand Down Expand Up @@ -36,7 +36,7 @@ Use the visualization tool to debug and understand each step of Midscene. Just u

### Infer or assert from the interface, not the DOM properties or browser status

All the data sent to the LLM is in the form of screenshots and element coordinates. The DOM and the browser instance are almost invisible to the LLM. Therefore, ensure everything you expect is visible in the on the screen.
All the data sent to the LLM is in the form of screenshots and element coordinates. The DOM and the browser instance are almost invisible to the LLM. Therefore, ensure everything you expect is visible on the screen.

Good ✅: The title is blue

Expand Down
2 changes: 1 addition & 1 deletion apps/site/docs/en/docs/usage/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ expect(onesieItem.price).toBe(7.99);

### `.aiWaitFor(assertion: string, {timeoutMs?: number, checkIntervalMs?: number })` - wait until the assertion is met

`.aiWaitFor` will help you check if your assertion has been met or an timeout error occurred. Considering the AI service cost, the check interval will not exceed `checkIntervalMs` milliseconds. The default config sets `timeoutMs` to 15 seconds and `checkIntervalMs` to 3 seconds: i.e. check at most 5 times if all assertions fail and the AI service always responds immediately.
`.aiWaitFor` will help you check if your assertion has been met or a timeout error occurred. Considering the AI service cost, the check interval will not exceed `checkIntervalMs` milliseconds. The default config sets `timeoutMs` to 15 seconds and `checkIntervalMs` to 3 seconds: i.e. check at most 5 times if all assertions fail and the AI service always responds immediately.

When considering the time required for the AI service, `.aiWaitFor` may not be very efficient. Using a simple `sleep` method might be a useful alternative to `waitFor`.

Expand Down

0 comments on commit 18b5e92

Please sign in to comment.