summaryrefslogtreecommitdiffstats
path: root/etc/unittest/integration.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--etc/unittest/integration.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/etc/unittest/integration.py b/etc/unittest/integration.py
index f69d4770..d87a7f6b 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
+from g4f.Provider import Bing, OpenaiChat, DuckDuckGo
DEFAULT_MESSAGES = [{"role": "system", "content": 'Response in json, Example: {"success: true"}'},
{"role": "user", "content": "Say success true in json"}]
@@ -19,11 +19,19 @@ class TestProviderIntegration(unittest.TestCase):
self.skipTest("nest_asyncio is not installed")
def test_bing(self):
+ self.skipTest("Not stable")
client = Client(provider=Bing)
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_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):
client = Client(provider=OpenaiChat)
response = client.chat.completions.create(DEFAULT_MESSAGES, "", response_format={"type": "json_object"})