Skip to content

Commit

Permalink
Add deepseek llm-s to CI testing (#631)
Browse files Browse the repository at this point in the history
* Add deepseek llm-s to CI testing

* Add DEEPSEEK_API_KEY env to core-llm-test.yml

* Update if statement in coe-llm-test.yml
  • Loading branch information
rjambrecic authored Jan 23, 2025
1 parent 7436022 commit 72ba7be
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/core-llm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
test:
strategy:
matrix:
llm: ["openai", "gemini", "anthropic"]
llm: ["openai", "gemini", "anthropic", "deepseek"]
python-version: ["3.9"]
os: [ubuntu-latest]
fail-fast: false
Expand All @@ -46,13 +46,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
if: matrix.llm == 'openai'
if: matrix.llm == 'openai' || matrix.llm == 'deepseek'
run: |
docker --version
uv pip install --system -e ".[test,redis,interop]"
python -c "import autogen"
- name: Install packages for ${{ matrix.llm }}
if: matrix.llm != 'openai'
if: matrix.llm != 'openai' && matrix.llm != 'deepseek'
run: |
docker --version
uv pip install --system -e ".[test,redis,interop,${{ matrix.llm }}]"
Expand All @@ -62,6 +62,7 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ markers = [
"openai",
"gemini",
"anthropic",
"deepseek",
"redis",
"docker",
]
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-core-llm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: Apache-2.0

# Default mark if none is provided
DEFAULT_MARK="openai or gemini or anthropic"
DEFAULT_MARK="openai or gemini or anthropic or deepseek"

# Initialize MARK as the default value
MARK="$DEFAULT_MARK"
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-skip-llm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# SPDX-License-Identifier: Apache-2.0

base_filter="not (openai or gemini or anthropic)"
base_filter="not (openai or gemini or anthropic or deepseek)"
args=()
while [[ $# -gt 0 ]]; do
if [[ "$1" == "-m" ]]; then
Expand Down
10 changes: 10 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,16 @@ def credentials_anthropic_claude_sonnet() -> Credentials:
)


@pytest.fixture
def credentials_deepseek_reasoner() -> Credentials:
return get_llm_credentials(
"DEEPSEEK_API_KEY",
model="deepseek-reasoner",
api_type="deepseek",
filter_dict={"tags": ["deepseek-reasoner"]},
)


def get_mock_credentials(model: str, temperature: float = 0.6) -> Credentials:
llm_config = {
"config_list": [
Expand Down
6 changes: 6 additions & 0 deletions test/test_conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ def test_credentials_from_test_param_fixture(
assert first_config["api_type"] == "anthropic"
else:
assert False, f"Unknown LLM fixture: {current_llm}"


@pytest.mark.deepseek
def test_credentials_deepseek_reasoner_api_key_is_set(credentials_deepseek_reasoner: Credentials) -> None:
assert len(credentials_deepseek_reasoner.config_list) > 0
assert credentials_deepseek_reasoner.config_list[0]["api_key"] is not None

0 comments on commit 72ba7be

Please sign in to comment.