Skip to content

Commit

Permalink
fix: drop enums for anthropic
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnl committed Apr 29, 2024
1 parent 973d4ae commit 4fc44c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/llm/test_anthropic/evals/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class User(BaseModel):
assert isinstance(member, str)


@pytest.mark.skip("Just use Literal!")
def test_enum():
class Role(str, Enum):
ADMIN = "admin"
Expand All @@ -110,15 +111,15 @@ class User(BaseModel):
resp = client.messages.create(
model="claude-3-haiku-20240307",
max_tokens=1024,
max_retries=0,
max_retries=1,
messages=[
{
"role": "user",
"content": "Create a user for a model with a name and role of admin.",
}
],
response_model=User,
) # type: ignore
)

assert isinstance(resp, User)
assert resp.role == Role.ADMIN
Expand Down

0 comments on commit 4fc44c9

Please sign in to comment.