<commit_before># Skygear-chat
Chat addon to provide common operation

# How to enable chat in your cloud code 

First, submodule to import the source code.

```
git submodule add <EMAIL>:SkygearIO/chat.git chat
```

In your cloud code, import the chat plugin. Skygear will load and lambda and
database hook will be ready for use.
```
from .chat import plugin as chat_plugin
```

# APIs

## createConversation(participant_ids, admin_ids, title)
create a conversation

| Param  | Type                | Description  |<commit_msg>Update the readme on how to expose an demo on chat<commit_after># Skygear-chat
Chat addon to provide common operation

### Get the demo running at Skygear cloud 

__First__

Assumed you go registered at `https://portal.skygeario.com`

__Second__ 

git submodule to import the source code.

```
git submodule add https://github.com/SkygearIO/chat.git chat
```

In your cloud code, import the chat plugin. Skygear will load and lambda and
database hook will be ready for use.
```python
from .chat import plugin as chat_plugin
```

__Third__

Tell Skygear cloud to serve the asset from demo folder

```python
from skygear import static_assets
from skygear.utils.assets import relative_assets

from .chat import plugin as chat_plugin


@static_assets(prefix='demo')
def chat_demo():
    return relative_assets('chat/js-sdk/demo')
```

`https://<your_app_name>.skygeario.com/static/demo/index.html`


# APIs

## createConversation(participant_ids, admin_ids, title)
create a conversation

| Param  | Type                | Description  |
{'fraction_non_alphanumeric': 0.08220937700706486, 'fraction_numerical': 0.0, 'mean_word_length': 4.141914191419142, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7400707', 'n_tokens_mistral': 482, 'n_tokens_neox': 459, 'n_words': 180}