UNPKG

@adonis-agora/agent

Version:

Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.

44 lines • 2.08 kB
import React from 'react'; export interface ChatInputProps { onSubmit: (text: string) => void; disabled?: boolean; placeholder?: string; rows?: number; /** Enable the dictation mic button (Web Speech API). Default `true`. */ enableSpeech?: boolean; /** BCP-47 locale for dictation. Default `en-US`. */ speechLang?: string; /** Label/content for the send button. Default `"Send"`. */ sendLabel?: React.ReactNode; /** * Cancel the turn in flight — wire to `useAgentChat`'s `cancel`. Rendered only alongside * `isStreaming`, so the affordance exists exactly while there is something to cancel. */ onStop?: () => void | Promise<void>; /** Whether a turn is currently in flight. Gates the stop affordance. */ isStreaming?: boolean; /** Label/content for the stop button. Default `"Stop generating"` — the mic's own is `"Stop"`. */ stopLabel?: React.ReactNode; /** Wrapper class. The component ships no styles of its own. */ className?: string; textareaClassName?: string; sendButtonClassName?: string; micButtonClassName?: string; stopButtonClassName?: string; /** * Custom mic affordance. Receives `isListening`; return any node. When * omitted a plain text button ("Speak" / "Stop") is rendered. */ renderMic?: (state: { isListening: boolean; }) => React.ReactNode; } /** * Styling-agnostic chat composer. Enter submits, Shift+Enter inserts a * newline. Optional dictation streams interim transcripts into the draft * and commits finalized chunks, and `onStop` surfaces the backend's * cancel next to send. No design-system or icon-library deps — * style it entirely through the `*ClassName` props. */ export declare function ChatInput({ onSubmit, disabled, placeholder, rows, enableSpeech, speechLang, sendLabel, onStop, isStreaming, stopLabel, className, textareaClassName, sendButtonClassName, micButtonClassName, stopButtonClassName, renderMic, }: ChatInputProps): React.JSX.Element; //# sourceMappingURL=chat-input.d.ts.map