Skip to content

Commit

Permalink
Merge branch 'master' into byk/tests/timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
sentrivana authored Sep 20, 2024
2 parents 9f0b114 + 64e2977 commit aedde93
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,14 @@ jobs:
# This will also trigger "make dist" that creates the Python packages
make aws-lambda-layer
- name: Upload Python Packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
name: artifact-build_lambda_layer
path: |
dist/*
if-no-files-found: 'error'
# since this artifact will be merged, compression is not necessary
compression-level: '0'

docs:
name: Build SDK API Doc
Expand All @@ -91,7 +94,23 @@ jobs:
make apidocs
cd docs/_build && zip -r gh-pages ./
- uses: actions/[email protected]
- uses: actions/upload-artifact@v4
with:
name: artifact-docs
path: |
docs/_build/gh-pages.zip
if-no-files-found: 'error'
# since this artifact will be merged, compression is not necessary
compression-level: '0'

merge:
name: Create Release Artifact
runs-on: ubuntu-latest
needs: [build_lambda_layer, docs]
steps:
- uses: actions/upload-artifact/merge@v4
with:
# Craft expects release assets from github to be a single artifact named after the sha.
name: ${{ github.sha }}
path: docs/_build/gh-pages.zip
pattern: artifact-*
delete-merged: true
9 changes: 7 additions & 2 deletions sentry_sdk/integrations/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@
from cohere import (
ChatStreamEndEvent,
NonStreamedChatResponse,
StreamedChatResponse_StreamEnd,
)

if TYPE_CHECKING:
from cohere import StreamedChatResponse
except ImportError:
raise DidNotEnable("Cohere not installed")

try:
# cohere 5.9.3+
from cohere import StreamEndStreamedChatResponse
except ImportError:
from cohere import StreamedChatResponse_StreamEnd as StreamEndStreamedChatResponse


COLLECTED_CHAT_PARAMS = {
"model": SPANDATA.AI_MODEL_ID,
Expand Down Expand Up @@ -189,7 +194,7 @@ def new_iterator():
with capture_internal_exceptions():
for x in old_iterator:
if isinstance(x, ChatStreamEndEvent) or isinstance(
x, StreamedChatResponse_StreamEnd
x, StreamEndStreamedChatResponse
):
collect_chat_response_fields(
span,
Expand Down

0 comments on commit aedde93

Please sign in to comment.