Skip to content

v0.21.0

Compare
Choose a tag to compare
@jackmpcollins jackmpcollins released this 22 Apr 06:46
· 87 commits to main since this release

What's Changed

Full Changelog: v0.20.1...v0.21.0


Mistral API now supported natively 🚀

with full support for StreamedStr, ParallelFunctionCall, etc. Example:

from magentic import prompt
from magentic.chat_model.mistral_chat_model import MistralChatModel
from pydantic import BaseModel


class Superhero(BaseModel):
    name: str
    age: int
    power: str
    enemies: list[str]


@prompt(
    """Create a Superhero named {name}""",
    model=MistralChatModel("mistral-large-latest"),
)
def create_superhero(name: str) -> Superhero: ...


create_superhero("Garden Man")
# Superhero(name='Garden Man', age=35, power='Plant control', enemies=['Smog', 'Deforestator'])