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:
@@ -16,11 +16,16 @@ export interface AiChatResponse {
|
||||
export async function sendAiMessage(
|
||||
message: string,
|
||||
history?: AiChatMessage[],
|
||||
patientId?: string,
|
||||
): Promise<AiChatResponse> {
|
||||
const resp = await api.post<AiChatResponse>('/ai/chat', {
|
||||
const body: Record<string, unknown> = {
|
||||
message,
|
||||
history: history?.slice(-10),
|
||||
});
|
||||
};
|
||||
if (patientId) {
|
||||
body.patient_id = patientId;
|
||||
}
|
||||
const resp = await api.post<AiChatResponse>('/ai/chat', body);
|
||||
return resp;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user