Skip to content

Commit 2d397f8

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1098501 commit 2d397f8

4 files changed

Lines changed: 7 additions & 1 deletion

File tree

langchain_opea/chat_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class ChatOPEA(BaseChatOpenAI): # type: ignore[override]
3535

3636
model_name: str = Field(alias="model", default=DEFAULT_MODEL_ID)
3737
"""Model name to use."""
38+
3839
opea_api_key: Optional[SecretStr] = Field(
3940
alias="api_key",
4041
default_factory=secret_from_env("OPEA_API_KEY", default=None),
@@ -43,6 +44,7 @@ class ChatOPEA(BaseChatOpenAI): # type: ignore[override]
4344
4445
Automatically read from env variable `OPEA_API_KEY` if not provided.
4546
"""
47+
4648
opea_api_base: str = Field(default="https://localhost:9009/v1/")
4749
"""Base URL path for API requests."""
4850

langchain_opea/embeddings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class OPEAEmbeddings(OpenAIEmbeddings):
3636

3737
model_name: str = Field(alias="model")
3838
"""Model name to use."""
39+
3940
opea_api_key: Optional[SecretStr] = Field(
4041
alias="api_key",
4142
default_factory=secret_from_env("OPEA_API_KEY", default=None),
@@ -44,6 +45,7 @@ class OPEAEmbeddings(OpenAIEmbeddings):
4445
4546
Automatically read from env variable `OPEA_API_KEY` if not provided.
4647
"""
48+
4749
opea_api_base: str = Field(default="https://localhost:6006/v1/")
4850
"""Base URL path for API requests."""
4951

langchain_opea/llms.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class OPEALLM(BaseOpenAI): # type: ignore[override]
3939

4040
model_name: str = Field(alias="model", default=DEFAULT_MODEL_ID)
4141
"""Model name to use."""
42+
4243
opea_api_key: Optional[SecretStr] = Field(
4344
alias="api_key",
4445
default_factory=secret_from_env("OPEA_API_KEY", default=None),
@@ -47,6 +48,7 @@ class OPEALLM(BaseOpenAI): # type: ignore[override]
4748
4849
Automatically read from env variable `OPEA_API_KEY` if not provided.
4950
"""
51+
5052
opea_api_base: str = Field(default="http://localhost:9009/v1/")
5153
"""Base URL path for API requests."""
5254

langchain_opea/native_chat_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class ChatNative(BaseChatModel):
102102

103103
llm: Any
104104
"""LLM, must be of type HuggingFacePipeline."""
105+
105106
system_message: SystemMessage = SystemMessage(content=DEFAULT_SYSTEM_PROMPT)
106107
tokenizer: Any = None
107108
model_id: Optional[str] = None
@@ -209,7 +210,6 @@ def _to_chat_prompt(
209210

210211
def _to_chatml_format(self, message: BaseMessage) -> dict:
211212
"""Convert LangChain message to ChatML format."""
212-
213213
if isinstance(message, SystemMessage):
214214
role = "system"
215215
elif isinstance(message, AIMessage):

0 commit comments

Comments
 (0)