diff --git a/.circleci/config.yml b/.circleci/config.yml index c9e4ddd0a38..92892d3ff84 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,11 @@ jobs: steps: - checkout + - run: + name: Show git commit hash + command: | + echo "Git commit hash: $CIRCLE_SHA1" + - run: name: Check if litellm dir was updated or if pyproject.toml was modified command: | @@ -293,7 +298,7 @@ jobs: -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: Bearer $GITHUB_TOKEN" \ "https://api.github.com/repos/BerriAI/litellm/actions/workflows/ghcr_deploy.yml/dispatches" \ - -d "{\"ref\":\"main\", \"inputs\":{\"tag\":\"v${VERSION}\"}}" + -d "{\"ref\":\"main\", \"inputs\":{\"tag\":\"v${VERSION}\", \"stable\":false, \"commit_hash\":\"$CIRCLE_SHA1\"}}" workflows: version: 2 diff --git a/.github/workflows/ghcr_deploy.yml b/.github/workflows/ghcr_deploy.yml index b9ab18859f6..ad4acc8e139 100644 --- a/.github/workflows/ghcr_deploy.yml +++ b/.github/workflows/ghcr_deploy.yml @@ -9,6 +9,9 @@ on: description: "Build Stable version" type: boolean default: false + commit_hash: + description: "Commit hash" + required: true # Defines two custom environment variables for the workflow. Used for the Container registry domain, and a name for the Docker image that this workflow builds. env: @@ -106,7 +109,7 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@4976231911ebf5f32aad765192d35f942aa48cb8 with: - context: https://github.com/BerriAI/litellm.git#26f5823c4ec4806aba82d8c48dc9816713ffc214 + context: https://github.com/BerriAI/litellm.git#${{ github.event.inputs.commit_hash}} push: true tags: ${{ steps.meta.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta.outputs.tags }}-${{ env.type_release }} # if a tag is provided, use that, otherwise use the release tag, and if neither is available, use 'latest' labels: ${{ steps.meta.outputs.labels }} @@ -142,7 +145,7 @@ jobs: - name: Build and push Database Docker image uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: - context: . + context: https://github.com/BerriAI/litellm.git#${{ github.event.inputs.commit_hash}} file: Dockerfile.database push: true tags: ${{ steps.meta-database.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta-database.outputs.tags }}-${{ env.type_release }} @@ -179,7 +182,7 @@ jobs: - name: Build and push Database Docker image uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: - context: . + context: https://github.com/BerriAI/litellm.git#${{ github.event.inputs.commit_hash}} file: ./litellm-js/spend-logs/Dockerfile push: true tags: ${{ steps.meta-spend-logs.outputs.tags }}-${{ github.event.inputs.tag || 'latest' }}, ${{ steps.meta-spend-logs.outputs.tags }}-${{ env.type_release }} @@ -260,6 +263,7 @@ jobs: const response = await github.rest.repos.createRelease({ draft: false, generate_release_notes: true, + target_commitish: ${{ github.event.inputs.commit_hash}} name: process.env.RELEASE_TAG, owner: context.repo.owner, prerelease: false, diff --git a/litellm/llms/prompt_templates/factory.py b/litellm/llms/prompt_templates/factory.py index cc984a48425..5d3d70a5972 100644 --- a/litellm/llms/prompt_templates/factory.py +++ b/litellm/llms/prompt_templates/factory.py @@ -692,7 +692,7 @@ def anthropic_messages_pt_xml(messages: list): if messages[msg_i].get( "tool_calls", [] ): # support assistant tool invoke convertion - assistant_text += convert_to_anthropic_tool_invoke( + assistant_text += convert_to_anthropic_tool_invoke( # type: ignore messages[msg_i]["tool_calls"] ) diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index aa54f815496..e4936eb02ec 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -50,9 +50,6 @@ def test_completion_custom_provider_model_name(): pytest.fail(f"Error occurred: {e}") -# test_completion_custom_provider_model_name() - - def test_completion_azure_command_r(): try: litellm.set_verbose = True