Skip to content

Commit

Permalink
Remove straggler models
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed Jan 24, 2025
1 parent 2ed5ab8 commit 08c52c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion docs/patterns/interactivity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ Here's a complete example of an interactive survey:
```python Code
import marvin
from typing import Literal
from dataclasses import dataclass

class Survey(marvin.Model):
@dataclass
class Survey:
name: str
age: int
interests: list[str]
Expand Down
9 changes: 6 additions & 3 deletions docs/patterns/task-results.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,16 @@ Pydantic models (recommended) provide rich validation and nested structures:

```python
import marvin
from marvin import Model
from dataclasses import dataclass

class Person(Model):
@dataclass
class Person:
name: str
age: int
interests: list[str]

class Movie(Model):
@dataclass
class Movie:
title: str
director: Person
year: int
Expand All @@ -272,6 +274,7 @@ people = marvin.run(
"List the main characters in Star Wars",
result_type=list[Person]
)
print(people[0].name) # "Luke Skywalker"
```

## Validation
Expand Down

0 comments on commit 08c52c9

Please sign in to comment.