|
10 | 10 | import logging
|
11 | 11 | import os
|
12 | 12 | import tempfile
|
| 13 | +from datetime import datetime, timezone |
13 | 14 | from unittest import mock
|
14 | 15 | from unittest.mock import patch
|
15 | 16 |
|
16 | 17 | import pytest
|
17 | 18 |
|
18 | 19 | import autogen
|
19 |
| -from autogen.oai.openai_utils import DEFAULT_AZURE_API_VERSION, filter_config, is_valid_api_key |
| 20 | +from autogen.oai.openai_utils import DEFAULT_AZURE_API_VERSION, OAI_PRICE1K, filter_config, is_valid_api_key |
20 | 21 |
|
21 | 22 | from ..conftest import MOCK_OPEN_AI_API_KEY
|
22 | 23 |
|
@@ -446,5 +447,23 @@ def test_is_valid_api_key():
|
446 | 447 | assert is_valid_api_key(MOCK_OPEN_AI_API_KEY)
|
447 | 448 |
|
448 | 449 |
|
| 450 | +def test_reminder_to_update_deepseek_pricing_after_promotion(): |
| 451 | + # Reference: https://api-docs.deepseek.com/quick_start/pricing |
| 452 | + # Define the promotion end date - February 8th, 2025 at 16:00 UTC |
| 453 | + promo_end_date = datetime(2025, 2, 8, 16, 0, tzinfo=timezone.utc) |
| 454 | + current_time = datetime.now(timezone.utc) |
| 455 | + |
| 456 | + # Get the pricing tuple for deepseek-chat |
| 457 | + input_price, output_price = OAI_PRICE1K["deepseek-chat"] |
| 458 | + |
| 459 | + # After promo end date: Assert promotional pricing has been updated |
| 460 | + if current_time > promo_end_date: |
| 461 | + assert (input_price, output_price) != (0.00014, 0.00028), ( |
| 462 | + f"DeepSeek promotional period ended on {promo_end_date.strftime('%B %d, %Y at %H:%M %Z')}. " |
| 463 | + "Please update OAI_PRICE1K['deepseek-chat'] to standard pricing." |
| 464 | + "Check https://api-docs.deepseek.com/quick_start/pricing for more details." |
| 465 | + ) |
| 466 | + |
| 467 | + |
449 | 468 | if __name__ == "__main__":
|
450 | 469 | pytest.main()
|
0 commit comments