diff --git a/client/html/index.html b/client/html/index.html index 8272cd89..f885531e 100644 --- a/client/html/index.html +++ b/client/html/index.html @@ -111,22 +111,10 @@ - - - - - - - - - - - - diff --git a/g4f/Provider/Providers/Chimera.py b/g4f/Provider/Providers/Chimera.py index 0f5782f9..0fc1f275 100644 --- a/g4f/Provider/Providers/Chimera.py +++ b/g4f/Provider/Providers/Chimera.py @@ -13,30 +13,19 @@ model = [ 'gpt-3.5-turbo', 'gpt-3.5-turbo-0301', - 'gpt-3.5-turbo-poe', - 'gpt-3.5-turbo-openai', 'gpt-3.5-turbo-16k', - 'gpt-3.5-turbo-16k-openai', - 'gpt-3.5-turbo-16k-poe', 'gpt-4', 'gpt-4-0314', - 'gpt-4-poe', 'gpt-4-32k', - 'gpt-4-32k-poe', - 'claude_instant', - 'claude-instant-100k', - 'claude-2-100k', - 'llama-2-7b-chat' + 'llama-2-7b-chat', 'llama-2-13b-chat', 'llama-2-70b-chat', - 'sage' ] - supports_stream = True needs_auth = False -def _create_completion(api_key: str, model: str, messages: list, stream: bool, **kwargs): +def _create_completion(model: str, messages: list, stream: bool, api_key: str = None, **kwargs): openai.api_key = api_key if api_key else api_key_env @@ -47,9 +36,12 @@ def _create_completion(api_key: str, model: str, messages: list, stream: bool, * stream=stream ) - for chunk in response: - yield chunk.choices[0].delta.get("content", "") - + if (stream): + for chunk in response: + yield chunk.choices[0].delta.get("content", "") + else: + yield response.choices[0].message.get("content", "") + except openai.error.APIError as e: detail_pattern = re.compile(r'{"detail":"(.*?)"}') match = detail_pattern.search(e.user_message) @@ -62,7 +54,6 @@ def _create_completion(api_key: str, model: str, messages: list, stream: bool, * yield e.user_message - params = f'g4f.Providers.{os.path.basename(__file__)[:-3]} supports: ' + \ '(%s)' % ', '.join( [f"{name}: {get_type_hints(_create_completion)[name].__name__}" for name in _create_completion.__code__.co_varnames[:_create_completion.__code__.co_argcount]])