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

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepseekfree-0.6.0.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.0.tar.gz
Algorithm Hash digest
SHA256 b34995a86869f52b32013c198d0d44bd12a8e3b6fe900f05b816f80569b45177
MD5 d43a070b2183ef2f7870d87a7a71a823
BLAKE2b-256 f6b5743f9b9afacfbb960c426f25633670e0daeff9c4e437800716d86177a210

See more details on using hashes here.

File details

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

File metadata

  • Download URL: DeepSeekfree-0.6.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dce74ed0e937de0952654d546996a02e03e01eb10c30dab7f69337c5f042ce84
MD5 4267a93eca6b056d3d0542a4f2deed68
BLAKE2b-256 ea75b48e17a42f1e3c08d3b053282011df6ad0568cb4483c3cd5dd9e1f702315

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