diff options
-rw-r--r-- | CONTRIBUTING.md | 2 | ||||
-rw-r--r-- | README.md | 13 | ||||
-rw-r--r-- | docs/guides/create_provider.md | 4 | ||||
-rw-r--r-- | g4f/Provider/You.py | 6 |
4 files changed, 14 insertions, 11 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d5f6615f..2ccd080d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,6 +3,6 @@ ### Please, follow these steps to contribute: 1. Reverse a website from this list: [sites-to-reverse](https://github.com/xtekky/gpt4free/issues/40) 2. Add it to [./testing](https://github.com/xtekky/gpt4free/tree/main/testing) -3. Refractor it and add it to [./g4f](https://github.com/xtekky/gpt4free/tree/main/g4f) +3. Refactor it and add it to [./g4f](https://github.com/xtekky/gpt4free/tree/main/g4f) ### We will be grateful to see you as a contributor!
\ No newline at end of file @@ -418,17 +418,14 @@ While we wait for gpt-5, here is a list of new models that are at least better t | You.com | `g4f.Provider.You` | dall-e-3| ✔️ | [you.com](https://you.com) | ```python +import requests from g4f.client import Client -from g4f.Provider.GeminiPro import GeminiPro -client = Client( - api_key="...", - provider=GeminiPro -) -image = requests.get("https://example.jpg", stream=True).raw +client = Client() +image = requests.get("https://change_me.jpg", stream=True).raw response = client.chat.completions.create( - model="gemini-pro-vision", - messages=[{"role": "user", "content": "What are on this image?"}], + "", + messages=[{"role": "user", "content": "what is in this picture?"}], image=image ) print(response.choices[0].message.content) diff --git a/docs/guides/create_provider.md b/docs/guides/create_provider.md index e2e1ab6a..2be12735 100644 --- a/docs/guides/create_provider.md +++ b/docs/guides/create_provider.md @@ -12,7 +12,7 @@ python -m etc.tool.create_provider #### Create Provider 1. Check out the current [list of potential providers](https://github.com/zukixa/cool-ai-stuff#ai-chat-websites), or find your own provider source! -2. Create a new file in [g4f/Provider](/g4f/Provider) with the name of the Provider +2. Create a new file in [g4f/Provider](/g4f/Provider) with the name of the Provider. 3. Implement a class that extends [BaseProvider](/g4f/providers/base_provider.py). ```py @@ -38,7 +38,7 @@ class HogeService(AsyncGeneratorProvider): ``` 4. Here, you can adjust the settings, for example, if the website does support streaming, set `supports_stream` to `True`... -5. Write code to request the provider in `create_async_generator` and `yield` the response, _even if_ it's a one-time response, do not hesitate to look at other providers for inspiration +5. Write code to request the provider in `create_async_generator` and `yield` the response, _even if_ it's a one-time response, do not hesitate to look at other providers for inspiration. 6. Add the Provider Import in [`g4f/Provider/__init__.py`](./g4f/Provider/__init__.py) ```py diff --git a/g4f/Provider/You.py b/g4f/Provider/You.py index a9e7834c..e7958f71 100644 --- a/g4f/Provider/You.py +++ b/g4f/Provider/You.py @@ -30,7 +30,13 @@ class You(AsyncGeneratorProvider, ProviderModelMixin): "claude-2", "claude-3-opus", "claude-3-sonnet", + "claude-3-haiku", "gemini-pro", + "gemini-1-5-pro", + "databricks-dbrx-instruct", + "command-r", + "command-r-plus", + "llama3", "zephyr", default_vision_model, *image_models |