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) -> strchat(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) -> dictdelete_session(self, chat_session_id: str)
errors
包含自定义异常类:
DeepSeekErrorsFileNotFoundErrorInvalidFormatErrorProcessingError
贡献
欢迎贡献代码!请提交 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.3.tar.gz
(20.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deepseekfree-0.6.3.tar.gz.
File metadata
- Download URL: deepseekfree-0.6.3.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9626cde835dc969bd248fd93c2bb593c83fcc90a52a9e483b08b20fc7c17179
|
|
| MD5 |
f3e2c51fd8ebb1baef4cb562c392b323
|
|
| BLAKE2b-256 |
c6266bb46cd1187056c2d49b115dc353efbe21eaa676b4bdb7ab15f6636c9c34
|
File details
Details for the file DeepSeekfree-0.6.3-py3-none-any.whl.
File metadata
- Download URL: DeepSeekfree-0.6.3-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bdf33ea8ef3c05fea3966cca46b412fc61522d48ac870f41da098c78ad7a9ff
|
|
| MD5 |
38cd5fb7be16d2b9ecfc39656e921758
|
|
| BLAKE2b-256 |
55315886f93113997b05da28c8c51c29e53ed15dd36b562cb2c1e41d74ab0e21
|