Metadata-Version: 2.1
Name: kin-kernel
Version: 0.0.1
Summary: kin-kernel contain the default templates of Cells that compose a Kin.
Home-page: https://github.com/DigitalKin-ai/kin-kernel
Author: DigitalKin.ai
Author-email: contact@digitalkin.ai
License: LICENSE.txt
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pydantic >=1.8.2

# 📖 DigitalKin.ai - KinKernel

[![PyPI version](https://badge.fury.io/py/kin-kernel.svg)](https://badge.fury.io/py/kin-kernel)
[![Python version](https://img.shields.io/pypi/pyversions/kin-kernel.svg)](https://pypi.python.org/pypi/kin-kernel/)

<!-- [![Build Status](https://travis-ci.com/DigitalKin/kin-kernel.svg?branch=main)](https://travis-ci.com/DigitalKin/kin-kernel) -->

[![Coverage Status](https://coveralls.io/repos/github/DigitalKin/kin-kernel/badge.svg?branch=main)](https://coveralls.io/github/DigitalKin/kin-kernel?branch=main)

<!-- [![License](https://img.shields.io/github/license/DigitalKin/kin-kernel.svg)](https://github.com/DigitalKin/kin-kernel/blob/main/LICENSE) -->

Welcome to the DigitalKin KinKernel ! This package is designed to enable developers to create Cells, which are autonomous agents that can be integrated into the Internet of Agents (IoA) ecosystem powered by DigitalKin.

## 👀 Overview

The KinKernel provides a framework for creating and managing Cells. Each Cell represents a distinct autonomous agent with a specific role and behavior within the IoA. The KinKernel ensures that all Cells adhere to a standard interface and can communicate effectively within the ecosystem.

## 💡 Features

- Abstract base classes for standardizing Cell creation
- Response models for consistent communication
- Helper methods for schema information access
- Configuration management
- Example Cell implementation

## 🛠️ Installation

Before installing the KinKernel, ensure you have Python installed on your system. This package requires Python 3.10 or higher.

To install the KinKernel, clone the repository and install the dependencies:

```shell
git clone https://github.com/DigitalKin/kin-kernel.git
cd kin-kernel-kit
pip install -r requirements/prod.txt
```

For development purposes, you may also want to install the development dependencies:

```shell
pip install -r requirements/dev.txt
```

## ✨ Linter

Execute linters:

```bash
   flake8 kinkernel
   black kinkernel --check --diff
   black kinkernel
   mypy kinkernel
   pylint kinkernel
```

## 💻 Usage

To create a new Cell, you'll need to subclass the `Cell` class provided in the kinKernel and implement the required methods and properties.

Here's a simple example of a Cell that processes input data:

```python
from kinkernel import Cell
from pydantic import BaseModel

class MyInputModel(BaseModel):
    value1: int
    value2: str

class MyOutputModel(BaseModel):
    processed_value: int

class MyCell(Cell[MyInputModel, MyOutputModel]):
    role = "Processor"
    description = "Processes input data"
    input_format = MyInputModel
    output_format = MyOutputModel

    def execute(self, input_data: MyInputModel) -> MyOutputModel:
        # Cell-specific logic here
        result = input_data.value1 * 2
        return MyOutputModel(processed_value=result)
```

You can then instantiate and execute your Cell as follows:

```python
my_cell = MyCell()
input_data = MyInputModel(value1=10, value2="example")
output_data = my_cell.execute(input_data)
print(output_data)
```

For a more detailed example, refer to the `examples/simple_cell_example.py` file in the repository.

## 🧪 Testing

The CDK comes with a set of unit tests to ensure that your Cells work as expected. To run the tests, execute the following command:

```shell
pytest
```

## 👥 Contribution

Contributions to the KinKernel are welcome! If you have suggestions for improvements or find any issues, please open an issue on our GitHub repository.

## 🤗 Support

If you have any questions or need support with the KinKernel, please reach out to us at contact@digitalkin.ai.

Thank you for using the DigitalKin Cell Development Kit. We look forward to seeing the innovative Cells you'll create for the Internet of Agents!

---

© 2023 DigitalKin.ai. All Rights Reserved.
