Files
saherelm 1c0d802727 Document RAG Jinja Role Fix and Current Workspace Changes (۱۴۰۵/۰۸/۰۴ v01)
- Add Documents/Docs/ChangeLogs/1405-08-04-v01.html;
- Add Documents/Docs/ChangeLogs/CommitMessage-1405-08-04-v01.txt;
- Record the XAIServiceBase fix and its successful build validation;
- Record other currently modified submodules and uncommitted files;
- Record the security warning for Documents/Resources/Json/Authenticate.json.
2026-10-26 10:45:41 +03:30

22 lines
8.1 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="fa" dir="rtl">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<title>ChangeLog ۱۴۰۵/۰۸/۰۴ v01 - xSaherelmWorkspace</title>
<style>
:root{--p:#173b78;--s:#2563eb;--bg:#f4f7fb;--line:#dbe3ef;--ok:#087f5b;--warn:#b45309;--danger:#b91c1c}*{box-sizing:border-box}body{margin:0;padding:24px;background:linear-gradient(135deg,#eef4ff,#f8fafc);color:#172033;font-family:Tahoma,"Segoe UI",sans-serif;line-height:1.9}.wrap{max-width:1180px;margin:auto;background:#fff;border-radius:16px;box-shadow:0 12px 40px #20386422;overflow:hidden}.hero{padding:38px;background:linear-gradient(135deg,var(--p),var(--s));color:#fff}.hero h1{margin:0 0 8px;font-size:2em}.hero p{margin:4px 0}.meta{display:flex;gap:24px;flex-wrap:wrap;padding:16px 30px;background:#f8fafc;border-bottom:1px solid var(--line);color:#53627a}.meta strong{color:var(--p)}main{padding:30px}.section{margin-bottom:26px;padding:22px;background:var(--bg);border-right:5px solid var(--s);border-radius:10px}.section h2{margin:0 0 15px;color:var(--p);font-size:1.35em;border-bottom:1px solid var(--line);padding-bottom:8px}.section h3{color:var(--s);margin:18px 0 8px}table{width:100%;border-collapse:collapse;background:#fff;margin:12px 0}th,td{text-align:right;vertical-align:top;padding:10px 12px;border-bottom:1px solid var(--line)}th{background:var(--p);color:#fff}code{direction:ltr;display:inline-block;background:#e7edf6;border-radius:4px;padding:0 5px;font-family:Consolas,monospace;font-size:.9em}pre{direction:ltr;text-align:left;overflow:auto;background:#172033;color:#e7eefc;border-radius:7px;padding:14px;font-family:Consolas,monospace}.note,.warn,.danger{padding:13px 16px;border-radius:7px;margin-top:12px}.note{background:#eff6ff;border-right:4px solid var(--s)}.warn{background:#fff7ed;border-right:4px solid var(--warn)}.danger{background:#fef2f2;border-right:4px solid var(--danger)}.badge{display:inline-block;color:#fff;border-radius:15px;padding:1px 10px;font-size:.8em}.mod{background:var(--warn)}.new{background:var(--ok)}.sub{background:var(--s)}footer{text-align:center;color:#68758a;padding:18px;border-top:1px solid var(--line);font-size:.9em}@media(max-width:700px){body{padding:8px}main{padding:15px}.hero{padding:25px}.meta{padding:13px 18px}}
</style>
</head>
<body><div class="wrap">
<header class="hero"><h1>گزارش تغییرات ساختار پروژه</h1><p>xSaherelmWorkspace | تاریخ: ۱۴۰۵/۰۸/۰۴ (2026-10-26) | نسخه مستند: <strong>v01</strong></p><p>موضوع اصلی: اصلاح تاریخچه پیام‌های RAG و رفع خطای Jinja در <code>XAIServiceBase</code></p></header>
<div class="meta"><span><strong>دامنه:</strong> workspace و ساب‌ماژول‌های دارای تغییر محلی</span><span><strong>وضعیت:</strong> تغییرات هنوز commit نشده‌اند</span><span><strong>مستند بعدی:</strong> افزایش v01 به v02</span></div>
<main>
<section class="section"><h2>۱. خلاصه اجرایی</h2><p>بررسی کل workspace و وضعیت Git نشان داد تغییرات محلی در مخزن اصلی، ساب‌ماژول <code>xAiApi</code> و ساب‌ماژول <code>Modules/xAiService</code> وجود دارد. اصلاح اصلی این گزارش مربوط به خطای <code>Conversation roles must alternate user/assistant/user/assistant/...</code> است. علت، ایجاد دو پیام <code>System</code> پشت‌سرهم در تاریخچهٔ RAG بود.</p><table><tr><th>شاخص</th><th>نتیجه</th></tr><tr><td>تاریخ و نسخه</td><td>۱۴۰۵/۰۸/۰۴ — v01</td></tr><tr><td>فایل اصلی</td><td><code>xAiApi/Providers/XAIServiceBase.cs</code></td></tr><tr><td>اعتبارسنجی</td><td>Build موفق با مسیر خروجی جداگانه؛ ۸۴ هشدار پروژه</td></tr><tr><td>سایر تغییرات</td><td>Vector Store، دو کنترلر جدید، احراز هویت و فرمت xAiService</td></tr></table></section>
<section class="section"><h2>۲. تغییر اصلی: رفع خطای Jinja</h2><h3><span class="badge mod">اصلاح‌شده</span> xAiApi/Providers/XAIServiceBase.cs</h3><ul><li>در <code>GetContextHistory</code>، Introduction، پرامپت RAG و Context در یک پیام واحد با نقش <code>System</code> ادغام شد.</li><li>سؤال کاربر با نقش <code>User</code> پس از آن قرار گرفت.</li><li>ساختار خروجی: <code>System → User</code>؛ دیگر دو <code>System</code> متوالی ارسال نمی‌شود.</li><li>کامنت XML متد مطابق ساختار جدید به‌روزرسانی شد.</li></ul><pre>System: Introduction + RAG Prompt + Context
User: User Prompt</pre><p class="note"><strong>اثر مورد انتظار:</strong> قالب‌های Jinja مدل‌های Ollama/llama.cpp درخواست <code>AskWithContextAsync</code> را به‌دلیل نقش‌های متوالی نامعتبر رد نمی‌کنند.</p></section>
<section class="section"><h2>۳. سایر تغییرات موجود در وضعیت Git</h2><table><tr><th>نوع</th><th>مسیر</th><th>شرح</th></tr><tr><td><span class="badge mod">تغییر</span></td><td><code>xAiApi/Providers/XInMemoryVectorStore.cs</code></td><td>نتیجهٔ مرتب‌شده و محدودشده ابتدا در <code>result</code> قرار می‌گیرد و سپس return می‌شود؛ تغییر رفتاری عمده‌ای گزارش نشده است.</td></tr><tr><td><span class="badge new">جدید</span></td><td><code>xAiApi/Controllers/AccountController.cs</code></td><td>فایل جدید مشاهده‌شده؛ خارج از اصلاح Jinja.</td></tr><tr><td><span class="badge new">جدید</span></td><td><code>xAiApi/Controllers/TestIdentity.cs</code></td><td>فایل تست/کنترلر جدید؛ خارج از اصلاح Jinja.</td></tr><tr><td><span class="badge mod">تغییر</span></td><td><code>Modules/xAiService/Helpers/VectorHelper.cs</code></td><td>صرفاً شکستن امضای <code>CosineSimilarity</code> در چند خط؛ تغییر محاسباتی مشاهده نشد.</td></tr><tr><td><span class="badge mod">تغییر</span></td><td><code>Documents/Resources/Json/Authenticate.json</code></td><td>توکن‌های احراز هویت و اطلاعات Session/Vector جدید ثبت شده است.</td></tr><tr><td><span class="badge sub">ساب‌ماژول</span></td><td><code>xAiApi</code> و <code>Modules/xAiService</code></td><td>هر دو دارای تغییرات محلی commit‌نشده هستند و pointer مخزن اصلی نیز تغییر کرده است.</td></tr></table><div class="danger"><strong>هشدار امنیتی:</strong> <code>Authenticate.json</code> حاوی access token و refresh token است. پیش از commit عمومی، اعتبار توکن‌ها بررسی و در صورت نیاز revoke/حذف شوند؛ مقدارهای حساس در این گزارش تکرار نشده‌اند.</div></section>
<section class="section"><h2>۴. اعتبارسنجی و دستورات بررسی</h2><ul><li>Build مستقیم ابتدا به‌دلیل قفل DLL توسط Visual Studio Debug Adapter شکست خورد.</li><li>Build دوم با خروجی جداگانه موفق شد: <strong>Build succeeded with 84 warning(s)</strong>.</li><li>هشدارها عمدتاً مربوط به <code>netcoreapp3.1</code> منسوخ، اختلاف نسخه پکیج‌ها و آسیب‌پذیری AngleSharp هستند.</li></ul><pre>dotnet build xAiApi/xAiApi.csproj --no-restore --nologo -p:OutDir=Documents/Temp/xAiApiBuild/</pre></section>
<section class="section"><h2>۵. روش ادامه شماره‌گذاری</h2><p>این گزارش با پسوند <code>v01</code> ثبت شده است. برای مستندسازی بعدی در همین تاریخ، فایل با پسوند <code>v02</code> و پس از آن با افزایش عدد نسخه تولید شود.</p><p><strong>Commit message همراه:</strong> <code>Documents/Docs/ChangeLogs/CommitMessage-1405-08-04-v01.txt</code></p></section>
</main><footer>تولیدشده در تاریخ ۱۴۰۵/۰۸/۰۴ (2026-10-26) | xSaherelmWorkspace | ChangeLog v01</footer>
</div></body></html>