Connect a model or use a custom agent loop
For a sales agent, start with PydanticAILoop(sales=True). It gives a buyer reply and a team handover separate fields in the result. For example, the buyer can hear “A sales rep will follow up” while the sales rep receives the quantities and terms to discuss.
Choose the model and funding source in the agent definition. Install the extra for that provider and supply its key through the environment or a managed connection. Publication pins a concrete model for company-funded defaults.
When you supply your own loop
A custom loop receives an ExecutionContext. Return an explicit completion, wait, delegation, or failure outcome and save any state needed for the next attempt. Match the supported sales result contract if your loop handles sales. Keep buyer answers separate from team-only questions and summaries. Test a resumed turn and a cancelled turn before letting the loop perform external actions. Work and checkpoints.
The model answered in a different environment
Suppose a colleague can run the starter locally, but the hosted project stops before producing a buyer reply. Check which model and provider the saved project names, whether its provider extra is in the deployed environment, and whether that workspace allows the model. Then check which connection or funding source the run is meant to use.
A passing test with a controlled model response is a good check on your agent code. To check the real provider, use a permitted test environment, one small buyer question and the intended connection. Keep the run ID with the result so a teammate can tell which setup was exercised.