Skip to main content

generateTicketSubjectAndPriority

@nmi-agro/fdm-source


@nmi-agro/fdm-source / fdm-agents/src / generateTicketSubjectAndPriority

Function: generateTicketSubjectAndPriority()

generateTicketSubjectAndPriority(body, geminiApiKey?, appName?, posthog?, modelName?): Promise<infer<any>>

Defined in: fdm-agents/src/agents/ticket-triage/agent.ts:115

Analyses a support ticket and returns a concise subject line and priority level.

Passes an empty-body shortcut directly (returns { subject: "Empty Message", priority: "low" }) without calling the LLM.

Parameters

body

string

Raw text of the support ticket message.

geminiApiKey?

string

Optional Gemini API key. Falls back to the GEMINI_API_KEY environment variable.

appName?

string = "FDM (Farm Data Model)"

posthog?

client

any

distinctId

string

modelName?

string

Returns

Promise<infer<any>>

A promise resolving to { subject, priority, reasoning }.

Throws

When the agent produces no structured response.