kin-kernel


Namekin-kernel JSON
Version 0.0.5 PyPI version JSON
download
home_pagehttps://github.com/DigitalKin-ai/kin-kernel
Summarykin-kernel contain the default templates of Cells that compose a Kin.
upload_time2024-01-25 08:16:13
maintainer
docs_urlNone
authorDigitalKin.ai
requires_python>=3.10
licenseCC BY-NC-SA 4.0
keywords kin-kernel cells autonomous-agents ioa digitalkin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # ๐Ÿ“– 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/)
[![codecov](https://codecov.io/gh/DigitalKin-ai/kin-kernel/graph/badge.svg?token=65F0SB839V)](https://codecov.io/gh/DigitalKin-ai/kin-kernel)
[![License: CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](http://creativecommons.org/licenses/by-nc-sa/4.0/)
[![DigitalKin](https://img.shields.io/badge/DigitalKin-connect-001945)](https://vision.digitalkin.ai)
[![Discord](https://img.shields.io/badge/Discord-join-blue)](https://discord.com/invite/yVstHVcx)
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
With pipy:

```shell
pip install kin-kernel
```

Or 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 pydantic import BaseModel

from kinkernel import Cell
from kinkernel.config import ConfigModel, EnvVar


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
    config = ConfigModel(
        env_vars=[
            EnvVar(key="ENV_VAR_1", value="value1"),
            EnvVar(key="ENV_VAR_2", value="value2"),
        ]
    )

    async def _execute(self, input_data: MyInputModel) -> MyOutputModel:
        # Process the input_data as needed
        exec_result = {"processed_value": input_data.value1 * 2}
        return MyOutputModel(**exec_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!

---

Kin-kernel ยฉ 2023 by DigitalKin is licensed under CC BY-NC-SA 4.0

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DigitalKin-ai/kin-kernel",
    "name": "kin-kernel",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "kin-kernel cells autonomous-agents IoA DigitalKin",
    "author": "DigitalKin.ai",
    "author_email": "contact@digitalkin.ai",
    "download_url": "https://files.pythonhosted.org/packages/53/13/740003ae976a1858f2f4254a5cff27d49a83386d6d3d08f9b9e91b5a41fc/kin-kernel-0.0.5.tar.gz",
    "platform": null,
    "description": "# \ud83d\udcd6 DigitalKin.ai - KinKernel\n\n[![PyPI version](https://badge.fury.io/py/kin-kernel.svg)](https://badge.fury.io/py/kin-kernel)\n[![Python version](https://img.shields.io/pypi/pyversions/kin-kernel.svg)](https://pypi.python.org/pypi/kin-kernel/)\n[![codecov](https://codecov.io/gh/DigitalKin-ai/kin-kernel/graph/badge.svg?token=65F0SB839V)](https://codecov.io/gh/DigitalKin-ai/kin-kernel)\n[![License: CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](http://creativecommons.org/licenses/by-nc-sa/4.0/)\n[![DigitalKin](https://img.shields.io/badge/DigitalKin-connect-001945)](https://vision.digitalkin.ai)\n[![Discord](https://img.shields.io/badge/Discord-join-blue)](https://discord.com/invite/yVstHVcx)\nWelcome 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.\n\n## \ud83d\udc40 Overview\n\nThe 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.\n\n## \ud83d\udca1 Features\n\n- Abstract base classes for standardizing Cell creation\n- Response models for consistent communication\n- Helper methods for schema information access\n- Configuration management\n- Example Cell implementation\n\n## \ud83d\udee0\ufe0f Installation\n\nBefore installing the KinKernel, ensure you have Python installed on your system. This package requires Python 3.10 or higher.\n\nTo install the KinKernel\nWith pipy:\n\n```shell\npip install kin-kernel\n```\n\nOr clone the repository and install the dependencies:\n\n```shell\ngit clone https://github.com/DigitalKin/kin-kernel.git\ncd kin-kernel-kit\npip install -r requirements/prod.txt\n```\n\nFor development purposes, you may also want to install the development dependencies:\n\n```shell\npip install -r requirements/dev.txt\n```\n\n## \u2728 Linter\n\nExecute linters:\n\n```bash\n   flake8 kinkernel\n   black kinkernel --check --diff\n   black kinkernel\n   mypy kinkernel\n   pylint kinkernel\n```\n\n## \ud83d\udcbb Usage\n\nTo create a new Cell, you'll need to subclass the `Cell` class provided in the kinKernel and implement the required methods and properties.\n\nHere's a simple example of a Cell that processes input data:\n\n```python\nfrom pydantic import BaseModel\n\nfrom kinkernel import Cell\nfrom kinkernel.config import ConfigModel, EnvVar\n\n\nclass MyInputModel(BaseModel):\n    value1: int\n    value2: str\n\n\nclass MyOutputModel(BaseModel):\n    processed_value: int\n\n\nclass MyCell(Cell[MyInputModel, MyOutputModel]):\n    role = \"Processor\"\n    description = \"Processes input data\"\n    input_format = MyInputModel\n    output_format = MyOutputModel\n    config = ConfigModel(\n        env_vars=[\n            EnvVar(key=\"ENV_VAR_1\", value=\"value1\"),\n            EnvVar(key=\"ENV_VAR_2\", value=\"value2\"),\n        ]\n    )\n\n    async def _execute(self, input_data: MyInputModel) -> MyOutputModel:\n        # Process the input_data as needed\n        exec_result = {\"processed_value\": input_data.value1 * 2}\n        return MyOutputModel(**exec_result)\n```\n\nYou can then instantiate and execute your Cell as follows:\n\n```python\nmy_cell = MyCell()\ninput_data = MyInputModel(value1=10, value2=\"example\")\noutput_data = my_cell.execute(input_data)\nprint(output_data)\n```\n\nFor a more detailed example, refer to the `examples/simple_cell_example.py` file in the repository.\n\n## \ud83e\uddea Testing\n\nThe CDK comes with a set of unit tests to ensure that your Cells work as expected. To run the tests, execute the following command:\n\n```shell\npytest\n```\n\n## \ud83d\udc65 Contribution\n\nContributions to the KinKernel are welcome! If you have suggestions for improvements or find any issues, please open an issue on our GitHub repository.\n\n## \ud83e\udd17 Support\n\nIf you have any questions or need support with the KinKernel, please reach out to us at contact@digitalkin.ai.\n\nThank you for using the DigitalKin Cell Development Kit. We look forward to seeing the innovative Cells you'll create for the Internet of Agents!\n\n---\n\nKin-kernel \u00a9 2023 by DigitalKin is licensed under CC BY-NC-SA 4.0\n",
    "bugtrack_url": null,
    "license": "CC BY-NC-SA 4.0",
    "summary": "kin-kernel contain the default templates of Cells that compose a Kin.",
    "version": "0.0.5",
    "project_urls": {
        "Homepage": "https://github.com/DigitalKin-ai/kin-kernel"
    },
    "split_keywords": [
        "kin-kernel",
        "cells",
        "autonomous-agents",
        "ioa",
        "digitalkin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "beb396802b517ea73639905fb7fb15ecedf4f4897f64c36a832936fe6acad8be",
                "md5": "a86254428073ebd2cab5d1b7b51ecbde",
                "sha256": "9e23b352cfbed34f16ee22ea09c3bbf1c074561b000c8a18466da8cfeac776e0"
            },
            "downloads": -1,
            "filename": "kin_kernel-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a86254428073ebd2cab5d1b7b51ecbde",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 27581,
            "upload_time": "2024-01-25T08:16:11",
            "upload_time_iso_8601": "2024-01-25T08:16:11.089559Z",
            "url": "https://files.pythonhosted.org/packages/be/b3/96802b517ea73639905fb7fb15ecedf4f4897f64c36a832936fe6acad8be/kin_kernel-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5313740003ae976a1858f2f4254a5cff27d49a83386d6d3d08f9b9e91b5a41fc",
                "md5": "7d68643fa5b2b553b8a9a38ac47c447a",
                "sha256": "10fd1b85ccc49ad9c12bd093b44555c57c748af991f785c19c600c3e1f92db50"
            },
            "downloads": -1,
            "filename": "kin-kernel-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "7d68643fa5b2b553b8a9a38ac47c447a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 22393,
            "upload_time": "2024-01-25T08:16:13",
            "upload_time_iso_8601": "2024-01-25T08:16:13.038941Z",
            "url": "https://files.pythonhosted.org/packages/53/13/740003ae976a1858f2f4254a5cff27d49a83386d6d3d08f9b9e91b5a41fc/kin-kernel-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-25 08:16:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DigitalKin-ai",
    "github_project": "kin-kernel",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "kin-kernel"
}
        
Elapsed time: 0.32836s