Skip to content

Commit

Permalink
Update playwright test
Browse files Browse the repository at this point in the history
  • Loading branch information
pamelafox committed Nov 5, 2024
1 parent d0a211f commit 7968c4c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/data_ingestion.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ If needed, you can modify the chunking algorithm in `scripts/prepdocslib/textspl

To enhance search functionality, categorize data during the ingestion process with the `--category` argument, for example `scripts/prepdocs.ps1 --category ExampleCategoryName`. This argument specifies the category to which the data belongs, enabling you to filter search results based on these categories.

After running the script with the desired category, ensure these categories are added to the 'Include Category' dropdown list. This can be found in the developer settings in [`Settings.tsx`](../app/frontend/src/components/settings/Settings.tsx). The default option for this dropdown is "All". By including specific categories, you can refine your search results more effectively.
After running the script with the desired category, ensure these categories are added to the 'Include Category' dropdown list. This can be found in the developer settings in [`Settings.tsx`](/app/frontend/src/components/settings/Settings.tsx). The default option for this dropdown is "All". By including specific categories, you can refine your search results more effectively.

Check failure on line 60 in docs/data_ingestion.md

View workflow job for this annotation

GitHub Actions / Check Broken Relative Paths

File docs/data_ingestion.md, line 60, Link /app/frontend/src/components/settings/Settings.tsx is broken.

### Indexing additional documents

Expand Down
16 changes: 16 additions & 0 deletions tests/e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,17 @@ def test_chat_customization(page: Page, live_server_url: str):
# Set up a mock route to the /chat endpoint
def handle(route: Route):
overrides = route.request.post_data_json["context"]["overrides"]
assert overrides["temperature"] == 0.5
assert overrides["seed"] == 123
assert overrides["minimum_search_score"] == 0.5
assert overrides["minimum_reranker_score"] == 0.5
assert overrides["retrieval_mode"] == "vectors"
assert overrides["semantic_ranker"] is False
assert overrides["semantic_captions"] is True
assert overrides["top"] == 1
assert overrides["prompt_template"] == "You are a cat and only talk about tuna."
assert overrides["exclude_category"] == "dogs"
assert overrides["suggest_followup_questions"] is True
assert overrides["use_oid_security_filter"] is False
assert overrides["use_groups_security_filter"] is False

Expand All @@ -170,12 +175,23 @@ def handle(route: Route):
page.get_by_role("button", name="Developer settings").click()
page.get_by_label("Override prompt template").click()
page.get_by_label("Override prompt template").fill("You are a cat and only talk about tuna.")
page.get_by_label("Temperature").click()
page.get_by_label("Temperature").fill("0.5")
page.get_by_label("Seed").click()
page.get_by_label("Seed").fill("123")
page.get_by_label("Minimum search score").click()
page.get_by_label("Minimum search score").fill("0.5")
page.get_by_label("Minimum reranker score").click()
page.get_by_label("Minimum reranker score").fill("0.5")
page.get_by_label("Retrieve this many search results:").click()
page.get_by_label("Retrieve this many search results:").fill("1")
page.get_by_label("Include category").click()
page.get_by_role("option", name="All", exact=True).click()
page.get_by_label("Exclude category").click()
page.get_by_label("Exclude category").fill("dogs")
page.get_by_text("Use semantic captions").click()
page.get_by_text("Use semantic ranker for retrieval").click()
page.get_by_text("Suggest follow-up questions").click()
page.get_by_text("Vectors + Text (Hybrid)").click()
page.get_by_role("option", name="Vectors", exact=True).click()
page.get_by_text("Stream chat completion responses").click()
Expand Down

0 comments on commit 7968c4c

Please sign in to comment.