Skip to main content

A small example package

Project description

DeepSeek-free

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

安装

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

pip install .

使用

以下是如何使用 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 或报告问题。

许可证

此项目使用 MIT 许可证。

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.5.0.tar.gz (7.4 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.5.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for deepseekfree-0.5.0.tar.gz
Algorithm Hash digest
SHA256 499ffcd46d7fd271735df4884b0e2b926fad6e440b0ae343ff5d704bde24eb9c
MD5 41717231486bb548572cfa2eeba4f8e8
BLAKE2b-256 bcffaa1a4f78abcd280069ed0579db46e22a3655f2cf59e4ce8ff96928a86d76

See more details on using hashes here.

File details

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

File metadata

  • Download URL: DeepSeekfree-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b148d304045ff1ddf8d66f78b968957bbb85add2d6831c6c0c5b251da626310
MD5 97646734266dc897a84d1c2e9bd9702b
BLAKE2b-256 345b79fef7f1b0be387607b74e3d1ff367ba19a0fa7a719a4b3f538fc070751e

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