mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
langchain-anthropic[patch]: Add ruff bandit rules (#31789)
This commit is contained in:
@@ -25,7 +25,7 @@ class _SyncHttpxClientWrapper(anthropic.DefaultHttpxClient):
|
||||
|
||||
try:
|
||||
self.close()
|
||||
except Exception:
|
||||
except Exception: # noqa: S110
|
||||
pass
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class _AsyncHttpxClientWrapper(anthropic.DefaultAsyncHttpxClient):
|
||||
try:
|
||||
# TODO(someday): support non asyncio runtimes here
|
||||
asyncio.get_running_loop().create_task(self.aclose())
|
||||
except Exception:
|
||||
except Exception: # noqa: S110
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -327,9 +327,10 @@ def _format_messages(
|
||||
|
||||
if not isinstance(message.content, str):
|
||||
# parse as dict
|
||||
assert isinstance(
|
||||
message.content, list
|
||||
), "Anthropic message content must be str or list of dicts"
|
||||
if not isinstance(message.content, list):
|
||||
raise ValueError(
|
||||
"Anthropic message content must be str or list of dicts"
|
||||
)
|
||||
|
||||
# populate content
|
||||
content = []
|
||||
|
||||
Reference in New Issue
Block a user