mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 15:43:54 +00:00
community[patch]: Fix unintended newline in print statement in exception for BaichuanTextEmbeddings (#21820)
- **Code:** langchain_community/embeddings/baichuan.py:82 - **Description:** When I make an error using 'baichuan embeddings', the printed error message is wrapped (there is actually no need to wrap) ```python # example from langchain_community.embeddings import BaichuanTextEmbeddings # error key BAICHUAN_API_KEY = "sk-xxxxxxxxxxxxx" embeddings = BaichuanTextEmbeddings(baichuan_api_key=BAICHUAN_API_KEY) text_1 = "今天天气不错" query_result = embeddings.embed_query(text_1) ``` 
This commit is contained in:
parent
aa648298ae
commit
9f8d18c028
@ -80,8 +80,8 @@ class BaichuanTextEmbeddings(BaseModel, Embeddings):
|
||||
else:
|
||||
# Log error or handle unsuccessful response appropriately
|
||||
print( # noqa: T201
|
||||
f"""Error: Received status code {response.status_code} from
|
||||
embedding API"""
|
||||
f"Error: Received status code {response.status_code} from "
|
||||
"embedding API"
|
||||
)
|
||||
return None
|
||||
except Exception as e:
|
||||
|
Loading…
Reference in New Issue
Block a user