v0.5.0
What's Changed
- Add docstrings where useful by @jackmpcollins in #14
- Enable async prompt_chain. Remove FunctionCallMessage by @jackmpcollins in #17
Full Changelog: v0.4.1...v0.5.0
from magentic import prompt_chain
async def get_current_weather(location, unit="fahrenheit"):
"""Get the current weather in a given location"""
return {
"location": location,
"temperature": "72",
"unit": unit,
"forecast": ["sunny", "windy"],
}
@prompt_chain(
template="What's the weather like in {city}?",
functions=[get_current_weather],
)
async def describe_weather(city: str) -> str:
...
output = await describe_weather("Boston")