Skip to content

Commit d5cd814

Browse files
[Docs] Add instructions on using deepseek v3 and gemini 2.0 models (#559)
* Add instructions on using deepseek v3 and genimi 2.0 in docs * Add DeepSeek promotional pricing expiration test * Add DeepSeek promotional pricing expiration test
1 parent 1fb6248 commit d5cd814

File tree

5 files changed

+547
-1
lines changed

5 files changed

+547
-1
lines changed

autogen/oai/openai_utils.py

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@
8888
"gpt-35-turbo-0301": (0.0015, 0.002),
8989
"gpt-35-turbo-16k": (0.003, 0.004),
9090
"gpt-35-turbo-16k-0613": (0.003, 0.004),
91+
# The below are the discounted prices offered by deepseek to all users till 2025-02-08 16:00 (UTC)
92+
# TODO: After 2025-02-08 16:00 UTC, update to standard pricing
93+
# Reference: https://api-docs.deepseek.com/quick_start/pricing
94+
"deepseek-chat": (0.00014, 0.00028),
9195
}
9296

9397

test/oai/test_utils.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
import logging
1111
import os
1212
import tempfile
13+
from datetime import datetime, timezone
1314
from unittest import mock
1415
from unittest.mock import patch
1516

1617
import pytest
1718

1819
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
2021

2122
from ..conftest import MOCK_OPEN_AI_API_KEY
2223

@@ -446,5 +447,23 @@ def test_is_valid_api_key():
446447
assert is_valid_api_key(MOCK_OPEN_AI_API_KEY)
447448

448449

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+
449468
if __name__ == "__main__":
450469
pytest.main()

0 commit comments

Comments
 (0)