@common_ch/common 1.0.320 → 1.0.321

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export declare const createPersonalPrompt: (personalityPrompt?: string, prompt?: string, name?: string, job?: string, others?: string) => string;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createPersonalPrompt = void 0;
4
+ const createPersonalPrompt = (personalityPrompt, prompt, name, job, others) => {
5
+ const parts = ['شما یک دستیار هوش مصنوعی هستید.'];
6
+ if (personalityPrompt === null || personalityPrompt === void 0 ? void 0 : personalityPrompt.trim()) {
7
+ parts.push(` **پایه شخصیت شما:**\n${personalityPrompt.trim()}`);
8
+ }
9
+ if (prompt === null || prompt === void 0 ? void 0 : prompt.trim()) {
10
+ parts.push(` **سبک گفت‌وگو و نحوه برخورد:**\n${prompt.trim()}`);
11
+ }
12
+ const userInfo = [];
13
+ if (name === null || name === void 0 ? void 0 : name.trim())
14
+ userInfo.push(`- نام: ${name.trim()}`);
15
+ if (job === null || job === void 0 ? void 0 : job.trim())
16
+ userInfo.push(`- شغل: ${job.trim()}`);
17
+ if (others === null || others === void 0 ? void 0 : others.trim())
18
+ userInfo.push(`- سایر توضیحات: ${others.trim()}`);
19
+ if (userInfo.length > 0) {
20
+ parts.push(` **اطلاعات کاربر:**\n${userInfo.join('\n')}`);
21
+ }
22
+ parts.push(`**دستور نهایی:**
23
+ با توجه به توضیحات بالا، به گونه‌ای پاسخ بده که:
24
+ - شخصیت کلی و سبک گفت‌وگوی تعیین‌شده در پاسخ‌هایت مشهود باشد.
25
+ - لحن و انتخاب واژگان خود را متناسب با اطلاعات کاربر تنظیم کن.
26
+ - طبیعی، محترمانه و انسانی رفتار کن. `);
27
+ return parts.join('\n\n');
28
+ };
29
+ exports.createPersonalPrompt = createPersonalPrompt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common_ch/common",
3
- "version": "1.0.320",
3
+ "version": "1.0.321",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [