Skip to content

Commit

Permalink
Updated comments on example
Browse files Browse the repository at this point in the history
  • Loading branch information
PhiBrandon committed Nov 26, 2023
1 parent 934d1f8 commit 0f9e91c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/open_source_examples/openrouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ class UserDetail(BaseModel):
# Let's call the model
user = client.chat.completions.create(response_format={"type": "json_object"}, model=model, messages=[system_message,user_message])

# Make some assertions
# Unmarshal Json
detail = UserDetail.model_validate_json(user.choices[0].message.content)
print(detail)

# Make assertions
assert isinstance(detail, UserDetail)
assert detail.name == "Brandon"
assert detail.age == 33

0 comments on commit 0f9e91c

Please sign in to comment.