feat: add spark v2 support (#885)

This commit is contained in:
takatost
2023-08-17 15:08:57 +08:00
committed by GitHub
parent c4d759dfba
commit f42e7d1a61
5 changed files with 31 additions and 7 deletions

View File

@@ -25,6 +25,7 @@ class ChatSpark(BaseChatModel):
.. code-block:: python
client = SparkLLMClient(
model_name="<model_name>",
app_id="<app_id>",
api_key="<api_key>",
api_secret="<api_secret>"
@@ -32,6 +33,9 @@ class ChatSpark(BaseChatModel):
"""
client: Any = None #: :meta private:
model_name: str = "spark"
"""The Spark model name."""
max_tokens: int = 256
"""Denotes the number of tokens to predict per generation."""
@@ -66,6 +70,7 @@ class ChatSpark(BaseChatModel):
)
values["client"] = SparkLLMClient(
model_name=values["model_name"],
app_id=values["app_id"],
api_key=values["api_key"],
api_secret=values["api_secret"],