summaryrefslogtreecommitdiffstats
path: root/etc/unittest/integration.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-12 18:01:54 +0200
committerGitHub <noreply@github.com>2024-04-12 18:01:54 +0200
commit0b712c2bde77fe7e3e347d71d5de3c9e62f26738 (patch)
treebd93b8b64705c74be6feff9cc2f7cba7837c8da8 /etc/unittest/integration.py
parentMerge pull request #1825 from hlohaus/ws (diff)
downloadgpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar
gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar.gz
gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar.bz2
gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar.lz
gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar.xz
gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar.zst
gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.zip
Diffstat (limited to 'etc/unittest/integration.py')
-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"})