Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge from main. #14

Merged
merged 50 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
1f6d94b
Feat: add toxic score function
Anindyadeep Nov 6, 2023
6b686cf
added tests for toxic score
Anindyadeep Nov 6, 2023
53d7438
merge from main
Anindyadeep Nov 6, 2023
5973760
merge from main and remove conflicts
Anindyadeep Nov 6, 2023
d006691
Merge pull request #12 from confident-ai/main
Anindyadeep Nov 13, 2023
b9f382d
added judgemental gpt
penguine-ip Nov 14, 2023
c74c5d5
reformat
penguine-ip Nov 14, 2023
603b0be
Merge pull request #283 from confident-ai/feature/judgementalgpt
penguine-ip Nov 14, 2023
727fdb3
new release
penguine-ip Nov 14, 2023
b40b66b
Merge pull request #284 from confident-ai/release-v0.20.18
penguine-ip Nov 14, 2023
223764f
.
penguine-ip Nov 14, 2023
d7db1d6
Merge pull request #285 from confident-ai/release-v0.20.18
penguine-ip Nov 14, 2023
996d167
updated docs
penguine-ip Nov 14, 2023
6c397b0
added a mean toxic score along with different other toxic score in re…
Nov 14, 2023
b6c83e4
updated the testings of different types of toxicity scores
Nov 14, 2023
03edce8
run black
Nov 14, 2023
0800a6c
Fix: Minor bug in mean calculation.
Nov 14, 2023
a81f08d
.
penguine-ip Nov 14, 2023
d7b2de9
updated docs
penguine-ip Nov 14, 2023
0d1f99e
Update README.md
penguine-ip Nov 14, 2023
4e84095
Merge pull request #273 from Anindyadeep/anindya/scorer
penguine-ip Nov 14, 2023
8bab133
initial langchain support to enable azure oai support
agokrani Nov 15, 2023
c4b31f7
fixed formatting issues
agokrani Nov 15, 2023
68d3d31
updated docs
penguine-ip Nov 15, 2023
9e0fb03
fixed run tests
penguine-ip Nov 16, 2023
85edf22
fix test
penguine-ip Nov 16, 2023
1b42e22
deleted ranking similarity
penguine-ip Nov 16, 2023
bef0add
Merge pull request #288 from confident-ai/hotfix/runtest
penguine-ip Nov 16, 2023
ccea906
added evaluate
penguine-ip Nov 16, 2023
a09db90
fix test
penguine-ip Nov 16, 2023
3035cbb
fix tests
penguine-ip Nov 16, 2023
a1ce449
Merge pull request #289 from confident-ai/feature/evaluate
penguine-ip Nov 16, 2023
3828faa
updated docs
penguine-ip Nov 16, 2023
c7c0b8b
new release
penguine-ip Nov 16, 2023
905cbf3
Merge pull request #290 from confident-ai/release-v0.20.19
penguine-ip Nov 16, 2023
705d359
fix docs
penguine-ip Nov 16, 2023
8b2578d
fix docs
penguine-ip Nov 16, 2023
eec7a30
Update README.md
penguine-ip Nov 16, 2023
42f7ebd
test added with azure openai
Nov 16, 2023
744256c
Updated docs
agokrani Nov 16, 2023
1b4c387
Merge pull request #287 from agokrani/feature/langchain-support
penguine-ip Nov 17, 2023
ad6f56d
added dataset abstraction
penguine-ip Nov 18, 2023
52c2889
fix dependency
penguine-ip Nov 18, 2023
0d8a6e9
.
penguine-ip Nov 18, 2023
8093133
.
penguine-ip Nov 18, 2023
e61110e
removed asserts
penguine-ip Nov 18, 2023
0572416
fix actions
penguine-ip Nov 18, 2023
7e0a8ff
fix tests
penguine-ip Nov 18, 2023
6c40706
fix imports
penguine-ip Nov 18, 2023
fc1520f
Merge pull request #292 from confident-ai/features/dataset
penguine-ip Nov 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/deepeval-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ jobs:
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction

- name: Run tests without pytest
run: poetry run python tests/test_without_pytest.py

- name: Run deepeval tests and capture output
run: poetry run deepeval test run tests/test_quickstart.py > output.txt 2>&1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ jobs:
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
poetry run pytest tests/ --ignore=tests/test_llm_metric.py --ignore=tests/test_overall_score.py
poetry run pytest tests/ --ignore=tests/test_llm_metric.py
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ from deepeval.evaluator import assert_test

def test_case():
input = "What if these shoes don't fit?"
context = "All customers are eligible for a 30 day full refund at no extra costs."
context = ["All customers are eligible for a 30 day full refund at no extra costs."]

# Replace this with the actual output from your LLM application
actual_output = "We offer a 30-day full refund at no extra costs."
Expand Down Expand Up @@ -118,7 +118,7 @@ deepeval test run test_chatbot.py

You should see a link displayed in the CLI once the test has finished running. Paste it into your browser to view the results!

![ok](https://d2lsxfc3p6r9rv.cloudfront.net/dashboard.png)
![ok](https://d2lsxfc3p6r9rv.cloudfront.net/test-summary.png)

<br />

Expand Down
2 changes: 1 addition & 1 deletion deepeval/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__: str = "0.20.17"
__version__: str = "0.20.19"
63 changes: 0 additions & 63 deletions deepeval/cli/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import typer
import os
from typing_extensions import Annotated
from deepeval.metrics.overall_score import assert_overall_score
from .cli_key_handler import set_env_vars
from typing import Optional
from deepeval.test_run import test_run_manager, TEMP_FILE_NAME
from deepeval.utils import delete_file_if_exists
Expand All @@ -17,67 +15,6 @@
app = typer.Typer(name="test")


def sample():
set_env_vars()
print("Sending sample test results...")
print(
"If this is your first time running these models, it may take a while."
)
try:
query = "How does photosynthesis work?"
output = "Photosynthesis is the process by which green plants and some other organisms use sunlight to synthesize foods with the help of chlorophyll pigment."
expected_output = "Photosynthesis is the process by which green plants and some other organisms use sunlight to synthesize food with the help of chlorophyll pigment."
context = "Biology"

assert_overall_score(query, output, expected_output, context)

except AssertionError as e:
pass
try:
query = "What is the capital of France?"
output = "The capital of France is Paris."
expected_output = "The capital of France is Paris."
context = "Geography"

assert_overall_score(query, output, expected_output, context)

except AssertionError as e:
pass
try:
query = "What are the major components of a cell?"
output = "Cells have many major components, including the cell membrane, nucleus, mitochondria, and endoplasmic reticulum."
expected_output = "Cells have several major components, such as the cell membrane, nucleus, mitochondria, and endoplasmic reticulum."
context = "Biology"
minimum_score = 0.8 # Adjusting the minimum score threshold

assert_overall_score(
query, output, expected_output, context, minimum_score
)

except AssertionError as e:
pass

try:
query = "What is the capital of Japan?"
output = "The largest city in Japan is Tokyo."
expected_output = "The capital of Japan is Tokyo."
context = "Geography"

assert_overall_score(query, output, expected_output, context)
except AssertionError as e:
pass

try:
query = "Explain the theory of relativity."
output = "Einstein's theory of relativity is famous."
expected_output = "Einstein's theory of relativity revolutionized our understanding of space, time, and gravity."
context = "Physics"

assert_overall_score(query, output, expected_output, context)
except AssertionError as e:
pass


def check_if_valid_file(test_file_or_directory: str):
if "::" in test_file_or_directory:
test_file_or_directory, test_case = test_file_or_directory.split("::")
Expand Down
Loading