vllm_mlx.tool_parsers.poolside_v1_tool_parser¶
Tool parser for the Poolside v1 Laguna chat-template format.
View the complete module source at #L1-L362.
API details¶
Each callable below includes its exact signature, type annotations, inputs, defaults, return contract, documented exceptions, implementation source, and parsed docstring sections when the source provides them.
vllm_mlx.tool_parsers.poolside_v1_tool_parser
¶
Tool parser for the Poolside v1 Laguna chat-template format.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser
¶
Bases: Glm47ToolParser
Parse Laguna tool calls and stream schema-declared strings incrementally.
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._UNCLOSED_TOOL_CALL
class-attribute
instance-attribute
¶
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._START
class-attribute
instance-attribute
¶
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._END
class-attribute
instance-attribute
¶
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._KEY_START
class-attribute
instance-attribute
¶
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._KEY_END
class-attribute
instance-attribute
¶
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._VALUE_START
class-attribute
instance-attribute
¶
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._VALUE_END
class-attribute
instance-attribute
¶
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser.reset
¶
Reset Laguna parser buffers and per-call argument state.
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._string_argument_names
staticmethod
¶
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._escape_string_content
staticmethod
¶
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._hold_partial_suffix
staticmethod
¶
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser.extract_tool_calls
¶
extract_tool_calls(model_output: str, request: dict[str, Any] | None = None) -> ExtractedToolCallInformation
Extract complete Laguna tool blocks and preserve remaining content.
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._begin_tool_call
¶
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._finish_tool_call
¶
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._delta
¶
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._argument_prefix
¶
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._close_arguments
¶
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._discard_through_tool_end
¶
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_text_before_tool
¶
Consume plain text or enter the next <tool_call> state.
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_tool_name
¶
Consume a tool name, or wait for enough input to identify it.
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_string_value
¶
Consume a string argument value, retaining incomplete suffixes.
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_pending_key
¶
Consume the value for the currently buffered argument key.
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_tool_body
¶
Consume an argument key or close the current tool call.
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser.extract_tool_calls_streaming
¶
extract_tool_calls_streaming(previous_text: str, current_text: str, delta_text: str, previous_token_ids: Sequence[int] | None = None, current_token_ids: Sequence[int] | None = None, delta_token_ids: Sequence[int] | None = None, request: dict[str, Any] | None = None) -> dict[str, Any] | None
Incrementally emit Laguna content and schema-aware tool arguments.
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
vllm_mlx.tool_parsers.poolside_v1_tool_parser._consume_stream_state
¶
_consume_stream_state(parser, pending: dict[int, dict[str, Any]], valid_names: set[str], request: dict[str, Any] | None) -> tuple[bool, str]
Source code in vllm_mlx/tool_parsers/poolside_v1_tool_parser.py
Complete contract reference¶
Expand any definition for its exact inputs, annotations, defaults, return contract, directly raised exceptions, source-grounded behavior, and immutable line link. This section includes private and nested definitions that ordinary API generators omit.
vllm_mlx.tool_parsers.poolside_v1_tool_parser._consume_stream_state · function
vllm_mlx.tool_parsers.poolside_v1_tool_parser._consume_stream_state(parser, pending: dict[int, dict[str, Any]], valid_names: set[str], request: dict[str, Any] | None) -> tuple[bool, str]
Function _consume_stream_state calls parser._consume_text_before_tool, parser._consume_tool_name, parser._consume_string_value, parser._consume_pending_key; has 5 explicit return paths.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
parser |
not annotated |
yes |
none |
Required positional or keyword input. |
pending |
dict[int, dict[str, Any]] |
yes |
none |
Required positional or keyword input. |
valid_names |
set[str] |
yes |
none |
Required positional or keyword input. |
request |
dict[str, Any] \| None |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
tuple[bool, str] - Direct return expressions:
parser._consume_text_before_tool();(parser._consume_tool_name(pending, valid_names), '');(parser._consume_string_value(pending), '');(parser._consume_pending_key(pending, request), '');(parser._consume_tool_body(pending), '')
Exceptions and behavior
Function _consume_stream_state calls parser._consume_text_before_tool, parser._consume_tool_name, parser._consume_string_value, parser._consume_pending_key; has 5 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser · class
Parse Laguna tool calls and stream schema-declared strings incrementally.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
tokenizer |
not annotated |
no |
None |
Optional positional or keyword input; defaults to None. |
Returns
- Constructs:
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser
Exceptions and behavior
Class PoolsideV1ToolParser derives from Glm47ToolParser and declares 18 direct member(s).
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser.__init__ · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser.__init__(tokenizer = None) -> not annotated
Method PoolsideV1ToolParser.__init__ calls super().__init__, super, self.reset.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
tokenizer |
not annotated |
no |
None |
Optional positional or keyword input; defaults to None. |
Returns
- Type:
not annotated
Exceptions and behavior
Method PoolsideV1ToolParser.__init__ calls super().__init__, super, self.reset.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser.reset · method
Reset Laguna parser buffers and per-call argument state.
Parameters
This callable has no explicit inputs.
Returns
- Type:
None
Exceptions and behavior
Method PoolsideV1ToolParser.reset updates self._buffer, self._in_tool_call, self._current_tool_name, self._pending_key; calls super().reset, super.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._string_argument_names · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._string_argument_names(request: dict[str, Any] | None, tool_name: str) -> set[str]
Method PoolsideV1ToolParser._string_argument_names calls set, request.get, isinstance, tool.get; has 2 explicit return paths.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
request |
dict[str, Any] \| None |
yes |
none |
Required positional or keyword input. |
tool_name |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
set[str] - Direct return expressions:
set();{name for name, schema in properties.items() if isinstance(schema, dict) and schema.get('type') == 'string'}
Exceptions and behavior
Method PoolsideV1ToolParser._string_argument_names calls set, request.get, isinstance, tool.get; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._escape_string_content · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._escape_string_content(value: str) -> str
Method PoolsideV1ToolParser._escape_string_content calls json.dumps; returns json.dumps(value, ensure_ascii=False)[1:-1].
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
value |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
str - Direct return expressions:
json.dumps(value, ensure_ascii=False)[1:-1]
Exceptions and behavior
Method PoolsideV1ToolParser._escape_string_content calls json.dumps; returns json.dumps(value, ensure_ascii=False)[1:-1].
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._hold_partial_suffix · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._hold_partial_suffix(buffer: str, marker: str) -> tuple[str, str]
Method PoolsideV1ToolParser._hold_partial_suffix calls range, min, len, buffer.endswith; has 2 explicit return paths.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
buffer |
str |
yes |
none |
Required positional or keyword input. |
marker |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
tuple[str, str] - Direct return expressions:
(buffer[:-size], buffer[-size:]);(buffer, '')
Exceptions and behavior
Method PoolsideV1ToolParser._hold_partial_suffix calls range, min, len, buffer.endswith; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser.extract_tool_calls · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser.extract_tool_calls(model_output: str, request: dict[str, Any] | None = None) -> ExtractedToolCallInformation
Extract complete Laguna tool blocks and preserve remaining content.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_output |
str |
yes |
none |
Required positional or keyword input. |
request |
dict[str, Any] \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
Returns
- Type:
ExtractedToolCallInformation - Direct return expressions:
ExtractedToolCallInformation(True, tool_calls, content);ExtractedToolCallInformation(False, [], content)
Exceptions and behavior
Method PoolsideV1ToolParser.extract_tool_calls calls self.strip_think_tags, self._get_tool_names, self.FUNC_DETAIL_PATTERN.finditer, match.group(1).strip; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._begin_tool_call · method
Method PoolsideV1ToolParser._begin_tool_call updates self.current_tool_id, self._in_tool_call, self._current_tool_name, self._pending_key; calls self._tool_ids.append, generate_tool_id, self._args_started.append, self._args_closed.append.
Parameters
This callable has no explicit inputs.
Returns
- Type:
None
Exceptions and behavior
Method PoolsideV1ToolParser._begin_tool_call updates self.current_tool_id, self._in_tool_call, self._current_tool_name, self._pending_key; calls self._tool_ids.append, generate_tool_id, self._args_started.append, self._args_closed.append.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._finish_tool_call · method
Method PoolsideV1ToolParser._finish_tool_call updates self._in_tool_call, self._current_tool_name, self._pending_key, self._streaming_string_value.
Parameters
This callable has no explicit inputs.
Returns
- Type:
None
Exceptions and behavior
Method PoolsideV1ToolParser._finish_tool_call updates self._in_tool_call, self._current_tool_name, self._pending_key, self._streaming_string_value.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._delta · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._delta(pending: dict[int, dict[str, Any]], *, name: str | None = None, arguments: str = '') -> None
Method PoolsideV1ToolParser._delta calls pending.setdefault; returns None.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
pending |
dict[int, dict[str, Any]] |
yes |
none |
Required positional or keyword input. |
name |
str \| None |
no |
None |
Optional keyword-only input; defaults to None. |
arguments |
str |
no |
'' |
Optional keyword-only input; defaults to ''. |
Returns
- Type:
None - Direct return expressions:
None
Exceptions and behavior
Method PoolsideV1ToolParser._delta calls pending.setdefault; returns None.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._argument_prefix · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._argument_prefix(key: str) -> str | None
Method PoolsideV1ToolParser._argument_prefix calls seen.add, json.dumps; has 2 explicit return paths.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
key |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
str | None - Direct return expressions:
None;separator + json.dumps(key, ensure_ascii=False) + ': '
Exceptions and behavior
Method PoolsideV1ToolParser._argument_prefix calls seen.add, json.dumps; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._close_arguments · method
Method PoolsideV1ToolParser._close_arguments has 2 explicit return paths.
Parameters
This callable has no explicit inputs.
Returns
- Type:
str - Direct return expressions:
'';'}' if self._args_started[self.current_tool_id] else '{}'
Exceptions and behavior
Method PoolsideV1ToolParser._close_arguments has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._discard_through_tool_end · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._discard_through_tool_end() -> bool
Method PoolsideV1ToolParser._discard_through_tool_end updates self._buffer; calls self._buffer.find, len, self._finish_tool_call; has 2 explicit return paths.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False;True
Exceptions and behavior
Method PoolsideV1ToolParser._discard_through_tool_end updates self._buffer; calls self._buffer.find, len, self._finish_tool_call; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_text_before_tool · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_text_before_tool() -> tuple[bool, str]
Consume plain text or enter the next <tool_call> state.
Parameters
This callable has no explicit inputs.
Returns
- Type:
tuple[bool, str] - Direct return expressions:
(False, emitted);(True, content)
Exceptions and behavior
Method PoolsideV1ToolParser._consume_text_before_tool updates self._buffer; calls self._buffer.find, self._hold_partial_suffix, len, self._begin_tool_call; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_tool_name · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_tool_name(pending: dict[int, dict[str, Any]], valid_names: set[str]) -> bool
Consume a tool name, or wait for enough input to identify it.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
pending |
dict[int, dict[str, Any]] |
yes |
none |
Required positional or keyword input. |
valid_names |
set[str] |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
bool - Direct return expressions:
False;self._discard_through_tool_end();True
Exceptions and behavior
Method PoolsideV1ToolParser._consume_tool_name updates self._buffer, self._reject_current, self._current_tool_name; calls self._buffer.find, min, self._buffer[:cut].strip, self._buffer.startswith; has 3 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_string_value · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_string_value(pending: dict[int, dict[str, Any]]) -> bool
Consume a string argument value, retaining incomplete suffixes.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
pending |
dict[int, dict[str, Any]] |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
bool - Direct return expressions:
True;self._discard_through_tool_end();False
Exceptions and behavior
Method PoolsideV1ToolParser._consume_string_value updates self._buffer, self._streaming_string_value, self._pending_key, self._reject_current; calls self._buffer.find, self._escape_string_content, len, self._delta; has 3 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_pending_key · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_pending_key(pending: dict[int, dict[str, Any]], request: dict[str, Any] | None) -> bool
Consume the value for the currently buffered argument key.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
pending |
dict[int, dict[str, Any]] |
yes |
none |
Required positional or keyword input. |
request |
dict[str, Any] \| None |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
bool - Direct return expressions:
self._discard_through_tool_end();False;True
Exceptions and behavior
Method PoolsideV1ToolParser._consume_pending_key updates self._reject_current, self._buffer, self._pending_key, self._streaming_string_value; calls self._buffer.find, self._discard_through_tool_end, len, self._pending_key.strip; has 3 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_tool_body · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser._consume_tool_body(pending: dict[int, dict[str, Any]]) -> bool
Consume an argument key or close the current tool call.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
pending |
dict[int, dict[str, Any]] |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
bool - Direct return expressions:
True;False
Exceptions and behavior
Method PoolsideV1ToolParser._consume_tool_body updates self._buffer, self._pending_key; calls self._buffer.find, len, self._delta, self._close_arguments; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser.extract_tool_calls_streaming · method
vllm_mlx.tool_parsers.poolside_v1_tool_parser.PoolsideV1ToolParser.extract_tool_calls_streaming(previous_text: str, current_text: str, delta_text: str, previous_token_ids: Sequence[int] | None = None, current_token_ids: Sequence[int] | None = None, delta_token_ids: Sequence[int] | None = None, request: dict[str, Any] | None = None) -> dict[str, Any] | None
Incrementally emit Laguna content and schema-aware tool arguments.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
previous_text |
str |
yes |
none |
Required positional or keyword input. |
current_text |
str |
yes |
none |
Required positional or keyword input. |
delta_text |
str |
yes |
none |
Required positional or keyword input. |
previous_token_ids |
Sequence[int] \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
current_token_ids |
Sequence[int] \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
delta_token_ids |
Sequence[int] \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
request |
dict[str, Any] \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
Returns
- Type:
dict[str, Any] | None - Direct return expressions:
payload or None
Exceptions and behavior
Method PoolsideV1ToolParser.extract_tool_calls_streaming updates self._buffer; calls self._get_tool_names, _consume_stream_state, list, pending.values; returns payload or None.
No direct raise statement appears in this definition.
Complete symbol map¶
This map also includes private definitions and nested helpers. The signature column exposes every explicit input even when an internal helper has no dedicated parameter prose.
| Symbol | Kind | Signature and inputs | What it does | Source |
|---|---|---|---|---|
_consume_stream_state |
function | _consume_stream_state(parser, pending: dict[int, dict[str, Any]], valid_names: set[str], request: dict[str, Any] \| None) -> tuple[bool, str] |
Function _consume_stream_state calls parser._consume_text_before_tool, parser._consume_tool_name, parser._consume_string_value, parser._consume_pending_key; has 5 explicit return paths. |
#L16-L30 |
PoolsideV1ToolParser |
class | PoolsideV1ToolParser(tokenizer = None) |
Parse Laguna tool calls and stream schema-declared strings incrementally. | #L34-L362 |
PoolsideV1ToolParser.__init__ |
method | PoolsideV1ToolParser.__init__(tokenizer = None) -> not annotated |
Method PoolsideV1ToolParser.__init__ calls super().__init__, super, self.reset. |
#L45-L47 |
PoolsideV1ToolParser.reset |
method | PoolsideV1ToolParser.reset() -> None |
Reset Laguna parser buffers and per-call argument state. | #L49-L62 |
PoolsideV1ToolParser._string_argument_names |
method | PoolsideV1ToolParser._string_argument_names(request: dict[str, Any] \| None, tool_name: str) -> set[str] |
Method PoolsideV1ToolParser._string_argument_names calls set, request.get, isinstance, tool.get; has 2 explicit return paths. |
#L65-L85 |
PoolsideV1ToolParser._escape_string_content |
method | PoolsideV1ToolParser._escape_string_content(value: str) -> str |
Method PoolsideV1ToolParser._escape_string_content calls json.dumps; returns json.dumps(value, ensure_ascii=False)[1:-1]. |
#L88-L89 |
PoolsideV1ToolParser._hold_partial_suffix |
method | PoolsideV1ToolParser._hold_partial_suffix(buffer: str, marker: str) -> tuple[str, str] |
Method PoolsideV1ToolParser._hold_partial_suffix calls range, min, len, buffer.endswith; has 2 explicit return paths. |
#L92-L96 |
PoolsideV1ToolParser.extract_tool_calls |
method | PoolsideV1ToolParser.extract_tool_calls(model_output: str, request: dict[str, Any] \| None = None) -> ExtractedToolCallInformation |
Extract complete Laguna tool blocks and preserve remaining content. | #L98-L138 |
PoolsideV1ToolParser._begin_tool_call |
method | PoolsideV1ToolParser._begin_tool_call() -> None |
Method PoolsideV1ToolParser._begin_tool_call updates self.current_tool_id, self._in_tool_call, self._current_tool_name, self._pending_key; calls self._tool_ids.append, generate_tool_id, self._args_started.append, self._args_closed.append. |
#L140-L150 |
PoolsideV1ToolParser._finish_tool_call |
method | PoolsideV1ToolParser._finish_tool_call() -> None |
Method PoolsideV1ToolParser._finish_tool_call updates self._in_tool_call, self._current_tool_name, self._pending_key, self._streaming_string_value. |
#L152-L157 |
PoolsideV1ToolParser._delta |
method | PoolsideV1ToolParser._delta(pending: dict[int, dict[str, Any]], *, name: str \| None = None, arguments: str = '') -> None |
Method PoolsideV1ToolParser._delta calls pending.setdefault; returns None. |
#L159-L179 |
PoolsideV1ToolParser._argument_prefix |
method | PoolsideV1ToolParser._argument_prefix(key: str) -> str \| None |
Method PoolsideV1ToolParser._argument_prefix calls seen.add, json.dumps; has 2 explicit return paths. |
#L181-L188 |
PoolsideV1ToolParser._close_arguments |
method | PoolsideV1ToolParser._close_arguments() -> str |
Method PoolsideV1ToolParser._close_arguments has 2 explicit return paths. |
#L190-L194 |
PoolsideV1ToolParser._discard_through_tool_end |
method | PoolsideV1ToolParser._discard_through_tool_end() -> bool |
Method PoolsideV1ToolParser._discard_through_tool_end updates self._buffer; calls self._buffer.find, len, self._finish_tool_call; has 2 explicit return paths. |
#L196-L202 |
PoolsideV1ToolParser._consume_text_before_tool |
method | PoolsideV1ToolParser._consume_text_before_tool() -> tuple[bool, str] |
Consume plain text or enter the next <tool_call> state. |
#L204-L214 |
PoolsideV1ToolParser._consume_tool_name |
method | PoolsideV1ToolParser._consume_tool_name(pending: dict[int, dict[str, Any]], valid_names: set[str]) -> bool |
Consume a tool name, or wait for enough input to identify it. | #L216-L247 |
PoolsideV1ToolParser._consume_string_value |
method | PoolsideV1ToolParser._consume_string_value(pending: dict[int, dict[str, Any]]) -> bool |
Consume a string argument value, retaining incomplete suffixes. | #L249-L267 |
PoolsideV1ToolParser._consume_pending_key |
method | PoolsideV1ToolParser._consume_pending_key(pending: dict[int, dict[str, Any]], request: dict[str, Any] \| None) -> bool |
Consume the value for the currently buffered argument key. | #L269-L305 |
PoolsideV1ToolParser._consume_tool_body |
method | PoolsideV1ToolParser._consume_tool_body(pending: dict[int, dict[str, Any]]) -> bool |
Consume an argument key or close the current tool call. | #L307-L328 |
PoolsideV1ToolParser.extract_tool_calls_streaming |
method | PoolsideV1ToolParser.extract_tool_calls_streaming(previous_text: str, current_text: str, delta_text: str, previous_token_ids: Sequence[int] \| None = None, current_token_ids: Sequence[int] \| None = None, delta_token_ids: Sequence[int] \| None = None, request: dict[str, Any] \| None = None) -> dict[str, Any] \| None |
Incrementally emit Laguna content and schema-aware tool arguments. | #L330-L362 |