Skip to content

Commit

Permalink
Merge pull request #19 from confident-ai/main
Browse files Browse the repository at this point in the history
merge from main.
  • Loading branch information
Anindyadeep authored Dec 11, 2023
2 parents d3c1814 + 159aa41 commit 3092210
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 22 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/deepeval-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,23 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
# - name: Load cached venv
# id: cached-poetry-dependencies
# uses: actions/cache@v3
# with:
# path: .venv
# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction

- name: List Installed Packages
run: poetry run pip list

- name: Check if 'deepeval' script is available
run: ls -l $(poetry env info --path)/bin/deepeval || echo "deepeval script not found"

- 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 deepeval/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__: str = "0.20.29"
__version__: str = "0.20.30"
40 changes: 26 additions & 14 deletions deepeval/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from deepeval.api import Api
from deepeval.key_handler import KEY_FILE_HANDLER
from deepeval.cli.test import app as test_app
from typing import Optional
import webbrowser

app = typer.Typer(name="deepeval")
Expand All @@ -23,21 +24,32 @@ def login(
typer.Option(
help="API key to get from https://app.confident-ai.com. Required if you want to log events to the server."
),
] = ""
] = "",
confident_api_key: Optional[str] = typer.Option(
None,
"--confident-api-key",
"-c",
help="Optional confident API key to bypass login.",
),
):
"""Login to the DeepEval platform."""
print("Welcome to [bold]DeepEval[/bold]!")
print(
"Grab your API key here: [link=https://app.confident-ai.com]https://app.confident-ai.com[/link] "
)
webbrowser.open("https://app.confident-ai.com")
if api_key == "":
while True:
api_key = input("Paste your API Key: ").strip()
if api_key:
break
else:
print("API Key cannot be empty. Please try again.\n")
# Use the confident_api_key if it is provided, otherwise proceed with existing logic
if confident_api_key:
api_key = confident_api_key
else:
"""Login to the DeepEval platform."""
print("Welcome to [bold]DeepEval[/bold]!")
print(
"Login and grab your API key here: [link=https://app.confident-ai.com]https://app.confident-ai.com[/link] "
)
webbrowser.open("https://app.confident-ai.com")
if api_key == "":
while True:
api_key = input("Paste your API Key: ").strip()
if api_key:
break
else:
print("API Key cannot be empty. Please try again.\n")

KEY_FILE_HANDLER.write_api_key(api_key)
client = Api(api_key=api_key)
print("Congratulations! Login successful :raising_hands: ")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "deepeval"
version = "0.20.29"
version = "0.20.30"
description = "The Evaluation Framework for LLMs"
authors = ["Jeffrey Ip <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 3092210

Please sign in to comment.