Skip to main content

A small example package

Project description

DeepSeek-free

DeepSeek-free 是一个用于与 DeepSeek API 交互的 Python 包。

安装

使用以下命令安装 DeepSeek-free:

pip install DeepSeek-free

使用

以下是如何使用 DeepSeek-free 包的示例:

from deepseek import DeepSeek

# 初始化 DeepSeek 对象
deepseek = DeepSeek(cookies="your_cookies", Authorization="your_authorization_token")

# 创建新的聊天会话
chat_session_id = deepseek.create_chat_session()

# 发送消息并获取回复
response = deepseek.chat(prompt="你好,DeepSeek!", chat_session_id=chat_session_id)
print(response)

# 获取历史消息
history = deepseek.get_history_messages(chat_session_id=chat_session_id)
print(history)

# 列出所有聊天会话
sessions = deepseek.list_session()
print(sessions)

# 删除聊天会话
delete_response = deepseek.delete_session(chat_session_id=chat_session_id)
print(delete_response)

模块

deepseek

包含与 DeepSeek API 交互的主要类 DeepSeek

DeepSeek

  • __init__(self, cookies: str = "", Authorization: str = "")
  • create_chat_session(self, character_id: str = None) -> str
  • chat(self, prompt: str, parent_id: str = None, chat_session_id: str = "", timeout: int = 60, stream: bool = False, image: bytes = None, thinking_enabled: bool = False, search_enabled: bool = False)
  • get_history_messages(self, chat_session_id: str)
  • list_session(self, count: int = 100) -> dict
  • delete_session(self, chat_session_id: str)

errors

包含自定义异常类:

  • DeepSeekErrors
  • FileNotFoundError
  • InvalidFormatError
  • ProcessingError

贡献

欢迎贡献代码!请提交 pull request 或报告问题。

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

deepseekfree-0.6.1.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

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

DeepSeekfree-0.6.1-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file deepseekfree-0.6.1.tar.gz.

File metadata

  • Download URL: deepseekfree-0.6.1.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for deepseekfree-0.6.1.tar.gz
Algorithm Hash digest
SHA256 979d2aaf057c3dd5efd31bbe857ae16ad66a05203ee974f132142dc193d59619
MD5 ddc657cb254f202f527f1fb3797fddcd
BLAKE2b-256 86374316a2ddbf1d4ada0a989b5a3afea7ff9dbcee6c6d7ec9a54003545fbc13

See more details on using hashes here.

File details

Details for the file DeepSeekfree-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: DeepSeekfree-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for DeepSeekfree-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7fd9427e92f8afea1480fbc3621d0b353bb6d41cdf2ee0f1b2843ec8aafaacca
MD5 81314df8a9d4d243f2fe66bf29c4e3c5
BLAKE2b-256 4edea920ef740171cac77409b2874933547103a75f703eb5019c095abd356907

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