Skip to main content

Plug real-time currency exchange rates into DeepSeek chat/agents via function calling — powered by the AllRatesToday API.

Project description

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

  1. You send DeepSeek a question.
  2. The agent calls chat.completions.create(..., tools=TOOLS) — DeepSeek receives all 5 tool schemas.
  3. If DeepSeek decides it needs a rate, it emits a tool_call (e.g. get_exchange_rate(source="USD", target="EUR")).
  4. The agent runs the tool against the AllRatesToday API and passes the JSON result back.
  5. 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

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

allratestoday_deepseek-0.2.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

allratestoday_deepseek-0.2.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file allratestoday_deepseek-0.2.1.tar.gz.

File metadata

  • Download URL: allratestoday_deepseek-0.2.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for allratestoday_deepseek-0.2.1.tar.gz
Algorithm Hash digest
SHA256 bbda9fa01b865b3c3abe2cfb586635a27954cb991891093390cc7aad3d26ffcc
MD5 89502990182e1d4e8f68a5d2a58f28ad
BLAKE2b-256 6f41b479ff85a54346b95029bccc3024a40cd4d147e89d7c8f333ea62295690f

See more details on using hashes here.

File details

Details for the file allratestoday_deepseek-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for allratestoday_deepseek-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd2e3fb28220b471afe39d9dc69db3862356f45eb4f245d889f7b07204311347
MD5 97b51855f3053ffb4fc617cba0cc0608
BLAKE2b-256 059d3406a7a4cfc8966156be3475e1fd0240cae16152d8ed589816ec80bb5486

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page