aidk-angular
v0.1.8
Published
Angular bindings for AIDK
Downloads
14
Readme
aidk-angular
Angular services and components for AIDK.
Installation
pnpm add aidk-angular aidk-clientUsage
Setup
// main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { provideEngine } from 'aidk-angular';
import { AppComponent } from './app/app.component';
bootstrapApplication(AppComponent, {
providers: [
provideEngine({
baseUrl: 'http://localhost:3000',
}),
],
});Using Services
import { Component, inject } from '@angular/core';
import { EngineService, ExecutionService } from 'aidk-angular';
@Component({
selector: 'app-chat',
template: `
<div *ngFor="let msg of execution.messages$ | async">
{{ msg.content }}
</div>
<input (keydown.enter)="send($event)" />
`
})
export class ChatComponent {
private engine = inject(EngineService);
protected execution = inject(ExecutionService);
ngOnInit() {
this.engine.updateConfig({ userId: 'user-123' });
this.execution.initialize('assistant');
}
send(event: KeyboardEvent) {
const input = event.target as HTMLInputElement;
this.execution.sendMessage(input.value);
input.value = '';
}
}Key Exports
Services
EngineService- Client managementExecutionService- Agent executionChannelsService- Real-time channels
Components
ContentBlockComponent- Render content blocksTextBlockComponent- Text contentToolUseBlockComponent- Tool call displayToolResultBlockComponent- Tool result display
Providers
provideEngine()- Configure the engine
Documentation
See the full documentation.
