Skip to content

Commit

Permalink
Update tutorial-eval.md
Browse files Browse the repository at this point in the history
Added pydantic `Field` and calls to `super().__init__()` for classes that inherit weave objects.
  • Loading branch information
travis-the-dragon authored Aug 26, 2024
1 parent a72f7de commit 0658996
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docs/docs/tutorial-eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ import weave

# highlight-next-line
class ExtractFruitsModel(weave.Model):
model_name: str
prompt_template: str
model_name: str = Field( default="gpt-fruity-fresh-1.0" )
prompt_template: str = Field( default="You are an AI fruit expert who can find any fruit, even the mythical ones!" )

def __init__(self):
super().__init__()

# highlight-next-line
@weave.op()
Expand Down Expand Up @@ -140,9 +143,12 @@ import openai

# highlight-next-line
class ExtractFruitsModel(weave.Model):
model_name: str
prompt_template: str
model_name: str = Field( default="gpt-fruity-fresh-1.0" )
prompt_template: str = Field( default="You are an AI fruit expert who can find any fruit, even the mythical ones!" )

def __init__(self):
super().__init__()

# highlight-next-line
@weave.op()
# highlight-next-line
Expand Down

0 comments on commit 0658996

Please sign in to comment.