osvi_chat 0.3.1
osvi_chat: ^0.3.1 copied to clipboard
Embed an Osvi AI chat agent in a Flutter app: a headless chat client and drop-in chat widgets.
Changelog #
0.3.1 #
- Channel: a new chat tells the platform it runs in a mobile app (
channel: "app"on session create), so the dashboard shows it as a Mobile app chat and it stays separate from the same customer's website or WhatsApp chat. A platform that predates the field ignores it. - Call reception: a guest calls their property's front desk from the chat. When the server says the chat may call (
call_receptionin the snapshot), a phone button shows in the header; tapping it rings the guest's own phone, then the front desk. A bar under the header says which number will ring, follows the call, and shows how it ended. No native code or permission: it is an ordinary phone call. New:OsviChatClient.callReception,endCall,dismissCall,ChatState.callReception,ChatState.call,CallReceptionConfig,ReceptionCall,CallOutcome,showCallReceptiononOsviChatView, and thecall…strings.
0.3.0 #
- Attachments: visitors can send a photo (library or camera) or a PDF, with an optional caption, when the agent accepts them (
agent.attachmentsfrom the server). The paperclip sits in the composer, a preview with its size shows before sending, photos and PDFs show in the conversation (a photo opens full screen), and expired files say so. Photos are resized and re-encoded on the device. New:OsviChatClient.sendAttachment,attachmentRefusal,refreshAttachments,Message.attachment,ChatAgent.attachments, andattachmentPickeronOsviChatViewandOsviChatLauncher(OsviAttachmentPicker,DefaultAttachmentPicker). Adds theimage_pickerandfile_selectordependencies; see the README for the iOS and macOS setup. Photos are sent without their location, camera or other metadata (EXIF, XMP, IPTC), whichever picker supplied them; only the orientation is kept.
0.2.0 #
- Look: cards read as part of the conversation. The question is an agent bubble and the options sit open beneath it, with no box around them: chips are soft tinted pills, list options are clean tiles, a carousel card stands on its own, and the date picker keeps a light calendar panel. An answered card shows the choice with a check mark.
- Look: a messaging-app composer: a pill-shaped field and a round send button with a paper-plane icon. With nothing to send, the button stays visible, only dimmed.
- Header buttons:
headerActionsonOsviChatView,OsviChatLauncherandOsviChatLauncher.openadds up to two app buttons (OsviChatHeaderAction) to the header, before the chat's own. On a narrow phone, where two would squeeze the title, they fold into a More menu (moreActionsstring). - Connection: the chat connection now closes cleanly (code 1000, reason
background) when the app goes to the background (hiddenorpaused, notinactive), and reconnects when it returns, loading any replies sent meanwhile. The server then knows the visitor is away, so amessage_creatednotify hook can trigger a push notification. A message sent just before leaving gets up to 3 s to be confirmed first. Turn it off withdisconnectInBackground: falseonOsviChatClient.createorChatClientOptions. - Client:
OsviChatClient.sessionId()is now documented: it returns the current session id, to match a push notification'ssession_id. - Fix: the launcher's unread badge no longer counts replies the visitor has already read. History that loads on start, with a new client or after a reconnect used to show as unread (for example 13 after reopening the app). The badge now counts only replies newer than the newest one seen with the chat open, kept on the device (
osvi.chat.seen.<agentId>, the web widget's key).OsviChatClient.unreadCount()andmarkSeen()expose the same count for custom launchers. - Custom page signals: a
PageSignalsimplementation can also implement the newPageBackgroundSignalsto get the background close. Existing implementations compile unchanged. - Look: the header's new chat button now uses the web SDK's icon (a chat bubble with a plus) instead of Material's
edit_square, so both SDKs match. - Fix: after New chat with history kept, the welcome options start fresh. They no longer show the choice made in the previous session, and can be picked again.
- Fix: the slider carousel (
ui_carousel) shows each card whole, at its own height, as the web SDK does. A fixed height cut off cards with an image, a two-line title or a longer description, often including the Select button. Swipe or use the arrows to move one card at a time. With many cards, the position dots wrap instead of running past the edge of the screen. - Fix: links in agent and team member replies open when tapped. They were drawn as links but did not respond.
0.1.1 #
- Fix: the full-screen chat (
OsviChatLauncherandOsviChatLauncher.open) now moves above the on-screen keyboard, so the composer stays visible while typing. - Fix: the "Powered by Osvi AI" footer stays clear of the system navigation bar.
0.1.0 #
- First Flutter port of
@osvi-ai/chatv0.1.6:- Client: the headless
OsviChatClient, in anonymous and server mode. - Connection: pings, token rotation, backoff, resending unconfirmed messages, and history recovery.
- Cards: buttons v1/v2, carousel and date picker.
- Server features: reactions, typing indicators, limits, the pre-chat form, WhatsApp hand-off, and appearance settings from the server.
- Client: the headless
- Widgets:
OsviChatViewandOsviChatLauncher, with theming (light, dark or auto) and overridable strings. - Tests: the web SDK's core, protocol and contract tests are ported test for test.