NuminousAI 2.0.0
This Python package designed to provide a comprehensive interface for interacting with various AI models and performing a range of functionalities such as URL interaction, system command execution, and more.
Requires Python: >=3.6

# NuminousAI

NuminousAI is a Python package designed to provide a comprehensive interface for interacting with various AI models and performing a range of functionalities such as URL interaction, system command execution, and more. This package is intended to serve as a robust tool for developers and researchers working with AI technologies.

# Features

### CerebrasAI Integration with NuminousAI

`CerebrasAI` is a Python class designed to interact with the Cerebras Cloud API, leveraging powerful models such as `llama3.1-8b` for text generation tasks. The class simplifies API key management, ensures seamless interaction with the Cerebras API, and offers a robust text generation interface.

This class is a part of the `NuminousAI` project and extends functionality from the `AIBase` class, which provides common utilities and paths for the project.

## Features

- **Model Support**: Supports Cerebras models such as `llama3.1-8b` and `llama3.1-70b`.
- **API Key Management**: Automatically fetches and manages Cerebras API keys using Selenium to handle authentication.
- **Chrome User Data Syncing**: Synchronizes Chrome user data to ensure cookies and session data are available for authentication.
- **Text Generation Interface**: Allows for sending questions or prompts to the Cerebras models with customizable parameters like temperature, max tokens, and system prompts.
- **Error Handling**: Robust error handling for expired API keys, connection errors, and general exceptions.
- **Streaming Support**: Option to stream responses in real-time.

## Installation

You can install the package via `pip` or you can visit here: https://pypi.org/project/NuminousAI

```pip install NuminousAI```
# Requirements
- `Python 3.6+`: Ensure you have Python 3.6 or higher installed.
- `requests>=2.0.0`: For making HTTP requests to the Cerebras API.
- `click>=8.1.7`: For building command-line interfaces (CLI).
- `appdirs>=1.4.4`: For handling platform-specific directories (used to store config files).
- `tqdm>=4.66.4`: For showing progress bars in the console.
- `selenium>=4.20.0`: For automating Chrome browser tasks and fetching cookies.
- `cerebras_cloud_sdk>=1.5.0`: Official SDK for interacting with Cerebras models.

# Usage

```python
from NuminousAI.Provider.DeepInfraAI import DeepInfraAI
from NuminousAI.Provider.CerebrasAI import CerebrasAI
import time

if __name__ == "__main__":
    DeepInfra = DeepInfraAI().TextGeneration()
    Cerebras = CerebrasAI()
    print("AI Initialized Successfully.\n")

    questions = [
        "Hi",
        "What is AI?",
        "How does machine learning work?",
        "What is the meaning of life?",
        "Explain quantum computing.",
        "What is the future of technology?",
        "Can AI be conscious?",
        "How do neural networks learn?",
        "What is deep learning?",
        "Can AI replace humans?",
        "What is reinforcement learning?",
        "What is the difference between AI and machine learning?",
        "How do you explain natural language processing?",
        "What are the applications of AI in healthcare?",
        "What is the Turing Test, and why is it important?",
        "How does AI impact privacy?",
        "Can AI generate creative content?",
        "What are the challenges in AI ethics?",
        "What are the most common AI algorithms?",
        "How is AI used in autonomous vehicles?",
        "What role does AI play in cybersecurity?",
        "What is transfer learning in AI?",
        "Can AI learn without supervision?",
        "What is the difference between supervised and unsupervised learning?",
        "How does AI help in climate change research?",
        "What is generative adversarial networks (GANs)?",
        "How does AI detect fraud in financial transactions?",
        "What are the risks of AI in decision-making?",
        "How does AI influence human creativity?",
        "Can AI predict natural disasters?",
        "What is the future of AI in education?"
    ]
    
    # Loop to ask 10 questions
    for i, question in enumerate(questions):
        print(f"Question {i+1}: {question}\n")

        # Measure time for DeepInfraAI
        deepinfra_start_time = time.time()
        deepinfra_response = DeepInfra.generate(question)
        deepinfra_time = time.time() - deepinfra_start_time
        print(f'DeepInfraAI: {deepinfra_response}')
        print(f'\nDeepInfraAI took {deepinfra_time:.2f} seconds\n')

        # Measure time for CerebrasAI
        cerebras_start_time = time.time()
        cerebras_response = Cerebras.ask(question)
        cerebras_time = time.time() - cerebras_start_time
        print(f'\nCerebrasAI: {cerebras_response}')
        print(f'\nCerebrasAI took {cerebras_time:.2f} seconds\n')
    
    # For Testing of TextToImage
    print(DeepInfraAI().TextToImage().generate(prompt="Generate an image of a white elephant.", model="FLUX-1-dev", bearer_token="Bearer jwt:eyJhu8ifc"))

    # For Testing of AutomaticSpeechRecognition
    print(DeepInfraAI().AutomaticSpeechRecognition().generate(audio_file_path="./English.mp3", task="transcribe", model="Whisper-large-v3"))

    print(DeepInfraAI().AutomaticSpeechRecognition().generate(audio_file_path="./Hindi.mp3", task="translate", model="Whisper-large-v3"))

    # For Testing of TextToSpeech
    print(DeepInfraAI().TextToSpeech().generate(text="Text-to-Speech technology converts written text into spoken words using advanced speech synthesis by the DeepInfra API.",voice="Aura",output_filename="output_file.mp3"))

    # For Testing of ZeroShotImageClassification
    print(DeepInfraAI().ZeroShotImageClassification().generate(image_path="./cat.jpg", model="Clip-vit-base-patch32", bearer_token="Bearer jwt:eyJhu8ifc", candidate_labels=["cat", "dog"]))

    print(DeepInfraAI().ZeroShotImageClassification().generate(image_path="./dog.jpg", model="Clip-vit-base-patch32", bearer_token="Bearer jwt:eyJhu8ifc", candidate_labels=["cat", "dog"]))
```

# Key Sections
- **Overview**: Provides a summary of what the class does and its features.
- **Installation**: Lists prerequisites and installation steps for dependencies.
- **Usage**: Demonstrates how to use the class for initialization and asking questions.
- **Configuration**: Explains the config file format and how it's managed.
- **Error Handling**: Describes the built-in error handling mechanisms.
- **Contributing & License**: Encourages contributions and provides licensing information.

# License

[MIT](https://choosealicense.com/licenses/mit/)
# Hi, I'm Sujal Rajpoot! 👋
## 🔗 Links
[![portfolio](https://img.shields.io/badge/my_portfolio-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://sujalrajpoot.netlify.app/)
[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/sujal-rajpoot-469888305/)
[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/sujalrajpoot70)


## 🚀 About Me
I'm a skilled Python programmer and experienced web developer. With a strong background in programming and a passion for creating interactive and engaging web experiences, I specialize in crafting dynamic websites and applications. I'm dedicated to transforming ideas into functional and user-friendly digital solutions. Explore my portfolio to see my work in action.