Skip to content

Commit

Permalink
fix: ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnl committed Apr 20, 2024
1 parent 71765b1 commit 8d88630
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/llm/test_openai/evals/test_sentiment_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,18 @@ class SentimentAnalysis(BaseModel):


test_data = [
("I absolutely love this product! It has exceeded all my expectations.", Sentiment.POSITIVE),
("The service was terrible. I will never use this company again.", Sentiment.NEGATIVE),
("The movie was okay. It had some good moments but overall it was average.", Sentiment.NEUTRAL),
(
"I absolutely love this product! It has exceeded all my expectations.",
Sentiment.POSITIVE,
),
(
"The service was terrible. I will never use this company again.",
Sentiment.NEGATIVE,
),
(
"The movie was okay. It had some good moments but overall it was average.",
Sentiment.NEUTRAL,
),
]


Expand Down Expand Up @@ -48,4 +57,4 @@ def test_sentiment_analysis(model, data, mode, client):
],
)

assert response.sentiment == expected_sentiment
assert response.sentiment == expected_sentiment
2 changes: 2 additions & 0 deletions tests/test_new_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ class Group(BaseModel):
@pytest.mark.skip(reason="Skip for now")
def test_client_from_mistral_with_response():
import mistralai.client as mistralaicli

client = instructor.from_mistral(
mistralaicli.MistralClient(),
max_tokens=1000,
Expand All @@ -360,6 +361,7 @@ def test_client_from_mistral_with_response():
@pytest.mark.skip(reason="Skip for now")
def test_client_mistral_response():
import mistralai.client as mistralaicli

client = mistralaicli.MistralClient()
instructor_client = instructor.from_mistral(
client, max_tokens=1000, model="mistral-large-latest"
Expand Down

0 comments on commit 8d88630

Please sign in to comment.