Skip to content

Commit 1aaddc9

Browse files
[apps/deepseek] add deepseek example
1 parent 223458f commit 1aaddc9

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

.github/workflows/apps-devel.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,7 @@ jobs:
4646
hal9 deploy apps/openai --name openai --access public --url https://api.devel.hal9.com --title OpenAI --description "Makes use of OpenAI O1";
4747
elif [[ "$file" == apps/swarm/* ]]; then
4848
hal9 deploy apps/swarm --name swarm --access public --url https://api.devel.hal9.com --title Swarm --description "Makes use of OpenAI Swarm";
49+
elif [[ "$file" == apps/deepseek/* ]]; then
50+
hal9 deploy apps/deepseek --name deepseek --access public --url https://api.devel.hal9.com --title DeepSeek --description "Makes use of DeepSeek";
4951
fi
5052
done

.github/workflows/apps-prod.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,7 @@ jobs:
4646
hal9 deploy apps/openai --name openai --access public --title OpenAI --description "Makes use of OpenAI O1";
4747
elif [[ "$file" == apps/swarm/* ]]; then
4848
hal9 deploy apps/swarm --name swarm --access public --title Swarm --description "Makes use of OpenAI Swarm";
49+
elif [[ "$file" == apps/deepseek/* ]]; then
50+
hal9 deploy apps/deepseek --name deepseek --access public --title DeepSeek --description "Makes use of DeepSeek";
4951
fi
5052
done

apps/deepseek/app.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from openai import OpenAI
2+
3+
client = OpenAI(
4+
api_key="hal9",
5+
base_url="http://localhost:5000/proxy/server=https://api.deepseek.com")
6+
7+
stream = client.chat.completions.create(
8+
model="deepseek-chat",
9+
messages=[
10+
{"role": "system", "content": "You are a helpful assistant"},
11+
{"role": "user", "content": input()},
12+
],
13+
stream=True
14+
)
15+
16+
for chunk in stream:
17+
if len(chunk.choices) > 0 and chunk.choices[0].delta.content is not None:
18+
print(chunk.choices[0].delta.content, end="")

apps/deepseek/hal9.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
welcome: 👋 I'm DeepSeep 🐳

apps/deepseek/thumbnail.jpg

124 KB
Loading

0 commit comments

Comments
 (0)