Source repository that I supplemented - github.com/xtekky/deepseek4free
You can read more about the old features at this link ⤴
DeepSeek4Free but with additional features
- 🗑 Delete Chat Session: It is now possible to delete a chat session so as not to litter DeepSeek chats
- 📤 Upload File: It is now possible to upload a file to DeepSeek and then ask about it
- Clone the repository:
git clone https://github.com/Doremii109/deepseek4free-fix
cd deepseek4free-fix- Install dependencies:
pip install -r requirements.txtfrom dsk.api import DeepSeekAPI
# Initialize with your auth token
api = DeepSeekAPI("YOUR_AUTH_TOKEN")
# Create a new chat session
chat_id = api.create_chat_session()
# Simple chat completion
prompt = "What is Python?"
for chunk in api.chat_completion(chat_id, prompt):
if chunk['type'] == 'text':
print(chunk['content'], end='', flush=True)
# Delete the current session
api.delete_chat_session(chat_id)Upload File allows you to upload a file to DeepSeek, and then ask for something related to it.
However, this feature does not support Web Search Integration (this is already a limitation of DeepSeek itself).
You can also upload only 1 file at a time (I was too lazy to add the ability to upload more than 1 file).
from dsk.api import DeepSeekAPI
client = DeepSeekAPI("DEEPSEEK_API_KEY")
# The function allows you to upload almost any file to DeepSeek
files_id = client.upload_file("very_interesting_history.txt")
chat_id = client.create_chat_session()
"""
In 'ref_file_ids', you must pass the id of the file that you uploaded earlier.
"""
promt = 'What is this file about?'
for chunk in client.chat_completion(chat_id, promt, ref_file_ids=files_id, thinking_enabled=False, search_enabled=False):
if chunk['type'] == 'text':
print(chunk['content'], end='', flush=True)
client.delete_chat_session(chat_id)