Skip to content

Commit

Permalink
Fix more typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ToughAnyway committed Apr 17, 2024
1 parent 43ae25c commit 2004f8c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/promptflow-evals/tests/evals/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def is_replay():
return False


PROMOTFLOW_ROOT = Path(__file__) / "../../../.."
CONNECTION_FILE = (PROMOTFLOW_ROOT / "promptflow-evals/connections.json").resolve().absolute().as_posix()
RECORDINGS_TEST_CONFIGS_ROOT = Path(PROMOTFLOW_ROOT / "promptflow-recording/recordings/local").resolve()
PROMPTFLOW_ROOT = Path(__file__) / "../../../.."
CONNECTION_FILE = (PROMPTFLOW_ROOT / "promptflow-evals/connections.json").resolve().absolute().as_posix()
RECORDINGS_TEST_CONFIGS_ROOT = Path(PROMPTFLOW_ROOT / "promptflow-recording/recordings/local").resolve()


def pytest_configure():
Expand Down
18 changes: 9 additions & 9 deletions src/promptflow-tools/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from promptflow.tools.aoai import AzureOpenAI
from promptflow.tools.aoai_gpt4v import AzureOpenAI as AzureOpenAIVision

PROMOTFLOW_ROOT = Path(__file__).absolute().parents[1]
CONNECTION_FILE = (PROMOTFLOW_ROOT / "connections.json").resolve().absolute().as_posix()
root_str = str(PROMOTFLOW_ROOT.resolve().absolute())
PROMPTFLOW_ROOT = Path(__file__).absolute().parents[1]
CONNECTION_FILE = (PROMPTFLOW_ROOT / "connections.json").resolve().absolute().as_posix()
root_str = str(PROMPTFLOW_ROOT.resolve().absolute())
if root_str not in sys.path:
sys.path.insert(0, root_str)

Expand Down Expand Up @@ -108,42 +108,42 @@ def skip_if_no_api_key(request, mocker):
# example prompts
@pytest.fixture
def example_prompt_template() -> str:
with open(PROMOTFLOW_ROOT / "tests/test_configs/prompt_templates/marketing_writer/prompt.jinja2") as f:
with open(PROMPTFLOW_ROOT / "tests/test_configs/prompt_templates/marketing_writer/prompt.jinja2") as f:
prompt_template = f.read()
return prompt_template


@pytest.fixture
def example_prompt_template_with_name_in_roles() -> str:
with open(PROMOTFLOW_ROOT / "tests/test_configs/prompt_templates/prompt_with_name_in_roles.jinja2") as f:
with open(PROMPTFLOW_ROOT / "tests/test_configs/prompt_templates/prompt_with_name_in_roles.jinja2") as f:
prompt_template = f.read()
return prompt_template


@pytest.fixture
def chat_history() -> list:
with open(PROMOTFLOW_ROOT / "tests/test_configs/prompt_templates/marketing_writer/history.json") as f:
with open(PROMPTFLOW_ROOT / "tests/test_configs/prompt_templates/marketing_writer/history.json") as f:
history = json.load(f)
return history


@pytest.fixture
def example_prompt_template_with_function() -> str:
with open(PROMOTFLOW_ROOT / "tests/test_configs/prompt_templates/prompt_with_function.jinja2") as f:
with open(PROMPTFLOW_ROOT / "tests/test_configs/prompt_templates/prompt_with_function.jinja2") as f:
prompt_template = f.read()
return prompt_template


@pytest.fixture
def example_prompt_template_with_image() -> str:
with open(PROMOTFLOW_ROOT / "tests/test_configs/prompt_templates/prompt_with_image.jinja2") as f:
with open(PROMPTFLOW_ROOT / "tests/test_configs/prompt_templates/prompt_with_image.jinja2") as f:
prompt_template = f.read()
return prompt_template


@pytest.fixture
def example_image() -> Image:
with open(PROMOTFLOW_ROOT / "tests/test_configs/prompt_templates/images/number10.jpg", "rb") as f:
with open(PROMPTFLOW_ROOT / "tests/test_configs/prompt_templates/images/number10.jpg", "rb") as f:
image = Image(f.read())
return image

Expand Down

0 comments on commit 2004f8c

Please sign in to comment.