From 49dd64d7db499da45746f7c947181f7bcc19d4a3 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 20 Sep 2024 08:13:30 +0100 Subject: [PATCH 1/2] tests: Fix cohere API change (#3549) --- sentry_sdk/integrations/cohere.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sentry_sdk/integrations/cohere.py b/sentry_sdk/integrations/cohere.py index 388b86f1e0..4d6a4a244c 100644 --- a/sentry_sdk/integrations/cohere.py +++ b/sentry_sdk/integrations/cohere.py @@ -26,7 +26,6 @@ from cohere import ( ChatStreamEndEvent, NonStreamedChatResponse, - StreamedChatResponse_StreamEnd, ) if TYPE_CHECKING: @@ -34,6 +33,12 @@ 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, @@ -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, From 64e2977b39c7e1b3b6fbad6e003f7800139e2913 Mon Sep 17 00:00:00 2001 From: joshuarli Date: Fri, 20 Sep 2024 00:22:40 -0700 Subject: [PATCH 2/2] ci: update actions/upload-artifact to v4 with merge (#3545) --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6e6415b65..7cd7847e42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -91,7 +94,23 @@ jobs: make apidocs cd docs/_build && zip -r gh-pages ./ - - uses: actions/upload-artifact@v3.1.1 + - 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