import marvin
from typing import Literal
from dataclasses import dataclass
@dataclass
class Survey:
name: str
age: int
interests: list[str]
experience_level: Literal["beginner", "intermediate", "advanced"]
with marvin.Thread() as thread:
# Create an interactive agent
agent = marvin.Agent(
name="Surveyor",
cli=True,
instructions="Conduct a friendly survey about programming experience."
)
# Run the survey
result = marvin.run(
"Conduct a programming survey",
agents=[agent],
result_type=Survey
)
print(result)