Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
parkervg committed Oct 25, 2024
1 parent 30faab2 commit 5d37031
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions tests/models/test_model_constraints.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest

import pandas as pd

import blendsql
Expand Down Expand Up @@ -43,35 +42,26 @@ def db() -> Pandas:
def test_alphabet(db, model, ingredients):
if not isinstance(model, AzurePhiModel):
pytest.skip()
blendsql_query = """
SELECT * FROM ( VALUES {{LLMQA('What are the first letters of the alphabet?')}} )
"""
smoothie = blendsql.blend(
query=blendsql_query,
blend = lambda query: blendsql.blend(
query=query,
default_model=model,
ingredients=ingredients,
db=db,
)
blendsql_query = """
SELECT * FROM ( VALUES {{LLMQA('What are the first letters of the alphabet?')}} )
"""
smoothie = blend(blendsql_query)
assert "A" in smoothie.df.values.tolist()[0]

blendsql_query = """
SELECT * FROM ( VALUES {{LLMQA('What are the first letters of the alphabet?', modifier="{3}")}} )
"""
smoothie = blendsql.blend(
query=blendsql_query,
default_model=model,
ingredients=ingredients,
db=db,
)
smoothie = blend(blendsql_query)
assert smoothie.df.values.tolist()[0] == ["A", "B", "C"]

blendsql_query = """
SELECT * FROM ( VALUES {{LLMQA('What are the first letters of the alphabet?', options='α;β;γ;δ', modifier="{3}")}} )
"""
smoothie = blendsql.blend(
query=blendsql_query,
default_model=model,
ingredients=ingredients,
db=db,
)
smoothie = blend(blendsql_query)
assert smoothie.df.values.tolist()[0] == ["α", "β", "γ"]

0 comments on commit 5d37031

Please sign in to comment.