fix ask-ai prompt userdata

This commit is contained in:
2025-06-22 00:01:27 +09:00
parent 169de9064a
commit 09100f6d99
2 changed files with 6 additions and 2 deletions

View File

@ -125,7 +125,7 @@ export default function CommentForm({ user, agent, onCommentPosted }) {
disabled={loading || !text.trim()}
className={`btn ${loading ? 'btn-outline' : 'btn-primary'}`}
>
{loading ? 'posting...' : 'post comment'}
{loading ? 'posting...' : 'post'}
</button>
</div>
</form>

View File

@ -25,8 +25,12 @@ export function useAskAI(adminData, userProfile, agent) {
try {
logger.log('Sending question to Ollama:', question)
// ユーザー情報を含むシステムプロンプトを構築
const userInfo = userProfile ? `相手の名前は${userProfile.displayName || userProfile.handle}です。` : ''
const enhancedSystemPrompt = `${aiConfig.systemPrompt} ${userInfo}`
// Ollamaに直接リクエスト送信oauth_oldと同じ方式
const prompt = `${aiConfig.systemPrompt}
const prompt = `${enhancedSystemPrompt}
Question: ${question}