summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/examples/ecosia.py18
-rw-r--r--etc/unittest/integration.py9
2 files changed, 1 insertions, 26 deletions
diff --git a/etc/examples/ecosia.py b/etc/examples/ecosia.py
deleted file mode 100644
index 5a2ae520..00000000
--- a/etc/examples/ecosia.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import asyncio
-import g4f
-from g4f.client import AsyncClient
-
-async def main():
- client = AsyncClient(
- provider=g4f.Provider.Ecosia,
- )
- async for chunk in client.chat.completions.create(
- [{"role": "user", "content": "happy dogs on work. write some lines"}],
- g4f.models.default,
- stream=True,
- green=True,
- ):
- print(chunk.choices[0].delta.content or "", end="")
- print(f"\nwith {chunk.model}")
-
-asyncio.run(main()) \ No newline at end of file
diff --git a/etc/unittest/integration.py b/etc/unittest/integration.py
index d8fc41d0..af7494e2 100644
--- a/etc/unittest/integration.py
+++ b/etc/unittest/integration.py
@@ -8,7 +8,7 @@ except ImportError:
has_nest_asyncio = False
from g4f.client import Client, ChatCompletion
-from g4f.Provider import Bing, OpenaiChat, DuckDuckGo
+from g4f.Provider import Bing, OpenaiChat
DEFAULT_MESSAGES = [{"role": "system", "content": 'Response in json, Example: {"success": false}'},
{"role": "user", "content": "Say success true in json"}]
@@ -25,13 +25,6 @@ class TestProviderIntegration(unittest.TestCase):
self.assertIsInstance(response, ChatCompletion)
self.assertIn("success", json.loads(response.choices[0].message.content))
- def test_duckduckgo(self):
- self.skipTest("Not working")
- client = Client(provider=DuckDuckGo)
- response = client.chat.completions.create(DEFAULT_MESSAGES, "", response_format={"type": "json_object"})
- self.assertIsInstance(response, ChatCompletion)
- self.assertIn("success", json.loads(response.choices[0].message.content))
-
def test_openai(self):
self.skipTest("not working in this network")
client = Client(provider=OpenaiChat)