Skip to main content

This project supports the calculation of token counts.

Project description

langchain-deepseek-extension

Introduction

This project supports the calculation of token counts.

ref: https://api-docs.deepseek.com/zh-cn/quick_start/token_usage

Examples

from langchain_deepseek_extension.extension import ChatDeepSeekPlus

model = ChatDeepSeekPlus(model="deepseek-chat")

messages = [
    SystemMessage(content="you're a good assistant"),
    HumanMessage(content="hi! I'm bob"),
    AIMessage(content="hi!")
]
num = model.get_num_tokens_from_messages(messages)

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

langchain_deepseek_extension-0.0.8.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

langchain_deepseek_extension-0.0.8-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file langchain_deepseek_extension-0.0.8.tar.gz.

File metadata

File hashes

Hashes for langchain_deepseek_extension-0.0.8.tar.gz
Algorithm Hash digest
SHA256 573e67314a20609cca2af6f22c1aba74e317009f1001ce4b6d2bd93153da4bcc
MD5 4f192c077cc93d127f875d6474ee4b79
BLAKE2b-256 52cfec1b7f24e6cc3c8e387a4f39ac8db7a5ef8e86356b2f21bc426f808dbfc1

See more details on using hashes here.

File details

Details for the file langchain_deepseek_extension-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_deepseek_extension-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d9da6f33be28394a6eaeec98c435e52f4f789440b8ab744dbb414400b093a8f2
MD5 45a84886101055e6a7cbf2f39c510c8b
BLAKE2b-256 907f8528285f44783512c9f5d3b10b58336cf5b189666fd559e6a3162ee415da

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