feat: add spark v2 support (#885)

This commit is contained in:
takatost 2023-08-17 15:08:57 +08:00 • committed by GitHub
commit f42e7d1a61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 7 deletions

View file

@ -1,5 +1,4 @@
import decimal
from functools import wraps
from typing import List, Optional, Any
from langchain.callbacks.manager import Callbacks
@ -19,6 +18,7 @@ class SparkModel(BaseLLM):
def _init_client(self) -> Any:
provider_model_kwargs = self._to_model_kwargs_input(self.model_rules, self.model_kwargs)
return ChatSpark(
model_name=self.name,
streaming=self.streaming,
callbacks=self.callbacks,
**self.credentials,

View file

@ -29,7 +29,11 @@ class SparkProvider(BaseModelProvider):
return [
{
'id': 'spark',
'name': '星火认知大模型',
'name': 'Spark V1.5',
},
{
'id': 'spark-v2',
'name': 'Spark V2.0',
}
]
else: