my prefect server setup prefect-metrics.waow.tech
python orchestration
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: construct AnthropicModel directly with provider

passing "anthropic:claude-haiku-4-5" as the model string causes
infer_model() to create a new AnthropicProvider() with no key,
ignoring the provider kwarg. construct AnthropicModel directly instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

zzstoatzz a883bb5f e31ae075

+3 -2
+3 -2
flows/curate.py
··· 5 5 import duckdb 6 6 from pydantic_ai import Agent 7 7 from pydantic_ai.durable_exec.prefect import PrefectAgent, TaskConfig 8 + from pydantic_ai.models.anthropic import AnthropicModel 8 9 from pydantic_ai.providers.anthropic import AnthropicProvider 9 10 from prefect import flow, task, get_run_logger 10 11 from prefect.blocks.system import Secret ··· 25 26 26 27 def make_agent(api_key: str) -> PrefectAgent[Briefing]: 27 28 """Build agent after API key is available (provider validates key at init).""" 29 + model = AnthropicModel("claude-haiku-4-5", provider=AnthropicProvider(api_key=api_key)) 28 30 agent = Agent( 29 - "anthropic:claude-haiku-4-5", 31 + model, 30 32 output_type=Briefing, 31 33 system_prompt=SYSTEM_PROMPT, 32 34 name="hub-curator", 33 - provider=AnthropicProvider(api_key=api_key), 34 35 ) 35 36 return PrefectAgent( 36 37 agent,