mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-09-12 00:29:27 -04:00
Fix: Aivvm: KeyError: ''
and TypeError: issubclass() arg 1 must be a class
This commit is contained in:
parent
bf78b4d033
commit
4edd7518de
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .base_provider import BaseProvider
|
from .base_provider import BaseProvider
|
||||||
from ..typing import Any, CreateResult
|
from ..typing import CreateResult
|
||||||
|
|
||||||
models = {
|
models = {
|
||||||
'gpt-3.5-turbo': {'id': 'gpt-3.5-turbo', 'name': 'GPT-3.5'},
|
'gpt-3.5-turbo': {'id': 'gpt-3.5-turbo', 'name': 'GPT-3.5'},
|
||||||
@ -26,8 +26,14 @@ class Aivvm(BaseProvider):
|
|||||||
def create_completion(cls,
|
def create_completion(cls,
|
||||||
model: str,
|
model: str,
|
||||||
messages: list[dict[str, str]],
|
messages: list[dict[str, str]],
|
||||||
stream: bool, **kwargs: Any) -> CreateResult:
|
stream: bool,
|
||||||
|
**kwargs
|
||||||
|
) -> CreateResult:
|
||||||
|
if not model:
|
||||||
|
model = "gpt-3.5-turbo"
|
||||||
|
elif model not in models:
|
||||||
|
raise ValueError(f"Model are not supported: {model}")
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
"authority" : "chat.aivvm.com",
|
"authority" : "chat.aivvm.com",
|
||||||
"accept" : "*/*",
|
"accept" : "*/*",
|
||||||
|
@ -24,7 +24,7 @@ from .Provider import (
|
|||||||
class Model:
|
class Model:
|
||||||
name: str
|
name: str
|
||||||
base_provider: str
|
base_provider: str
|
||||||
best_provider: Union[type[BaseProvider], tuple[type[BaseProvider]]] = None
|
best_provider: Union[type[BaseProvider], RetryProvider] = None
|
||||||
|
|
||||||
# Config for HuggingChat, OpenAssistant
|
# Config for HuggingChat, OpenAssistant
|
||||||
# Works for Liaobots, H2o, OpenaiChat, Yqcloud, You
|
# Works for Liaobots, H2o, OpenaiChat, Yqcloud, You
|
||||||
|
Loading…
Reference in New Issue
Block a user