From 0a0698c7f3fa117e95eaf9b017e4122d15ef4566 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Wed, 21 Feb 2024 17:02:54 +0100 Subject: Update docs / readme, Improve Gemini auth --- docs/leagcy.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'docs/leagcy.md') diff --git a/docs/leagcy.md b/docs/leagcy.md index 224bc098..e8808381 100644 --- a/docs/leagcy.md +++ b/docs/leagcy.md @@ -179,4 +179,22 @@ async def run_all(): asyncio.run(run_all()) ``` +##### Proxy and Timeout Support + +All providers support specifying a proxy and increasing timeout in the create functions. + +```python +import g4f + +response = g4f.ChatCompletion.create( + model=g4f.models.default, + messages=[{"role": "user", "content": "Hello"}], + proxy="http://host:port", + # or socks5://user:pass@host:port + timeout=120, # in secs +) + +print(f"Result:", response) +``` + [Return to Home](/) \ No newline at end of file -- cgit v1.2.3