feat(mp): AI 聊天传递 patient_id 支持体征数据查询 Tool Call
- ai-chat service: sendAiMessage 新增 patientId 可选参数 - messages 页面: 从 authStore 获取 currentPatient.id 传入 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,7 @@ function genId(): string {
|
||||
|
||||
export default function Messages() {
|
||||
const user = useAuthStore((s) => s.user);
|
||||
const currentPatient = useAuthStore((s) => s.currentPatient);
|
||||
const modeClass = useElderClass();
|
||||
const [messages, setMessages] = useState<AiChatMessage[]>([]);
|
||||
const [inputText, setInputText] = useState('');
|
||||
@@ -70,7 +71,7 @@ export default function Messages() {
|
||||
scrollToBottom(next);
|
||||
|
||||
try {
|
||||
const resp = await sendAiMessage(content, next);
|
||||
const resp = await sendAiMessage(content, next, currentPatient?.id);
|
||||
const aiMsg: AiChatMessage = {
|
||||
id: resp.message_id || genId(),
|
||||
role: 'assistant',
|
||||
|
||||
Reference in New Issue
Block a user