summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/RubiksAI.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-11-20 19:58:16 +0100
committerGitHub <noreply@github.com>2024-11-20 19:58:16 +0100
commitffb4b0d162cc29b1caa4539d854de37206804225 (patch)
treeea565c46ed908d2a6b4ef3fef1f100e68428aec3 /g4f/Provider/RubiksAI.py
parentUpdate api.py (diff)
downloadgpt4free-ffb4b0d162cc29b1caa4539d854de37206804225.tar
gpt4free-ffb4b0d162cc29b1caa4539d854de37206804225.tar.gz
gpt4free-ffb4b0d162cc29b1caa4539d854de37206804225.tar.bz2
gpt4free-ffb4b0d162cc29b1caa4539d854de37206804225.tar.lz
gpt4free-ffb4b0d162cc29b1caa4539d854de37206804225.tar.xz
gpt4free-ffb4b0d162cc29b1caa4539d854de37206804225.tar.zst
gpt4free-ffb4b0d162cc29b1caa4539d854de37206804225.zip
Diffstat (limited to 'g4f/Provider/RubiksAI.py')
-rw-r--r--g4f/Provider/RubiksAI.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/g4f/Provider/RubiksAI.py b/g4f/Provider/RubiksAI.py
index c06e6c3d..816ea60c 100644
--- a/g4f/Provider/RubiksAI.py
+++ b/g4f/Provider/RubiksAI.py
@@ -9,7 +9,7 @@ from urllib.parse import urlencode
from aiohttp import ClientSession
from ..typing import AsyncResult, Messages
-from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
+from .base_provider import AsyncGeneratorProvider, ProviderModelMixin, Sources
from ..requests.raise_for_status import raise_for_status
class RubiksAI(AsyncGeneratorProvider, ProviderModelMixin):
@@ -23,7 +23,6 @@ class RubiksAI(AsyncGeneratorProvider, ProviderModelMixin):
default_model = 'gpt-4o-mini'
models = [default_model, 'gpt-4o', 'o1-mini', 'claude-3.5-sonnet', 'grok-beta', 'gemini-1.5-pro', 'nova-pro']
-
model_aliases = {
"llama-3.1-70b": "llama-3.1-70b-versatile",
}
@@ -118,7 +117,7 @@ class RubiksAI(AsyncGeneratorProvider, ProviderModelMixin):
if 'url' in json_data and 'title' in json_data:
if web_search:
- sources.append({'title': json_data['title'], 'url': json_data['url']})
+ sources.append(json_data)
elif 'choices' in json_data:
for choice in json_data['choices']:
@@ -128,5 +127,4 @@ class RubiksAI(AsyncGeneratorProvider, ProviderModelMixin):
yield content
if web_search and sources:
- sources_text = '\n'.join([f"{i+1}. [{s['title']}]: {s['url']}" for i, s in enumerate(sources)])
- yield f"\n\n**Source:**\n{sources_text}" \ No newline at end of file
+ yield Sources(sources) \ No newline at end of file