summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--LEGAL_NOTICE.md41
-rw-r--r--README.md31
-rw-r--r--docker/Dockerfile3
-rw-r--r--g4f/Provider/Chatgpt4Online.py4
-rw-r--r--g4f/models.py30
5 files changed, 96 insertions, 13 deletions
diff --git a/LEGAL_NOTICE.md b/LEGAL_NOTICE.md
index 910ecd61..a2d0806c 100644
--- a/LEGAL_NOTICE.md
+++ b/LEGAL_NOTICE.md
@@ -4,12 +4,43 @@ This repository is _not_ associated with or endorsed by providers of the APIs co
Please note the following:
-1. **Disclaimer**: The APIs, services, and trademarks mentioned in this repository belong to their respective owners. This project is _not_ claiming any rights over them nor is it affiliated with or endorsed by any of the providers mentioned.
+## Legal Notice
+
+### **Affiliation Disclaimer**
+This repository is not associated with or endorsed by the providers of the APIs contained in this repository. The project is intended for educational purposes only. The APIs, services, trademarks, and other intellectual property mentioned in this repository are the property of their respective owners, with no claim of ownership or affiliation by this project.
+
+### **Liability Limitation**
+Under no circumstances shall the author of this repository be liable for any direct, indirect, incidental, special, consequential, or punitive damages, including but not limited to, loss of profits, data, or use, arising out of or in connection with the repository, regardless of whether such damages were foreseeable and whether the author was advised of the possibility of such damages.
+
+### **No Warranties**
+The repository is provided on an "as is" and "as available" basis without any warranties of any kind, either express or implied, including but not limited to, implied warranties of merchantability, fitness for a particular purpose, or non-infringement.
+
+### **User Responsibility**
+Users assume all risk for their use of this repository and are solely responsible for any damage or loss, including but not limited to financial loss, of any kind, to any party, that results from the use or misuse of the repository and its contents.
+
+### **Legal Compliance**
+Users are responsible for ensuring their use of the repository and its contents complies with all local, state, national, and international laws and regulations.
+
+### **Indemnification**
+Users agree to indemnify, defend, and hold harmless the author from any claims, liabilities, damages, losses, or expenses, including legal fees, arising out of or in any way connected with their use of this repository, violation of these terms, or infringement of any intellectual property or other rights of any person or entity.
+
+### **No Endorsement**
+The inclusion of third-party content does not imply endorsement or recommendation of such content by the author.
+
+### **Governing Law and Jurisdiction**
+Any disputes arising out of or related to the use of this repository shall be governed by the laws of the author's jurisdiction, without regard to its conflict of law principles.
+
+### **Severability**
+If any provision of this notice is found to be unlawful, void, or unenforceable, then that provision shall be deemed severable from this notice and shall not affect the validity and enforceability of any remaining provisions.
-2. **Responsibility**: The author of this repository is _not_ responsible for any consequences, damages, or losses arising from the use or misuse of this repository or the content provided by the third-party APIs. Users are solely responsible for their actions and any repercussions that may follow. We strongly recommend the users to follow the TOS of each Website.
+### **Acknowledgment of Understanding**
+By using this repository, users acknowledge that they have read, understood, and agree to be bound by these terms.
-3. **Educational Purposes Only**: This repository and its content are provided strictly for educational purposes. By using the information and code provided, users acknowledge that they are using the APIs and models at their own risk and agree to comply with any applicable laws and regulations.
+### **Updates and Changes**
+The author reserves the right to modify, update, or remove any content, information, or features in this repository at any time without prior notice. Users are responsible for regularly reviewing the content and any changes made to this repository.
-4. **Indemnification**: Users agree to indemnify, defend, and hold harmless the author of this repository from and against any and all claims, liabilities, damages, losses, or expenses, including legal fees and costs, arising out of or in any way connected with their use or misuse of this repository, its content, or related third-party APIs.
+### **Unforeseen Consequences**
+The author of this repository is not responsible for any consequences, damages, or losses arising from the use or misuse of this repository or the content provided by the third-party APIs. Users are solely responsible for their actions and any repercussions that may follow.
-5. **Updates and Changes**: The author reserves the right to modify, update, or remove any content, information, or features in this repository at any time without prior notice. Users are responsible for regularly reviewing the content and any changes made to this repository.
+### **Educational Purpose**
+Please note that this project and its content are provided strictly for educational purposes. Users acknowledge that they are using the APIs and models at their own risk and agree to comply with any applicable laws and regulations.
diff --git a/README.md b/README.md
index f54750d6..a4365e09 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,17 @@ pip install -U g4f
```sh
docker pull hlohaus789/g4f
```
+# To do
+As per the survey, here is a list of improvements to come
+- [ ] Improve Documentation (on g4f.mintlify.app) & Do video tutorials
+- [ ] Improve the provider status list & updates
+- [ ] Tutorials on how to reverse sites to write your own wrapper (PoC only ofc)
+- [ ] Improve the Bing wrapper. (might write a new wrapper in golang as it is very fast)
+- [ ] Write a standard provider performance test to improve the stability
+- [ ] update the repository to include the new openai library syntax (ex: `Openai()` class)
+- [ ] Potential support and development of local models
+- [ ] improve compatibility and error handling
+
## 🆕 What's New
- <a href="./README-DE.md"><img src="https://img.shields.io/badge/öffnen in-🇩🇪 deutsch-bleu.svg" alt="Öffnen en DE"></a>
@@ -416,6 +427,26 @@ if __name__ == "__main__":
main()
```
+## API usage (POST)
+#### Chat completions
+Send the POST request to /v1/chat/completions with body containing the `model` method. This example uses python with requests library:
+```python
+import requests
+url = "http://localhost:1337/v1/chat/completions"
+body = {
+ "model": "gpt-3.5-turbo-16k",
+ "stream": False,
+ "messages": [
+ {"role": "assistant", "content": "What can you do?"}
+ ]
+}
+json_response = requests.post(url, json=body).json().get('choices', [])
+
+for choice in json_response:
+ print(choice.get('message', {}).get('content', ''))
+```
+
+
## 🚀 Providers and Models
### GPT-4
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 88e21b18..294e1372 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -86,5 +86,6 @@ RUN pip install --upgrade pip && pip install -r requirements.txt
# Copy the entire package into the container.
ADD --chown=$G4F_USER:$G4F_USER g4f $G4F_DIR/g4f
+
# Expose ports
-EXPOSE 8080 1337 \ No newline at end of file
+EXPOSE 8080 1337
diff --git a/g4f/Provider/Chatgpt4Online.py b/g4f/Provider/Chatgpt4Online.py
index c2c66fd8..4135ec9d 100644
--- a/g4f/Provider/Chatgpt4Online.py
+++ b/g4f/Provider/Chatgpt4Online.py
@@ -12,7 +12,7 @@ class Chatgpt4Online(AsyncGeneratorProvider):
url = "https://chatgpt4online.org"
supports_message_history = True
supports_gpt_35_turbo = True
- working = True
+ working = False # cloudfare block !
_wpnonce = None
@classmethod
@@ -73,4 +73,4 @@ class Chatgpt4Online(AsyncGeneratorProvider):
elif line["type"] == "live":
yield line["data"]
elif line["type"] == "end":
- break \ No newline at end of file
+ break
diff --git a/g4f/models.py b/g4f/models.py
index e0d6121d..e58ccef2 100644
--- a/g4f/models.py
+++ b/g4f/models.py
@@ -120,10 +120,10 @@ llama2_70b = Model(
codellama_34b_instruct = Model(
name = "codellama/CodeLlama-34b-Instruct-hf",
base_provider = "huggingface",
- best_provider = RetryProvider([HuggingChat, PerplexityLabs])
+ best_provider = RetryProvider([HuggingChat, PerplexityLabs, DeepInfra])
)
-# Mistal
+# Mistral
mixtral_8x7b = Model(
name = "mistralai/Mixtral-8x7B-Instruct-v0.1",
base_provider = "huggingface",
@@ -136,14 +136,31 @@ mistral_7b = Model(
best_provider = RetryProvider([DeepInfra, HuggingChat, PerplexityLabs])
)
-# Dolphin
+# Misc models
dolphin_mixtral_8x7b = Model(
name = "cognitivecomputations/dolphin-2.6-mixtral-8x7b",
base_provider = "huggingface",
best_provider = DeepInfra
)
-# OpenChat
+lzlv_70b = Model(
+ name = "lizpreciatior/lzlv_70b_fp16_hf",
+ base_provider = "huggingface",
+ best_provider = DeepInfra
+)
+
+airoboros_70b = Model(
+ name = "deepinfra/airoboros-70b",
+ base_provider = "huggingface",
+ best_provider = DeepInfra
+)
+
+airoboros_l2_70b = Model(
+ name = "jondurbin/airoboros-l2-70b-gpt4-1.4.1",
+ base_provider = "huggingface",
+ best_provider = DeepInfra
+)
+
openchat_35 = Model(
name = "openchat/openchat_3.5",
base_provider = "huggingface",
@@ -243,6 +260,9 @@ class ModelUtils:
'mixtral-8x7b': mixtral_8x7b,
'mistral-7b': mistral_7b,
'dolphin-mixtral-8x7b': dolphin_mixtral_8x7b,
+ 'lzlv-70b': lzlv_70b,
+ 'airoboros-70b': airoboros_70b,
+ 'airoboros-l2-70b': airoboros_l2_70b,
'openchat_3.5': openchat_35,
'gemini-pro': gemini_pro,
'bard': bard,
@@ -250,4 +270,4 @@ class ModelUtils:
'pi': pi
}
-_all_models = list(ModelUtils.convert.keys())
+_all_models = list(ModelUtils.convert.keys()) \ No newline at end of file