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.2.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.2-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepseekfree-0.6.2.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.2.tar.gz
Algorithm Hash digest
SHA256 de7861afdaffc56b17528f176c19c49a07140de8c29f55774faff33c20c13e44
MD5 305bba8ec82b2966642d10783a166e9a
BLAKE2b-256 2ce7bf8ef32bfc1c358f1d0f40b8ba6faad7957c033923f635bd98494a273821

See more details on using hashes here.

File details

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

File metadata

  • Download URL: DeepSeekfree-0.6.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e5ea9cc8a144e0f0f60c38bb32dce3a34301c4e41edc27e08f78f58935311c6d
MD5 6f05347bd7f40f3da1490ea8b0d380ae
BLAKE2b-256 f967a029453e44a1f32df022e6416a1139098b0bdafe85a8fc33698ab868620e

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