Skip to content

Commit

Permalink
python[patch]: handle deployments without attachments support (#1371)
Browse files Browse the repository at this point in the history
Fixes #1368
  • Loading branch information
baskaryan authored Jan 3, 2025
1 parent 240f9d4 commit 8f50671
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4307,7 +4307,7 @@ def read_example(

example = response.json()
attachments = {}
if example["attachment_urls"]:
if example.get("attachment_urls"):
for key, value in example["attachment_urls"].items():
response = requests.get(value["presigned_url"], stream=True)
response.raise_for_status()
Expand Down Expand Up @@ -4441,7 +4441,7 @@ def list_examples(
self._get_paginated_list("/examples", params=params)
):
attachments = {}
if example["attachment_urls"]:
if example.get("attachment_urls"):
for key, value in example["attachment_urls"].items():
response = requests.get(value["presigned_url"], stream=True)
response.raise_for_status()
Expand Down

0 comments on commit 8f50671

Please sign in to comment.