This project is a comprehensive application showcasing Essential JS 2 Angular components integrated with AI features.
This application utilizes the latest packages and requires Node.js version
v18.20.0
or higher.
To get started, clone the smart-ai-samples
repository and navigate to the smart-ai-samples/angular
directory:
git clone https://github.com/syncfusion/smart-ai-samples.git
cd smart-ai-samples/angular
All required packages are pre-configured in the package.json
file. Install the dependencies by running:
npm install
Before using Syncfusion components, register your license key in the main.ts
file of your Angular project:
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
import { registerLicense } from '@syncfusion/ej2-base';
registerLicense('Replace your generated license key here');
bootstrapApplication(AppComponent, appConfig)
.catch((err) => console.error(err));
For more details on license registration, refer to the official documentation.
The following samples use a local embedding pre-trained model from Hugging Face and do not require Azure OpenAI. The transformers.js library from Hugging Face is utilized to run the model in a client-side application without the need for a server. To learn more about transformers, refer here.
- DataGrid (Semantic Filtering)
- ComboBox (Embeddings)
This project utilizes AI services to enhance component functionality. The Azure OpenAI service has been configured for this demo, but the Gemini model with the Vercel SDK can also be used.
To set up the AI services, navigate to ./src/app/ai-models/ai-models.ts
and replace the placeholders with your actual credentials:
const azure = createAzure({
resourceName: 'YOUR_RESOURCE_NAME',
apiKey: 'YOUR_API_KEY',
});
const aiModel = azure('YOUR_MODEL_NAME');
// for gemini model
const google = createGoogleGenerativeAI({
baseURL: "https://generativelanguage.googleapis.com/v1beta",
apiKey: "API_KEY"
});
const aiModel = google('YOUR_MODEL_NAME');
Your Azure endpoint should resemble: https://{resource_name}.openai.azure.com/
For more information on Azure OpenAI configuration, consult the Vercel AI SDK documentation.
The Image Editor AI feature uses Stability AI for AI image processing. To set it up:
- Obtain an API key from Stability AI.
- In
./src/app/ai-models/stability-model.ts
, replace the placeholder with your actual API key:
const apiKey = `Bearer YOUR_API_KEY`;
To run the application, use the following npm script:
npm run start
This command will start the application and open it in your default web browser.
For more information about Essential JS 2 Angular components, refer to these resources:
This table provides an overview of all the AI Samples in this project, along with links to their respective README files for detailed documentation.
Section | Component / Feature | Description | Documentation Link |
---|---|---|---|
Smart Paste Button | Smart Paste Functionality | Automatically fills out forms using clipboard data, improving data entry efficiency. | Read More |
Smart TextArea | Sentence-Level Autocompletion | Provides real-time sentence suggestions based on user input, enhancing typing efficiency with AI. | Read More |
ComboBox | Semantic Search | Advanced search capabilities using context and meaning rather than exact keywords. | Read More |
Data Grid | Semantic Filtering | Filters data semantically. | Read More |
Predictive Data Entry | Detects anomalies in datasets. | Read More | |
Anomaly Detection | Detects anomalies in datasets. | Read More | |
Scheduler | Smart Paste Integration | Converts natural language text into scheduler events, adding them as structured appointments. | Read More |
Gantt | Task Prioritize | AI-based task prioritization tool. | Read More |
Progress Predictor | Predicts project progress and completion. | Read More | |
Resource Allocator | Optimizes resource allocation. | Read More | |
Risk Assessor | Assesses project risks using AI. | Read More | |
Predictive Scheduling | AI-driven project scheduling. | Read More | |
RichTextEditor | AI Integration | Enhances text editing with features like content generation, summarization, rephrasing, translation, and grammar correction. | Read More |
Image Editor | AI Image Editing | Advanced image editing features including Magic Eraser, Background Changer, and Background Remover for enhanced creativity and precision. | Read More |
Diagram | TextToMindMap | Creates dynamic mindmaps using AI-generated content. | Read More |
TextToFlowChart | Creates flowcharts based on AI-generated workflows. | Read More | |
Document Editor | Smart Editor | Enhances document editing with rewriting, grammar checking, and translation. | Read More |
Maps | Weather Forecast | Displays weather forecasts on a map. | Read More |
File Manager | Smart File Manager | AI-driven features like Smart Search, Content Summary, and Intelligent Organization. | Read More |
Pivot Table | AI Data Analysis | AI integration for smart data aggregation, predictive modeling, adaptive filtering, and real-time interaction, enhancing data analysis and visualization. | Read More |
Query Builder | Natural Language Querying | Allows users to build queries in plain language, with the system interpreting the intent and generating the appropriate query. | Read More |
TreeGrid | Hierarchical Data Structuring | Uses AI to correct and organize hierarchical data in a Tree Grid, fixing parent-child relationships to ensure accurate data nesting. | Read More |