AllRatesToday × DeepSeek
English | 简体中文
Give DeepSeek chat and agents real-time access to currency exchange rates and historical data — via function calling.
DeepSeek's Chat Completions API is OpenAI-compatible, so the same tool-calling mechanism works. This package ships ready-to-use tool schemas and a thin agent wrapper that lets DeepSeek answer questions like:
- "What's USD to EUR right now?"
- "Convert 1000 GBP to JPY."
- "How has USD/INR moved over the last 30 days?"
- "List every supported currency."
Powered by the AllRatesToday API — 160+ currencies, mid-market rates from Reuters/Refinitiv, public endpoints that need no API key.
Install
pip install allratestoday-deepseek
Quick start — one-shot
export DEEPSEEK_API_KEY=sk-... # from platform.deepseek.com/api_keys
allratestoday-deepseek --ask "What is 2500 USD in EUR right now?"
Quick start — interactive chat
allratestoday-deepseek
# or:
python examples/chat.py
Library usage
from allratestoday_deepseek import DeepSeekCurrencyAgent
with DeepSeekCurrencyAgent() as agent:
print(agent.ask("How many Japanese Yen is 500 Swiss Francs?"))
Need finer control? Use the tool schemas directly with the OpenAI SDK pointed at DeepSeek — see examples/raw_tool_call.py.
Tools exposed
| Tool | API key | Description |
|---|---|---|
get_exchange_rate |
no | Current mid-market rate between two currencies. |
convert_currency |
no | Convert an amount between two currencies at the live rate. |
get_historical_rates |
yes | Rate history over 1d, 7d, 30d, or 1y. |
list_currencies |
no | All supported currencies with codes, names, symbols. |
Public tools (get_exchange_rate, convert_currency, list_currencies) work without a key. Set ALLRATES_API_KEY for historical data and multi-target queries.
Environment variables
| Variable | Required? | Purpose |
|---|---|---|
DEEPSEEK_API_KEY |
yes | Your DeepSeek API key. |
ALLRATES_API_KEY |
no | AllRatesToday API key (for higher limits). Get one at allratestoday.com/register. |
ALLRATES_BASE_URL |
no | Override the API base URL (default https://allratestoday.com/api). |
How it works
- You send DeepSeek a question.
- The agent calls
chat.completions.create(..., tools=TOOLS)— DeepSeek receives all 5 tool schemas. - If DeepSeek decides it needs a rate, it emits a
tool_call(e.g.get_exchange_rate(source="USD", target="EUR")). - The agent runs the tool against the AllRatesToday API and passes the JSON result back.
- DeepSeek produces a final natural-language answer, citing the live rate.
No hallucinated rates — the agent never answers without calling the tool first.
Compatibility
- DeepSeek models that support function calling (
deepseek-chat,deepseek-reasoner). - Python 3.9+.
- Works on Linux, macOS, and Windows.
Related
- MCP server:
@allratestoday/mcp-server— for Claude Code, Cursor, and Claude Desktop. - JavaScript SDK:
@allratestoday/sdk— raw SDK for any Node.js or browser app. - Docs: allratestoday.com/developers
License
MIT — see LICENSE.
Release files for allratestoday-deepseek 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| allratestoday_deepseek-0.2.1.tar.gz | 10.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| allratestoday_deepseek-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.4 kB
Release files / allratestoday_deepseek-0.2.1.tar.gz
| Download URL | allratestoday_deepseek-0.2.1.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbda9fa01b865b3c3abe2cfb586635a27954cb991891093390cc7aad3d26ffcc
|
|
BLAKE2b-256 checksum How to use checksums |
6f41b479ff85a54346b95029bccc3024a40cd4d147e89d7c8f333ea62295690f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / allratestoday_deepseek-0.2.1-py3-none-any.whl
| Download URL | allratestoday_deepseek-0.2.1-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd2e3fb28220b471afe39d9dc69db3862356f45eb4f245d889f7b07204311347
|
|
BLAKE2b-256 checksum How to use checksums |
059d3406a7a4cfc8966156be3475e1fd0240cae16152d8ed589816ec80bb5486
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|