diff --git a/g4f/Provider/PollinationsAI.py b/g4f/Provider/PollinationsAI.py index db6769b8..f2773f84 100644 --- a/g4f/Provider/PollinationsAI.py +++ b/g4f/Provider/PollinationsAI.py @@ -381,7 +381,7 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin): return f"{url}&seed={seed}" if seed else url headers = None - if api_key and (api_key.startswith("g4f_") or api_key.startswith("gfs_")): + if api_key: headers = {"authorization": f"Bearer {api_key}"} async with ClientSession( headers=DEFAULT_HEADERS, diff --git a/g4f/cli/client.py b/g4f/cli/client.py index fb18180d..dae1b08f 100644 --- a/g4f/cli/client.py +++ b/g4f/cli/client.py @@ -152,14 +152,15 @@ async def stream_response( print(f"\n→ Response saved to '{output_file}'") if text_response: - conversation.add_message("assistant", text_response) + if not media_chunk: + conversation.add_message("assistant", text_response) else: raise RuntimeError("No response received") def save_content(content, media: Optional[MediaResponse], filepath: str, allowed_types=None) -> bool: if media: - for url in media.urls: + for url in media.get_list(): if url.startswith(("http://", "https://")): try: resp = requests.get(url, cookies=media.get("cookies"), headers=media.get("headers"))