Spaces:
Runtime error
Runtime error
:pencil: [Doc] Readme: Running example, and proxy feature in progress
Browse files- README.md +6 -0
- docs/bing-chat-api-server.png +0 -0
- utils/enver.py +11 -1
README.md
CHANGED
@@ -35,9 +35,15 @@ Chat with Bing like what you do with OpenAI API.
|
|
35 |
- Support Docker deployment
|
36 |
|
37 |
🔨 In progress:
|
|
|
38 |
- [ ] Enhance performance and reduce session create requests
|
39 |
- [ ] Authentication with API key
|
40 |
|
|
|
|
|
|
|
|
|
|
|
41 |
## Run API service
|
42 |
|
43 |
### Run in Command Line
|
|
|
35 |
- Support Docker deployment
|
36 |
|
37 |
🔨 In progress:
|
38 |
+
- [ ] Use auto proxies to enable create in restricted servers
|
39 |
- [ ] Enhance performance and reduce session create requests
|
40 |
- [ ] Authentication with API key
|
41 |
|
42 |
+
|
43 |
+
## Running Example
|
44 |
+
|
45 |
+
![](docs/bing-chat-api-server.png)
|
46 |
+
|
47 |
## Run API service
|
48 |
|
49 |
### Run in Command Line
|
docs/bing-chat-api-server.png
ADDED
utils/enver.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import json
|
|
|
2 |
import os
|
3 |
|
4 |
from pathlib import Path
|
@@ -42,7 +43,6 @@ class OSEnver:
|
|
42 |
self.envs[proxy_env] = os.getenv("http_proxy")
|
43 |
else:
|
44 |
continue
|
45 |
-
print(f"Using proxy: [{self.envs.get(proxy_env)}]")
|
46 |
|
47 |
self.proxy = (
|
48 |
self.envs.get("all_proxy")
|
@@ -55,5 +55,15 @@ class OSEnver:
|
|
55 |
"https": self.proxy,
|
56 |
}
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
enver = OSEnver()
|
|
|
1 |
import json
|
2 |
+
import requests
|
3 |
import os
|
4 |
|
5 |
from pathlib import Path
|
|
|
43 |
self.envs[proxy_env] = os.getenv("http_proxy")
|
44 |
else:
|
45 |
continue
|
|
|
46 |
|
47 |
self.proxy = (
|
48 |
self.envs.get("all_proxy")
|
|
|
55 |
"https": self.proxy,
|
56 |
}
|
57 |
|
58 |
+
# https://www.proxynova.com/proxy-server-list/country-us/
|
59 |
+
|
60 |
+
print(f"Using proxy: [{self.proxy}]")
|
61 |
+
# r = requests.get(
|
62 |
+
# "http://ifconfig.me/ip",
|
63 |
+
# proxies=self.requests_proxies,
|
64 |
+
# timeout=10,
|
65 |
+
# )
|
66 |
+
# print(f"[r.status_code] r.text")
|
67 |
+
|
68 |
|
69 |
enver = OSEnver()
|