Skip to content

Commit

Permalink
Reformat with poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Huang authored and Nick Huang committed Oct 8, 2024
1 parent e6cbc10 commit ea9682b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,11 @@ def _get_settings(self) -> ls_schemas.LangSmithSettings:

return self._settings

def _content_above_size(self, content_length: Optional[int], request: Optional[requests.Request | requests.PreparedRequest] ) -> Optional[str]:
def _content_above_size(
self,
content_length: Optional[int],
request: Optional[requests.Request | requests.PreparedRequest],
) -> Optional[str]:
if content_length is None or self._info is None:
return None
info = cast(ls_schemas.LangSmithInfo, self._info)
Expand All @@ -742,7 +746,10 @@ def _content_above_size(self, content_length: Optional[int], request: Optional[r
if size_limit is None:
return None
if content_length > size_limit:
should_debug_crash_dump = os.getenv("LANGSMITH_DEBUG_CRASH_DUMP") in ["1", "true"]
should_debug_crash_dump = os.getenv("LANGSMITH_DEBUG_CRASH_DUMP") in [
"1",
"true",
]
if should_debug_crash_dump and request is not None:
with open("content_size_limit_crash_dump.jsonl", "a") as f:
json.dump(request, f)
Expand Down

0 comments on commit ea9682b

Please sign in to comment.