feat: add spark v2 support (#885)
This commit is contained in:
parent
c4d759dfba
commit
f42e7d1a61
5 changed files with 31 additions and 7 deletions
5
api/core/third_party/langchain/llms/spark.py
vendored
5
api/core/third_party/langchain/llms/spark.py
vendored
|
|
@ -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"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue