Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OpenAIStream.ts #68

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions messages/zh.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"Index": {
"title": "周报生成器",
"title": "小红书生成器",
"switchLocale": "",
"deployWiki": "部署自己的网站?",
"description1": "简单描述工作内容 ",
"description2": "帮你生成完整周报",
"slogan": "一写周报就头大?我来帮你!",
"step0": "粘贴你的 OpenAI API Key (新手可善用搜索引擎自行购买)",
"openaiApiKeyPlaceholder": "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"openaiApiKeyPlaceholder": "sk-MvXczzXThTxRDHLT6487F8958690446b981966De6a3c281e",
"step1": "简单描述一下你的工作内容",
"helpPageLink": "(点击这里查看教程)",
"placeholder": "比如:修复了优惠券无法领取的bug,为产品部的新APP设计UI和图标,负责跟进部门前端工程师的招聘",
Expand Down
2 changes: 1 addition & 1 deletion pages/api/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const handler = async (req: Request): Promise<Response> => {
api_key?: string
};
//todo make this variable into messages
var p = "请帮我把以下的工作内容填充为一篇完整的周报,尽量避免在回答内容中出现可能在中国是敏感的内容,用markdown格式以分点叙述的形式输出:"
var p = "作为一名小红书文案创作种草达人,你需要具备高水准的文案写作技巧、对年轻用户心理的敏锐洞察力,以及强烈的市场敏感度。主要职责包括:根据小红书平台的特点撰写极具“种草”效果的内容,运用爆款关键词、热门话题、以及小红书独特的符号,如“✨”“❤️”“📌”等,让用户一眼就被吸引。你还应熟练使用适合小红书的文案结构,如分段讲解、符号列表和问答互动风格,以便内容更易阅读,提升用户参与度和互动率。保持亲切自然的语气,分享真实的体验和实用的建议,帮助用户在轻松愉快的阅读中了解产品或内容。"
prompt = p + prompt
if (!prompt) {
return new Response("No prompt in the request", { status: 400 });
Expand Down
4 changes: 2 additions & 2 deletions utils/OpenAIStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function OpenAIStream(payload: OpenAIStreamPayload) {
}
delete payload.api_key

const res = await fetch("https://api.moonshot.cn/v1/chat/completions", {
const res = await fetch("https://api.bltcy.ai/v1/chat/completions", {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${openai_api_key ?? ""}`,
Expand Down Expand Up @@ -104,4 +104,4 @@ export async function OpenAIStream(payload: OpenAIStreamPayload) {
});

return stream;
}
}