🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
fix format and del unused import (#525)
Junrong Linb91d07b23095
diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.ymlindex 81eefa186..6c64a61eb 100644--- a/.github/workflows/build_package.yml+++ b/.github/workflows/build_package.yml@@ -33,4 +33,5 @@ jobs:GOOGLE_API_KEY: "${{ secrets.GOOGLE_API_KEY }}"SEARCH_ENGINE_ID: "${{ secrets.SEARCH_ENGINE_ID }}"OPENWEATHERMAP_API_KEY: "${{ secrets.OPENWEATHERMAP_API_KEY }}"+ ANTHROPIC_API_KEY: "${{ secrets.ANTHROPIC_API_KEY }}"run: pytest --fast-test-mode ./testdiff --git a/.github/workflows/pytest_package.yml b/.github/workflows/pytest_package.ymlindex 080002ae8..5819969fb 100644--- a/.github/workflows/pytest_package.yml+++ b/.github/workflows/pytest_package.yml@@ -27,6 +27,7 @@ jobs:GOOGLE_API_KEY: "${{ secrets.GOOGLE_API_KEY }}"SEARCH_ENGINE_ID: "${{ secrets.SEARCH_ENGINE_ID }}"OPENWEATHERMAP_API_KEY: "${{ secrets.OPENWEATHERMAP_API_KEY }}"+ ANTHROPIC_API_KEY: "${{ secrets.ANTHROPIC_API_KEY }}"run: poetry run pytest --fast-test-mode test/pytest_package_llm_test:@@ -43,6 +44,7 @@ jobs:GOOGLE_API_KEY: "${{ secrets.GOOGLE_API_KEY }}"SEARCH_ENGINE_ID: "${{ secrets.SEARCH_ENGINE_ID }}"OPENWEATHERMAP_API_KEY: "${{ secrets.OPENWEATHERMAP_API_KEY }}"+ ANTHROPIC_API_KEY: "${{ secrets.ANTHROPIC_API_KEY }}"run: poetry run pytest --llm-test-only test/pytest_package_very_slow_test:@@ -59,4 +61,5 @@ jobs:GOOGLE_API_KEY: "${{ secrets.GOOGLE_API_KEY }}"SEARCH_ENGINE_ID: "${{ secrets.SEARCH_ENGINE_ID }}"OPENWEATHERMAP_API_KEY: "${{ secrets.OPENWEATHERMAP_API_KEY }}"+ ANTHROPIC_API_KEY: "${{ secrets.ANTHROPIC_API_KEY }}"run: poetry run pytest --very-slow-test-only test/diff --git a/camel/utils/token_counting.py b/camel/utils/token_counting.pyindex 69470f23b..608b40a6d 100644--- a/camel/utils/token_counting.py+++ b/camel/utils/token_counting.py@@ -17,10 +17,9 @@ from io import BytesIOfrom math import ceilfrom typing import List, Optional+from anthropic import Anthropicfrom PIL import Image-from anthropic import AI_PROMPT, HUMAN_PROMPT, Anthropic-from camel.messages import OpenAIMessagefrom camel.types import ModelType, OpenAIImageDetailType, OpenAIImageType@@ -257,7 +256,6 @@ class OpenAITokenCounter(BaseTokenCounter):return num_tokens-class AnthropicTokenCounter(BaseTokenCounter):def __init__(self, model_type: ModelType):@@ -287,6 +285,7 @@ class AnthropicTokenCounter(BaseTokenCounter):return self.client.count_tokens(prompt)+def count_tokens_from_image(image: Image.Image,detail: OpenAIImageDetailType) -> int:r"""Count image tokens for OpenAI vision model. An :obj:`"auto"`