guidance-ai / guidance

A guidance language for controlling large language models.
MIT License
18.14k stars 1.01k forks source link

Support for Anthropic Claude v3+ models #717

Open geoffyip opened 3 months ago

geoffyip commented 3 months ago

From Claude 3 onwards, all future Anthropic models are only compatible with the new Messages API instead of the legacy Text Completions API.

Changes to the prompt input structure are required. The Messages API is backwards compatible with other Anthropic models so it should not break usage for anyone who is still on Claude 2.1 or lower.

Migration Guide Migration Guide 2 Reference

D-Vaillant commented 2 months ago

Specifically, this line needs to be fixed: https://github.com/guidance-ai/guidance/blob/main/guidance/models/_anthropic.py#L59

maximegmd commented 2 weeks ago

With Claude 3.5 I think this is an important feature to have. OpenAi is finally getting a much needed competitor !

Harsha-Nori commented 2 weeks ago

I believe we have this supported with the latest guidance release 🙂.