From 86e36efe6bbae10286767b44c6a79913e5199de1 Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Sat, 28 Dec 2024 16:50:08 +0100 Subject: Add Path and PathLike support when uploading images (#2514) * Add Path and PathLike support when uploading images Improve raise_for_status in special cases Move ImageResponse to providers.response module Improve OpenaiChat and OpenaiAccount providers Add Sources for web_search in OpenaiChat Add JsonConversation for import and export conversations to js Add RequestLogin response type Add TitleGeneration support in OpenaiChat and gui * Improve Docker Container Guide in README.md * Add tool calls api support, add search tool support --- g4f/typing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'g4f/typing.py') diff --git a/g4f/typing.py b/g4f/typing.py index 5ea09c6c..027619da 100644 --- a/g4f/typing.py +++ b/g4f/typing.py @@ -1,4 +1,5 @@ import sys +import os from typing import Any, AsyncGenerator, Generator, AsyncIterator, Iterator, NewType, Tuple, Union, List, Dict, Type, IO, Optional try: @@ -19,7 +20,7 @@ CreateResult = Iterator[Union[str, ResponseType]] AsyncResult = AsyncIterator[Union[str, ResponseType]] Messages = List[Dict[str, Union[str, List[Dict[str, Union[str, Dict[str, str]]]]]]] Cookies = Dict[str, str] -ImageType = Union[str, bytes, IO, Image] +ImageType = Union[str, bytes, IO, Image, os.PathLike] ImagesType = List[Tuple[ImageType, Optional[str]]] __all__ = [ -- cgit v1.2.3