mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-15 14:51:19 -08:00
Add audio transcribing example and support
Add Grok Chat provider Rename images parameter to media Update demo homepage
This commit is contained in:
parent
10d32a4c5f
commit
c97ba0c88e
36 changed files with 407 additions and 300 deletions
|
|
@ -34,12 +34,14 @@ class ChatCompletion:
|
|||
ignore_stream: bool = False,
|
||||
**kwargs) -> Union[CreateResult, str]:
|
||||
if image is not None:
|
||||
kwargs["images"] = [(image, image_name)]
|
||||
kwargs["media"] = [(image, image_name)]
|
||||
elif "images" in kwargs:
|
||||
kwargs["media"] = kwargs.pop("images")
|
||||
model, provider = get_model_and_provider(
|
||||
model, provider, stream,
|
||||
ignore_working,
|
||||
ignore_stream,
|
||||
has_images="images" in kwargs,
|
||||
has_images="media" in kwargs,
|
||||
)
|
||||
if "proxy" not in kwargs:
|
||||
proxy = os.environ.get("G4F_PROXY")
|
||||
|
|
@ -63,8 +65,10 @@ class ChatCompletion:
|
|||
ignore_working: bool = False,
|
||||
**kwargs) -> Union[AsyncResult, Coroutine[str]]:
|
||||
if image is not None:
|
||||
kwargs["images"] = [(image, image_name)]
|
||||
model, provider = get_model_and_provider(model, provider, False, ignore_working, has_images="images" in kwargs)
|
||||
kwargs["media"] = [(image, image_name)]
|
||||
elif "images" in kwargs:
|
||||
kwargs["media"] = kwargs.pop("images")
|
||||
model, provider = get_model_and_provider(model, provider, False, ignore_working, has_images="media" in kwargs)
|
||||
if "proxy" not in kwargs:
|
||||
proxy = os.environ.get("G4F_PROXY")
|
||||
if proxy:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue