Skip to content

Commit 16cce6c

Browse files
authored
enhance: add AMD model platform support PR2985 (#3070)
1 parent 3d99f14 commit 16cce6c

File tree

6 files changed

+8
-14
lines changed

6 files changed

+8
-14
lines changed

.github/workflows/pytest_package.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ jobs:
166166
BOHRIUM_API_KEY: "${{ secrets.BOHRIUM_API_KEY }}"
167167
CRYNUX_API_KEY: "${{ secrets.CRYNUX_API_KEY }}"
168168
NEBIUS_API_KEY: "${{ secrets.NEBIUS_API_KEY }}"
169+
AMD_API_KEY: "${{ secrets.AMD_API_KEY }}"
169170
run: |
170171
source .venv/bin/activate
171172
uv pip install -e ".[all, dev, docs]"
@@ -249,6 +250,7 @@ jobs:
249250
BOHRIUM_API_KEY: "${{ secrets.BOHRIUM_API_KEY }}"
250251
CRYNUX_API_KEY: "${{ secrets.CRYNUX_API_KEY }}"
251252
NEBIUS_API_KEY: "${{ secrets.NEBIUS_API_KEY }}"
253+
AMD_API_KEY: "${{ secrets.AMD_API_KEY }}"
252254
run: |
253255
source .venv/bin/activate
254256
uv pip install -e ".[all, dev, docs]"

camel/configs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
'SILICONFLOW_API_PARAMS',
113113
'AIMLConfig',
114114
'AIML_API_PARAMS',
115-
'AMDConfigs',
115+
'AMDConfig',
116116
'AMD_API_PARAMS',
117117
'OpenRouterConfig',
118118
'OPENROUTER_API_PARAMS',

camel/models/amd_model.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ def __init__(
7171
url = url or os.environ.get(
7272
"AMD_API_BASE_URL", "https://llm-api.amd.com"
7373
)
74-
headers = {
75-
'Ocp-Apim-Subscription-Key': api_key
76-
}
74+
headers = {'Ocp-Apim-Subscription-Key': api_key}
7775
kwargs["default_headers"] = headers
7876
timeout = timeout or float(os.environ.get("MODEL_TIMEOUT", 180))
7977
super().__init__(

camel/types/enums.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,14 +517,14 @@ def is_openai(self) -> bool:
517517
ModelType.O4_MINI,
518518
ModelType.O3,
519519
}
520-
520+
521521
@property
522522
def is_amd(self) -> bool:
523523
r"""Returns whether this type of models is a AMD model."""
524524
return self in {
525525
ModelType.AMD_GPT4,
526526
}
527-
527+
528528
@property
529529
def is_aws_bedrock(self) -> bool:
530530
r"""Returns whether this type of models is an AWS Bedrock model."""

examples/models/amd_model_example.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,4 @@ def main():
141141
- Test with a demo/sandbox account or very small amounts first.
142142
- You can expand this bot with strategies, stop-loss, take-profit, etc.
143143
- For real trading, always understand the risks and comply with local regulations.
144-
145-
146-
147-
"""
144+
""" # noqa: E501, RUF001

test/models/test_amd_model.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# limitations under the License.
1313
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
1414

15-
import re
1615

1716
import pytest
1817

@@ -24,9 +23,7 @@
2423
@pytest.mark.model_backend
2524
@pytest.mark.parametrize(
2625
"model_type",
27-
[
28-
ModelType.AMD_GPT4
29-
],
26+
[ModelType.AMD_GPT4],
3027
)
3128
def test_amd_model(model_type: ModelType):
3229
model = AMDModel(model_type)

0 commit comments

Comments
 (0)