mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Add streaming and system messages support in Airforce
This commit is contained in:
parent
a591c5d409
commit
315a2f2595
7 changed files with 140 additions and 139 deletions
|
|
@ -120,11 +120,11 @@ class Api:
|
|||
}
|
||||
|
||||
def _create_response_stream(self, kwargs: dict, conversation_id: str, provider: str, download_images: bool = True) -> Iterator:
|
||||
def log_handler(text: str):
|
||||
def decorated_log(text: str):
|
||||
debug.logs.append(text)
|
||||
if debug.logging:
|
||||
print(text)
|
||||
debug.log_handler = log_handler
|
||||
debug.log_handler(text)
|
||||
debug.log = decorated_log
|
||||
proxy = os.environ.get("G4F_PROXY")
|
||||
provider = kwargs.get("provider")
|
||||
model, provider_handler = get_model_and_provider(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue