sparrow-iq
v1.0.4
Published
A powerful library for intelligent document processing and validation, featuring the advanced SparrowIQ .
Maintainers
Readme
🚀 SparrowIQ
A powerful library for intelligent document processing and validation, featuring the advanced SparrowIQ .
✨ Features
- 📄 Support for multiple file types (PDF, DOCX, DOC)
- 🤖 AI-powered document validation and analysis
- 🎯 Customizable entity extraction
- 🔍 Smart requirement matching
- 🛡️ Built-in file type validation
- 💪 TypeScript support
🔧 Installation
npm i sparrow-iq
# or
yarn add sparrow-iq🚀 Quick Start
import { SparrowIQ } from 'sparrow-iq';
const App = () => {
const iq = new SparrowIQ({
FileType: ['pdf', 'docx', 'doc'],
config: {
API_KEY: 'YOUR_API_KEY',
UPLOAD_URL: 'YOUR_UPLOAD_URL',
GENERATE_URL: 'YOUR_GENERATE_URL'
}
});
iq.validateFileType(FILE)
iq.parseFile(FILE)
};📚 API Reference
SparrowIQ Props
| Prop | Type | Description | |------|------|-------------| | FileType | string[] | Supported file extensions | | config.API_KEY | string | Your API key for authentication | | config.UPLOAD_URL | string | URL for file uploads | | config.GENERATE_URL | string | URL for content generation |
Methods
validateFileType(file: File): Validates if the file type is supportedupdateFile(file: File): Updates the current file in stateupdateRequirement(requirement: string): Updates the requirement textupdateEntities(entities: SparrowIQEntity[]): Updates the entities for extractionvalidateState(): Validates the current state of the componentvalidateFile(fileBase64: string): Validates the file contentparseFile(file): parse the file content
🔐 Security
Make sure to:
- Keep your API keys secure
- Validate file types before processing
- Handle errors appropriately
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
