v0.29.0
What's Changed
- Make Message a pydantic model / serializable by @jackmpcollins in #294
This means Message
objects can be used anywhere pydantic models can, including in prompt-functions. The new AnyMessage
type simplifies this. For example
from magentic import AnyMessage, prompt
@prompt("Create an example of few-shot prompting for a chatbot")
def make_few_shot_prompt() -> list[AnyMessage]: ...
make_few_shot_prompt()
# [SystemMessage('You are a helpful and knowledgeable assistant.'),
# UserMessage('What’s the weather like today?'),
# AssistantMessage[Any]('The weather today is sunny with a high of 75°F (24°C).'),
# UserMessage('Can you explain the theory of relativity in simple terms?'),
# AssistantMessage[Any]('Sure! The theory of relativity, developed by Albert Einstein, ...]
Dependabot
- Bump logfire-api from 0.46.1 to 0.49.0 by @dependabot in #292
- Bump logfire from 0.46.1 to 0.49.0 by @dependabot in #293
- Bump pytest from 8.2.2 to 8.3.2 by @dependabot in #286
- Bump openai from 1.35.13 to 1.38.0 by @dependabot in #290
- Bump mypy from 1.10.1 to 1.11.1 by @dependabot in #291
Full Changelog: v0.28.1...v0.29.0