From d116f043227f789d6582bc12f69ea4ee7a9330ea Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Mon, 2 Oct 2023 06:47:07 +0200 Subject: Fix: There is no current event loop in thread --- g4f/Provider/AItianhuSpace.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'g4f/Provider/AItianhuSpace.py') diff --git a/g4f/Provider/AItianhuSpace.py b/g4f/Provider/AItianhuSpace.py index 8805b1c0..a6bf9a58 100644 --- a/g4f/Provider/AItianhuSpace.py +++ b/g4f/Provider/AItianhuSpace.py @@ -2,6 +2,7 @@ from __future__ import annotations import random, json +from ..typing import AsyncGenerator from ..requests import StreamSession from .base_provider import AsyncGeneratorProvider, format_prompt @@ -22,7 +23,7 @@ class AItianhuSpace(AsyncGeneratorProvider): messages: list[dict[str, str]], stream: bool = True, **kwargs - ) -> str: + ) -> AsyncGenerator: if not model: model = "gpt-3.5-turbo" elif not model in domains: -- cgit v1.2.3