semvec/pypi-packages huggingface dataset:
plugbear 0.1.0
Plugbear easily integrates LLM into various channels.
Requires Python: >=3.9

# [PlugBear](https://plugbear.io/) Python SDK

Connect a custom LLM to PlugBear through a web server.

## FastAPI

### Installation

To install the PlugBear Python SDK, run the following command:

```bash
pip install 'plugbear[fastapi]'
```

### Usage

Here's a simple example to get you started:


```python
import contextlib

import plugbear.fastapi
from fastapi import FastAPI

PLUGBEAR_API_KEY = ""
PLUGBEAR_ENDPOINT = "/plugbear"


@contextlib.asynccontextmanager
async def lifespan(app: FastAPI):
    await plugbear.fastapi.register(
        app,
        llm_func=some_llm,
        api_key=PLUGBEAR_API_KEY,
        endpoint=PLUGBEAR_ENDPOINT,
    )
    yield


app = FastAPI(lifespan=lifespan)


async def some_llm(context: plugbear.fastapi.Request) -> str:
    # template prompt using `context` to your own LLM
    # and return result
    result: str = ...
    return result
```


<details>
  <summary>For versions below 0.93.0</summary>

```python
import plugbear.fastapi
from fastapi import FastAPI

app = FastAPI()
PLUGBEAR_API_KEY = ""
PLUGBEAR_ENDPOINT = "/plugbear"


@app.on_event("startup")
async def _startup():
    await plugbear.fastapi.register(
        app,
        llm_func=some_llm,
        api_key=PLUGBEAR_API_KEY,
        endpoint=PLUGBEAR_ENDPOINT,
    )


async def some_llm(context: plugbear.fastapi.Request) -> str:
    # template prompt using `context` to your own LLM
    # and return result
    result: str = ...
    return result
```

</details>

## Other Web server frameworks

Although it does not yet provide an interface as convenient as FastAPI, it can be directly linked to PlugBear.

### Installation

```bash
pip install plugbear
```

### Usage

Taking Django as an example, it looks like this:

#### settings.py

```python
import plugbear
from asgiref.sync import async_to_sync

PLUGBEAR_API_KEY = ""
PLUGBEAR_ENDPOINT = "/plugbear"

pb = async_to_sync(plugbear.PlugBear.init(api_key=PLUGBEAR_API_KEY))
```

#### urls.py

```python
from django.conf import settings
from django.urls import path

from . import views

urlpatterns = [
    path(settings.PLUGBEAR_ENDPOINT, views.handle_plugbear, name="plugbear"),
]
```
#### views.py

```python
import plugbear
from dacite import from_dict
from django.http import HttpResponse


def handle_plugbear(request):
    context = from_dict(data_class=plugbear.Request, data=request.data)
    result = some_llm(context)
    return HttpResponse(result)

def some_llm(context: plugbear.Request) -> str:
    # template prompt using `context` to your own LLM
    # and return result
    result: str = ...
    return result
```
dico-api 0.0.38
Yet another Discord API wrapper for Python.
Requires Python: >=3.7

# dico
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/0eff61ab0fd741ff8e13a086699d6672)](https://www.codacy.com/gh/eunwoo1104/dico/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=eunwoo1104/dico&amp;utm_campaign=Badge_Grade)
[![Discord](https://img.shields.io/discord/832488748843401217)](https://discord.gg/QH4AXNySpB)

**Keep in mind that this project is still WIP, therefore it might be unstable.**

Yet another Discord API wrapper for Python, aimed to follow Discord API format as much as possible but also simple and easy to use.

[Discord Server](https://discord.gg/QH4AXNySpB)

## Features
- Discord v10 API (including Threads, components, context menus, etc.)
- Full interaction support
- API-Only supported, with aiohttp-based or requests-based HTTP client.
- More soon™

## Installation
Development Version:
```
pip install -U git+https://github.com/dico-api/dico
```
PyPi(**Not Recommended**):
```
pip install -U dico-api
```

## Quick Example

### API Client

```py
import dico

api = dico.APIClient("APPLICATION_TOKEN_HERE", base=dico.HTTPRequest)
# You may use AsyncHTTPClient for async support.

# All endpoints are implemented, and for the example request_user (= Get User) will be used.
user = api.request_user()  # You may pass any user ID or it will be the application itself.
# You may use either int, str, dico.Snowflake, or dico.User itself.
print(user.username)
```

### Websocket Client
```py
import dico


client = dico.Client("YOUR_BOT_TOKEN_HERE", intents=dico.Intents.full())


@client.on_message_create
async def on_message_create(message: dico.Message):
    if message.content.startswith("!hello"):
        await message.reply("Hello, World!")


client.run()
```
More examples are in [here](https://github.com/dico-api/dico/tree/master/examples).

## Requirements
- Python 3.7+

## Extra Libs
- [dico-interaction](https://github.com/dico-api/dico-interaction)
- [dico-command](https://github.com/dico-api/dico-command)
Face-Mash 127.0.0.0
Deep Learning model for fatigue detection
Requires Python: >=3.6
Keywords: deep learning,drowsiness detection,fatigue analysis

# Deep learning model for fatigue detection

[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)                 
[![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)   


##  Meta Information 

- Trained on open source dataset from kaggle
- Following are the predictable classes
- Closed(eyes)
- Open(eyes)
- no_yawn
- yawn


## Usage

- Make sure you have Python installed in your system.
- Model file will be saved locally in root directory.
- Model training info will be explained in medium blog soon.


## Example

 ```
from Face_Mash import Face_Mash
model_path = 'path/of/model.h5'
img_path   = 'path/of/img_file'
prediction = Face_Mash(img_path,model_path)

  ```