(
client: Anthropic,
*,
betas: Union[List[AnthropicBetaParam], Omit] = omit,
context_management: Union[BetaContextManagementConfigParam, Omit] = omit,
max_iterations: Union[int, Omit] = omit,
thread: Union[Literal[False], Omit] = omit,
)
| 2528 | |
| 2529 | |
| 2530 | def _sync_compact_runner( |
| 2531 | client: Anthropic, |
| 2532 | *, |
| 2533 | betas: Union[List[AnthropicBetaParam], Omit] = omit, |
| 2534 | context_management: Union[BetaContextManagementConfigParam, Omit] = omit, |
| 2535 | max_iterations: Union[int, Omit] = omit, |
| 2536 | thread: Union[Literal[False], Omit] = omit, |
| 2537 | ) -> BetaToolRunner[None]: |
| 2538 | return client.beta.messages.tool_runner( |
| 2539 | # `thread=False` is for the tests that pin the full history of a request the loop sends between compactions: |
| 2540 | # on a message thread those requests carry only the messages the server does not hold yet. |
| 2541 | thread=thread, |
| 2542 | max_tokens=1024, |
| 2543 | model="claude-haiku-4-5", |
| 2544 | tools=[_sync_weather_tool()], |
| 2545 | messages=[{"role": "user", "content": "What is the weather in SF?"}], |
| 2546 | betas=betas, |
| 2547 | context_management=context_management, |
| 2548 | max_iterations=max_iterations, |
| 2549 | ) |
| 2550 | |
| 2551 | |
| 2552 | def _async_compact_runner( |
no test coverage detected