BaseChannel.send_response docstring promises async-generator streaming that four of the five channels raise TypeError on
Los mantenedores suelen responder en 5 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 50/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- documentation
Línea de trabajo
The docstring to change is BaseChannel.send_response in src/tac/channels/base.py (lines 90-105), which says it supports async-generator streaming unconditionally. Compare it with the Raises: block in MessagingChannel.send_response in src/tac/channels/messaging.py (lines 208-220), and check voice/provider.py:95 for the per-provider behaviour. Done means the base docstring no longer promises generators on every channel. The issue says the exact wording is the maintainers' call, so confirm it with them before editing.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
BaseChannel.send_response's docstring states that generator streaming is supported, with no qualification. Four of the five concrete channels raise TypeError when given one.
The docstring one file over — MessagingChannel.send_response — already states the restriction correctly, including a Raises: block. So this is an internal contradiction with the fix already drafted in your own source, rather than a request for new documentation.
All line references are at 2c24bd98, read 2026-10-09.
The abstract base asserts it unconditionally
src/tac/channels/base.py:90-105:
@abstractmethod
async def send_response(
self,
conversation_id: str,
response: str | AsyncGenerator[str | dict[str, Any], None],
role: str | None = None,
) -> None:
"""
Send response back through the channel.
Supports both simple string responses and streaming via async generators.
...
Four of five channels raise
src/tac/channels/messaging.py:218-220:
channel_name = self.get_channel_name()
if not isinstance(response, str):
raise TypeError(f"{channel_name} channel only supports string responses")
SMSChannel, RCSChannel, WhatsAppChannel and ChatChannel all subclass MessagingChannel, and none of them overrides send_response — measured over every file under src/tac/channels/, which contains exactly two channel-level send_response definitions (the abstract one in base.py and the concrete one in messaging.py) plus voice/channel.py's delegation.
So the type and the base docstring both advertise a parameter shape that raises on four of the five channels a user can reach.
The correct wording already exists in this repo
src/tac/channels/messaging.py:208-215 — same method, overriding class:
response: Message content. Must be
str— messaging channels send a single complete message via the Conversation Orchestrator Send API and do not support streaming (unlike the Voice channel).Raises:
TypeError: If response is not a string (e.g. an async generator is passed, since messaging channels don't support streaming)
That is accurate, and it is the text the base class is missing.
Suggested change
Qualify base.py:99 so the base does not promise what most implementations refuse — for example:
Supports simple string responses on every channel. Streaming via async generators is supported only where the channel's provider implements it;
MessagingChanneland its subclasses raiseTypeErrorfor a generator, and voice support depends on the configured provider.
A narrower variant, if you would rather not describe subclass behaviour in the base: drop the "Supports both ..." sentence and point at the implementing class.
One related observation, offered rather than asserted as a defect
Voice support is also per-provider rather than per-channel, so "streaming is a voice capability" is not quite the invariant either. VoiceChannel.send_response (voice/channel.py:502) delegates to its provider; voice/provider.py:95 raises NotImplementedError by default, and media_streams/shared/openai_provider.py:223-233 raises for a string and a generator, with a clear reason in its docstring ("the model streams audio to Twilio directly, so there is no text response for this provider to send").
That design seems deliberate and reads well — mentioning it only because any rewording of the base docstring will want to account for it.
Why an issue and not a pull request
These are docstrings in hand-written source, so a PR would be mechanically simple. Filing as an issue because the right wording is a judgement about what the base class means to promise, which is yours rather than ours.
Context
We maintain a cross-provider specification of the TAC response-streaming contract and read connector source to verify each claim in it. This came out of promoting that document's unverified assertions to quoted-source ones, and the original claim — that a connector satisfies TAC by returning a string or an async generator — turned out to be the one that did not survive.
- Lenguaje dominante
- Python
- Estrellas
- 17
- Forks
- 11
- Merge medio
- 5 d 19 h
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de twilio/twilio-agent-connect-python
-
ParticipantResponse.name is required where the API definition marks it nullable, so a nameless participant fails to parsePosiblemente ocupada @TheeCoderAhmed la tomó hace 22 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
twilio/twilio-agent-connect-python#134 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
twilio/twilio-agent-connect-python#135 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
twilio/twilio-agent-connect-python#133 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
twilio/twilio-agent-connect-python#101 ·
Los mantenedores suelen responder en 5 días
-
add tac config validationsPosiblemente ocupada @rahulsjha la tomó hace 4 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
twilio/twilio-agent-connect-python#70 · 1 comentario ·
Los mantenedores suelen responder en 5 días
Todos los issues de twilio/twilio-agent-connect-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Harden tools/pr_threads.sh: pass all printed thread fields through the deterministic sanitizerAbiertoarea:cli area:security enhancement priority:medium size:small
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
RonaldHensbergen/composable-data-stack#1338 ·
Los mantenedores suelen responder en 1 día
-
area:stdlib effort:S impact:med platform:linux type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
automated endpoint-dead needs-curation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
almanac-data/climate-almanac#139 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
UKGovernmentBEIS/inspect_ai#6695 · 1 comentario ·
Los mantenedores suelen responder en 1 día