Skip to content

Commit f64e224

Browse files
authored
Add support for DeepSeek API in connector_creator
1 parent 49e8121 commit f64e224

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

protollm/connectors/connector_creator.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ def create_llm_connector(model_url: str, *args: Any, **kwargs: Any) -> CustomCha
134134
return ChatRESTServer(model=url_and_name[2], base_url=url_and_name[1], *args, **kwargs)
135135
elif model_url == "test_model":
136136
return CustomChatOpenAI(model_name=model_url, api_key="test")
137+
elif "api.deepseek.com/v1" in model_url or "api.deepseek.com" in model_url:
138+
base_url, model_name = model_url.split(";", 1)
139+
return ChatOpenAI(
140+
base_url=base_url,
141+
model=model_name,
142+
api_key=os.getenv("OPENAI_KEY"),
143+
*args,
144+
**kwargs,
145+
)
137146
else:
138147
raise ValueError("Unsupported provider URL")
139148
# Possible to add another LangChain compatible connector

0 commit comments

Comments
 (0)