Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

fix: WolframAlpha result from all subpods (#1534)

Wendong-Fan388b64081b84
diff --git a/camel/datahubs/huggingface.py b/camel/datahubs/huggingface.py
index 0e2d956d8..8e684fc10 100644
--- a/camel/datahubs/huggingface.py
+++ b/camel/datahubs/huggingface.py
@@ -32,19 +32,19 @@ class HuggingFaceDatasetManager(BaseDatasetManager):
Args:
token (str): The Hugging Face API token. If not provided, the token
- will be read from the environment variable `HUGGING_FACE_TOKEN`.
+ will be read from the environment variable `HF_TOKEN`.
"""
@api_keys_required(
[
- ("token", "HUGGING_FACE_TOKEN"),
+ ("token", "HF_TOKEN"),
]
)
@dependencies_required('huggingface_hub')
def __init__(self, token: Optional[str] = None):
from huggingface_hub import HfApi
- self._api_key = token or os.getenv("HUGGING_FACE_TOKEN")
+ self._api_key = token or os.getenv("HF_TOKEN")
self.api = HfApi(token=self._api_key)
def create_dataset_card(
diff --git a/camel/toolkits/search_toolkit.py b/camel/toolkits/search_toolkit.py
index 863f80d1d..037558d8f 100644
--- a/camel/toolkits/search_toolkit.py
+++ b/camel/toolkits/search_toolkit.py
@@ -580,6 +580,18 @@ class SearchToolkit(BaseToolkit):
"image_url": image_url,
}
+ # For Results pod, collect all plaintext values from subpods
+ if pod.get("@title") == "Results":
+ results_text = []
+ if isinstance(subpod_data, list):
+ for subpod in subpod_data:
+ if subpod.get("plaintext"):
+ results_text.append(subpod["plaintext"])
+ else:
+ if description:
+ results_text.append(description)
+ pod_info["description"] = "\n".join(results_text)
+
# Add to steps list
output["pod_info"].append(pod_info)
diff --git a/test/datahubs/test_huggingface.py b/test/datahubs/test_huggingface.py
index 8e3a83f28..b51a9691c 100644
--- a/test/datahubs/test_huggingface.py
+++ b/test/datahubs/test_huggingface.py
@@ -28,7 +28,7 @@ DATASET_NAME = (
)
REPO_ID = f"username/{DATASET_NAME}"
-os.environ["HUGGING_FACE_TOKEN"] = TOKEN
+os.environ["HF_TOKEN"] = TOKEN
@pytest.fixture
diff --git a/test/embeddings/test_open_source_embeddings.py b/test/embeddings/test_open_source_embeddings.py
index 8fc4f6d9d..7413604aa 100644
--- a/test/embeddings/test_open_source_embeddings.py
+++ b/test/embeddings/test_open_source_embeddings.py
@@ -16,6 +16,11 @@ from sentence_transformers import SentenceTransformer
from camel.embeddings import SentenceTransformerEncoder
+pytestmark = pytest.mark.skip(
+ reason="Temporarily skipping tests due to Huggingface "
+ "credentials not available"
+)
+
def test_SentenceTransformerEmbedding_initialization():
embedding = SentenceTransformerEncoder()
diff --git a/test/embeddings/test_vlm_embeddings.py b/test/embeddings/test_vlm_embeddings.py
index 5c3882385..34ffc49ef 100644
--- a/test/embeddings/test_vlm_embeddings.py
+++ b/test/embeddings/test_vlm_embeddings.py
@@ -18,6 +18,11 @@ from transformers import CLIPModel, CLIPProcessor
from camel.embeddings import VisionLanguageEmbedding
+pytestmark = pytest.mark.skip(
+ reason="Temporarily skipping tests due to Huggingface "
+ "credentials not available"
+)
+
@pytest.fixture
def VLM_instance() -> VisionLanguageEmbedding: