Skip to content

Commit

Permalink
✨ feat(appointment-slack): add AI analysis for appointment data befor…
Browse files Browse the repository at this point in the history
…e sending to Slack
  • Loading branch information
sakiila committed Feb 5, 2025
1 parent c6f79b9 commit 5f8c71c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions lib/database/services/appointment-slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,7 @@ async function getAiMessage(appointmentData: any) {
const analysis = gptResponse.choices[0].message.content;

// 添加 GPT 分析结果
return [{
type: 'divider',
},
return [
{
type: 'header',
text: {
Expand All @@ -515,17 +513,10 @@ async function getAiMessage(appointmentData: any) {
type: 'section',
text: {
type: 'mrkdwn',
text: analysis,
text: `${analysis}(AI-generated, for reference only)`,
},
},
{
type: 'section',
text: {
type: 'mrkdwn',
text: 'AI-generated, for reference only.',
},
},
];
];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion pages/api/test/appointment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)

// const result = await queryByAppointmentId(appointmentId);

await sendAppointmentToSlack(appointmentId, 'U03FPQWGTN2', 'C067ENL1TLN', '');
await sendAppointmentToSlack(appointmentId, 'U03FPQWGTN2', 'C067ENL1TLN', '1738765257.776969');

res.status(200).json({
success: true,
Expand Down

0 comments on commit 5f8c71c

Please sign in to comment.