mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-22 02:45:49 +00:00
fix(deepseek): Deep Seek Model for LS Tracing (#32575)
- **Description:** Fix for LS Tracing for Provider for DeepSeek. - **Issue:** #32484 --------- Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
parent
4fb1132e30
commit
00259b0061
@ -11,7 +11,7 @@ import openai
|
||||
from langchain_core.callbacks import (
|
||||
CallbackManagerForLLMRun,
|
||||
)
|
||||
from langchain_core.language_models import LanguageModelInput
|
||||
from langchain_core.language_models import LangSmithParams, LanguageModelInput
|
||||
from langchain_core.messages import AIMessageChunk, BaseMessage
|
||||
from langchain_core.outputs import ChatGenerationChunk, ChatResult
|
||||
from langchain_core.runnables import Runnable
|
||||
@ -186,6 +186,15 @@ class ChatDeepSeek(BaseChatOpenAI):
|
||||
"""A map of constructor argument names to secret ids."""
|
||||
return {"api_key": "DEEPSEEK_API_KEY"}
|
||||
|
||||
def _get_ls_params(
|
||||
self,
|
||||
stop: Optional[list[str]] = None,
|
||||
**kwargs: Any,
|
||||
) -> LangSmithParams:
|
||||
ls_params = super()._get_ls_params(stop=stop, **kwargs)
|
||||
ls_params["ls_provider"] = "deepseek"
|
||||
return ls_params
|
||||
|
||||
@model_validator(mode="after")
|
||||
def validate_environment(self) -> Self:
|
||||
if self.api_base == DEFAULT_API_BASE and not (
|
||||
|
Loading…
Reference in New Issue
Block a user