xtekky/gpt4free · error · RuntimeError

No response received

Error message

No response received

What it means

Error "No response received" thrown in xtekky/gpt4free.

Source

Thrown at g4f/cli/client.py:166

    text_response = ""
    if media_chunk:
        text_response = (
            response_tokens[0]
            if len(response_tokens) == 1
            else "".join(str(t) for t in response_tokens)
        )
    else:
        text_response = "".join(str(t) for t in response_tokens)

    if output_file:
        if await save_content(text_response, media_chunk, str(output_file)):
            print(f"\n→ Response saved to '{output_file}'")

    if text_response:
        if not media_chunk:
            conversation.add_message("assistant", text_response)
    else:
        raise RuntimeError("No response received")


async def save_content(
    content, media: Optional["MediaResponse"], filepath: str, allowed_types=None
) -> bool:
    global aiohttp
    if media:
        for url in media.get_list():
            if url.startswith(("http://", "https://")):
                try:
                    if aiohttp is None:
                        import aiohttp
                    async with aiohttp.ClientSession(
                        cookies=media.get("cookies"), headers=media.get("headers")
                    ) as session:
                        async with session.get(url) as resp:
                            if resp.status == 200:
                                with open(filepath, "wb") as f:

View on GitHub (pinned to 973504e177)

Solutions

  1. Retry the request.
  2. Verify the provider is reachable and the network connection is up.

When it happens

Trigger: Thrown at g4f/cli/client.py:166 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of xtekky/gpt4free@973504e177 (2026-08-14). Data as JSON: /api/errors/de71e2ef6730c331. Report an issue: GitHub.