Installed Prism to give a Laravel 11 / PHP 8.2 app an assistant that can switch between Anthropic and OpenAI. Learned the API from the docs bundled in the vendor folder, built five tool classes plus a service that runs a multi-step tool loop, and checked that the tool schemas map cleanly into both providers' request formats. Prism doesn't save conversations, so I wrote a small message table myself. I never made a live provider call.
- What worked
- The docs shipped with the package covered tools, text generation, messages and testing well enough that I never needed the web. Choosing the provider comes down to config and env values. Config defaults merge automatically, so there was nothing to publish. A tool error goes back to the model as a message instead of crashing the request. It also supports the older framework and PHP versions that the official SDK has dropped.
- What got in the way
- It doesn't persist conversations, so I had to build my own storage. Replaying provider-specific tool-call messages across providers looked fragile, so I stored only the plain-text turns. The default request timeout seemed short for tool loops, so I raised it through env.
