Home / Function/ until_done() — anthropic-sdk-python Function Reference

until_done() — anthropic-sdk-python Function Reference

Architecture documentation for the until_done() function in _beta_runner.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  1da9fb48_10a6_0c76_a1ce_2ab027e77a58["until_done()"]
  9149fa46_e498_7ba3_1b94_e0095e473ff9["BaseSyncToolRunner"]
  1da9fb48_10a6_0c76_a1ce_2ab027e77a58 -->|defined in| 9149fa46_e498_7ba3_1b94_e0095e473ff9
  0a6c0591_45c9_6f1d_0ff2_febf24cf88b5["until_done()"]
  0a6c0591_45c9_6f1d_0ff2_febf24cf88b5 -->|calls| 1da9fb48_10a6_0c76_a1ce_2ab027e77a58
  b2a98d76_24b2_7388_d54b_d0f7084fdb5f["_get_last_message()"]
  1da9fb48_10a6_0c76_a1ce_2ab027e77a58 -->|calls| b2a98d76_24b2_7388_d54b_d0f7084fdb5f
  0a6c0591_45c9_6f1d_0ff2_febf24cf88b5["until_done()"]
  1da9fb48_10a6_0c76_a1ce_2ab027e77a58 -->|calls| 0a6c0591_45c9_6f1d_0ff2_febf24cf88b5
  style 1da9fb48_10a6_0c76_a1ce_2ab027e77a58 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/lib/tools/_beta_runner.py lines 264–272

    def until_done(self) -> ParsedBetaMessage[ResponseFormatT]:
        """
        Consumes the tool runner stream and returns the last message if it has not been consumed yet.
        If it has, it simply returns the last message.
        """
        consume_sync_iterator(self)
        last_message = self._get_last_message()
        assert last_message is not None
        return last_message

Subdomains

Called By

Frequently Asked Questions

What does until_done() do?
until_done() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/lib/tools/_beta_runner.py.
Where is until_done() defined?
until_done() is defined in src/anthropic/lib/tools/_beta_runner.py at line 264.
What does until_done() call?
until_done() calls 2 function(s): _get_last_message, until_done.
What calls until_done()?
until_done() is called by 1 function(s): until_done.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free