Skip to content

v0.23.0

Compare
Choose a tag to compare
@jackmpcollins jackmpcollins released this 07 May 05:20
· 12 commits to main since this release

What's Changed

  • πŸ¦™ Ollama can now return structured outputs / function calls (it takes a little prompting to make it reliable).
from magentic import prompt
from magentic.chat_model.litellm_chat_model import LitellmChatModel


@prompt(
    "Count to {n}. Use the tool to return in the format [1, 2, 3, ...]",
    model=LitellmChatModel("ollama_chat/llama2", api_base="http://localhost:11434")
)
def count_to(n: int) -> list[int]: ...


count_to(5)
# > [1, 2, 3, 4, 5]

PRs

Full Changelog: v0.22.0...v0.23.0