Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Upload folder using huggingface_hub
Browse files- app.py +11 -1
- install_deps.sh +1 -1
- requirements.txt +2 -1
- setup_a2a.py +1 -1
app.py
CHANGED
@@ -32,7 +32,17 @@ if os.getenv("SPACE_ID"):
|
|
32 |
print("β
Full A2A dependencies are available! A2A mode will work.")
|
33 |
except ImportError as e:
|
34 |
print(f"β οΈ A2A components not available from any_agent: {e}")
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
else:
|
38 |
# Not on HF Spaces
|
|
|
32 |
print("β
Full A2A dependencies are available! A2A mode will work.")
|
33 |
except ImportError as e:
|
34 |
print(f"β οΈ A2A components not available from any_agent: {e}")
|
35 |
+
# Try to fix by reinstalling any-agent with a2a extra
|
36 |
+
print("π¦ Attempting to install any-agent[a2a]...")
|
37 |
+
try:
|
38 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "any-agent[a2a,openai]>=0.22.0", "--force-reinstall"])
|
39 |
+
# Try import again
|
40 |
+
from any_agent.serving import A2AServingConfig
|
41 |
+
from any_agent.tools import a2a_tool_async
|
42 |
+
print("β
Successfully installed! A2A mode will work.")
|
43 |
+
except Exception as e2:
|
44 |
+
print(f"β Failed to install any-agent[a2a]: {e2}")
|
45 |
+
print("β
Basic Multiagent mode will be used instead.")
|
46 |
|
47 |
else:
|
48 |
# Not on HF Spaces
|
install_deps.sh
CHANGED
@@ -23,7 +23,7 @@ python -c "import a2a; print('β
a2a module imports successfully!')" || {
|
|
23 |
|
24 |
# Install any-agent with both a2a and openai extras
|
25 |
echo "Installing any-agent with a2a and openai extras..."
|
26 |
-
python -m pip install "any-agent[a2a,openai]
|
27 |
|
28 |
# Install other dependencies
|
29 |
echo "Installing remaining dependencies..."
|
|
|
23 |
|
24 |
# Install any-agent with both a2a and openai extras
|
25 |
echo "Installing any-agent with a2a and openai extras..."
|
26 |
+
python -m pip install "any-agent[a2a,openai]>=0.22.0"
|
27 |
|
28 |
# Install other dependencies
|
29 |
echo "Installing remaining dependencies..."
|
requirements.txt
CHANGED
@@ -12,7 +12,8 @@ aiohttp
|
|
12 |
a2a-sdk==0.2.9
|
13 |
|
14 |
# Step 3: Install any-agent with both a2a and openai extras
|
15 |
-
|
|
|
16 |
|
17 |
# Step 4: Additional dependencies (if not pulled in by any-agent)
|
18 |
# These might already be installed by any-agent[openai] but we list them to be sure
|
|
|
12 |
a2a-sdk==0.2.9
|
13 |
|
14 |
# Step 3: Install any-agent with both a2a and openai extras
|
15 |
+
# Version 0.22+ required for any_agent.serving module
|
16 |
+
any-agent[a2a,openai]>=0.22.0
|
17 |
|
18 |
# Step 4: Additional dependencies (if not pulled in by any-agent)
|
19 |
# These might already be installed by any-agent[openai] but we list them to be sure
|
setup_a2a.py
CHANGED
@@ -52,7 +52,7 @@ def main():
|
|
52 |
|
53 |
# Step 4: Install any-agent with both a2a and openai extras
|
54 |
print("\n4. Installing any-agent with a2a and openai extras...")
|
55 |
-
install_package("any-agent[a2a,openai]>=0.
|
56 |
|
57 |
print("\nβ
Setup complete!")
|
58 |
|
|
|
52 |
|
53 |
# Step 4: Install any-agent with both a2a and openai extras
|
54 |
print("\n4. Installing any-agent with a2a and openai extras...")
|
55 |
+
install_package("any-agent[a2a,openai]>=0.22.0")
|
56 |
|
57 |
print("\nβ
Setup complete!")
|
58 |
|