@pheme-ai/chat
v0.2.0
Published
Angular chat UI primitives and streaming client services for AI chat applications.
Downloads
144
Maintainers
Readme
@pheme-ai/chat
Angular chat primitives for prototyping AI chat applications with Pheme.
The package contains reusable standalone components, models, services, and stream parsing helpers. It is designed to be used directly in product prototypes or through the demo pages exported from per-page secondary entrypoints.
Exports
Primary entrypoint @pheme-ai/chat:
provideChatandCHAT_CONFIGfor API and route configuration.ChatComposerfor message input.ChatSidenavfor chat navigation shells.MessageListfor rendering user and assistant messages.- Chat models including
Message,UserMessage,AssistantMessage, andChatSummary. ChatClientandChatStorefor API access and UI state orchestration.parseJsonLinesfor NDJSON response streams.
Secondary entrypoint @pheme-ai/chat/pages/home:
HomePagefor starting a new chat.
Secondary entrypoint @pheme-ai/chat/pages/chat:
ChatPagefor displaying and continuing an existing chat.
API Expectations
The default configuration uses /api as the base URL and expects endpoints compatible with the root workspace OpenAPI contract:
GET /chatsPOST /chatsGET /chats/{chatId}/messagesPOST /chats/{chatId}/messages
Create and send operations stream newline-delimited JSON events so the UI can show saved user messages, in-progress assistant responses, deltas, completion, and errors.
Configuration
Register the package in the consuming application configuration:
import { provideChat } from '@pheme-ai/chat';
export const appConfig = {
providers: [provideChat({ apiBaseUrl: '/api' })],
};Available configuration fields:
apiBaseUrl- base URL for chat API requests.chatPath- router commands used for existing chat links.newChatPath- router commands used for starting a new chat.
ChatSidenav also accepts title and brandLogoUrl inputs so a demo shell can carry the consuming app's brand without forking the component.
Build And Test
From the workspace root:
ng build @pheme-ai/chat
ng test @pheme-ai/chatStatus
This package is optimized for fast prototyping rather than a frozen public API. Prefer small, composable imports when building experiments and use the demo app to validate layout, accessibility, and streaming behavior.
