140 lines
4.4 KiB
JavaScript
140 lines
4.4 KiB
JavaScript
const { createPersonalExecutors, AUTH_PERSONAL_TOOLS } = require('./personal.tools');
|
|
const { createProgrammeExecutors } = require('./programme.tools');
|
|
const { createOnsiteExecutors } = require('./onsite.tools');
|
|
const { createActionExecutors, AUTH_ACTION_TOOLS } = require('./actions.tools');
|
|
|
|
const AUTH_REQUIRED_TOOLS = new Set([...AUTH_PERSONAL_TOOLS, ...AUTH_ACTION_TOOLS]);
|
|
|
|
function toolSpec(name, description, properties = {}, required = []) {
|
|
return {
|
|
toolSpec: {
|
|
name,
|
|
description,
|
|
inputSchema: {
|
|
json: {
|
|
type: 'object',
|
|
properties,
|
|
required,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
const conciergeTools = [
|
|
toolSpec(
|
|
'get_my_tickets',
|
|
"This attendee's ticket tier, registration status, payment, check-in, and QR. No arguments. Never invent another person's booking.",
|
|
),
|
|
toolSpec(
|
|
'get_my_agenda',
|
|
"This attendee's saved/bookmarked sessions and any time conflicts. No arguments.",
|
|
),
|
|
toolSpec(
|
|
'email_my_ticket',
|
|
'Email the attendee their ticket QR using the registered email. No arguments.',
|
|
),
|
|
toolSpec(
|
|
'get_agenda',
|
|
'Event programme: sessions happening now, next, on a date, by track, speaker, or session name. Include materials when they ask for slides.',
|
|
{
|
|
when: {
|
|
type: 'string',
|
|
description: 'now | next | date, or omit for a general lookup',
|
|
},
|
|
date: { type: 'string', description: 'YYYY-MM-DD if they named a day' },
|
|
track: { type: 'string', description: 'Track or stage name' },
|
|
speaker: { type: 'string', description: 'Speaker name when asking when they speak' },
|
|
topic: { type: 'string', description: 'Topic or keyword' },
|
|
session_name: { type: 'string', description: 'Specific session title' },
|
|
},
|
|
),
|
|
toolSpec(
|
|
'get_speakers',
|
|
'Speaker lineup or a named speaker bio / public socials / meet-and-greet.',
|
|
{
|
|
name: { type: 'string', description: 'Speaker name; omit to list the lineup' },
|
|
},
|
|
),
|
|
toolSpec(
|
|
'get_exhibitors',
|
|
'Exhibitor booth, category list, or demo notes. Meeting booking is not available in chat.',
|
|
{
|
|
company: { type: 'string', description: 'Exhibitor / company name' },
|
|
category: { type: 'string', description: 'Industry or category' },
|
|
},
|
|
),
|
|
toolSpec(
|
|
'get_venue',
|
|
'Venue map, halls, amenities, parking/shuttle, travel from a city, meals policy, accessibility.',
|
|
{
|
|
query: { type: 'string', description: 'What they asked about the venue' },
|
|
origin: { type: 'string', description: 'Origin city when asking how to reach the venue' },
|
|
},
|
|
['query'],
|
|
),
|
|
toolSpec(
|
|
'get_local',
|
|
'Hotels and nearby tourist places cached for this event city.',
|
|
{
|
|
kind: { type: 'string', description: 'hotels | places | auto' },
|
|
query: { type: 'string', description: 'What they asked (e.g. temples, nearby stay)' },
|
|
},
|
|
),
|
|
toolSpec(
|
|
'get_tech_help',
|
|
'Wi-Fi network/password from FAQs, streaming/AV tips, or app login help. Never invent credentials.',
|
|
{
|
|
query: { type: 'string', description: 'Wi-Fi, streaming, login, or app feature' },
|
|
},
|
|
['query'],
|
|
),
|
|
toolSpec(
|
|
'search_faqs',
|
|
'Event policy FAQs: dress code, refunds, how to register, lost-and-found desk, leftover logistics not covered by other tools.',
|
|
{
|
|
query: { type: 'string', description: 'The policy or logistics question' },
|
|
},
|
|
['query'],
|
|
),
|
|
toolSpec(
|
|
'save_session',
|
|
'Save a programme session to the attendee personal agenda.',
|
|
{
|
|
query: { type: 'string', description: 'Session title if they named one; omit to use the last shown sessions' },
|
|
},
|
|
),
|
|
toolSpec(
|
|
'remove_saved_session',
|
|
'Remove a saved session from the attendee personal agenda.',
|
|
{
|
|
query: { type: 'string', description: 'Session title if they named one; omit to use the last shown sessions' },
|
|
},
|
|
),
|
|
toolSpec(
|
|
'contact_organizer',
|
|
'Notify organizers / share public organizer contact. Use for talk-to-human, lost-and-found, or medical/safety emergencies. No medical advice.',
|
|
{
|
|
reason: {
|
|
type: 'string',
|
|
description: 'help | lost_and_found | emergency',
|
|
},
|
|
},
|
|
),
|
|
];
|
|
|
|
function createToolExecutors(ctx) {
|
|
return {
|
|
...createPersonalExecutors(ctx),
|
|
...createProgrammeExecutors(ctx),
|
|
...createOnsiteExecutors(ctx),
|
|
...createActionExecutors(ctx),
|
|
};
|
|
}
|
|
|
|
module.exports = {
|
|
conciergeTools,
|
|
createToolExecutors,
|
|
AUTH_REQUIRED_TOOLS,
|
|
};
|