Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
7a7271b
Added hugging face integration for conversational models
mitanshudodia Jul 30, 2023
e29b2f6
Added hugging face integration for conversational models
mitanshudodia Jul 30, 2023
6981e2c
Do not allow Empty input to be submitted
NeerajSati Jul 30, 2023
2460bb7
Create chat Input Handler function
NeerajSati Jul 30, 2023
4c5bb7d
Added hugging face integration for conversational models
mitanshudodia Jul 30, 2023
605eb6a
Dark mode added
NeerajSati Jul 30, 2023
3f41da7
Make chat screen fit the screen width
NeerajSati Jul 30, 2023
8a54ad3
formatted some code
mitanshudodia Jul 30, 2023
2a6e17c
Add react-markdown to render markdown response
ankushdutt Aug 3, 2023
283a7b7
Merge pull request #14 from ankushdutt/render-markdown
kaustubh-cf Aug 3, 2023
f06de2a
moved main.py to exapmles/huggingface
mitanshudodia Aug 4, 2023
59969b0
Merge pull request #2 from mitanshudodia/mitanshu_dodia_hugging_face_…
kaustubh-cf Aug 4, 2023
18a961c
Update README
kausmeows Aug 4, 2023
24359dd
Merge pull request #29 from kaustubh-s1/main
kaustubh-cf Aug 4, 2023
4073f9a
Merge branch 'main' into main
NeerajSati Aug 6, 2023
827c055
Build updated
NeerajSati Aug 6, 2023
5f94450
Merge pull request #3 from NeerajSati/main
kaustubh-cf Aug 6, 2023
2430ca4
Add Sentiment Analysis and Dynamic Input Variable for Chatbots (#27)
shephinphilip Aug 7, 2023
480bc29
Added features and documentation (#13)
nini0309 Aug 7, 2023
f64d9a5
add deploy command to open dashboard
kaustubh-cf Aug 11, 2023
12831c8
fix: resolve dependancy conflict
kaustubh-cf Aug 12, 2023
997f67b
features added: customization panel, mulitmedia support, voice input …
HarshS1611 Aug 15, 2023
26cff94
Implemented Langchain for HuggingFace models (#44)
missusk Aug 15, 2023
58399d5
add new cli features (#50)
kaustubh-cf Aug 26, 2023
1905633
Update examples (#51)
sammyCofactory Aug 26, 2023
b34102f
fix deploy progress bar simulation (#52)
kaustubh-cf Aug 26, 2023
2206db5
Local UI using test command (#53)
kaustubh-cf Aug 29, 2023
19b991e
Add docusaurus docs
sammyCofactory Aug 29, 2023
d1d38a5
update .toml for publishing into PyPI (#55)
kaustubh-cf Aug 29, 2023
e25c5d3
update url display in CLI (#56)
kaustubh-cf Aug 29, 2023
7525896
Merge pull request #54 from cofactoryai/add-docusaurus
sammyCofactory Aug 29, 2023
1ad73c3
Add good and bad folder structures to docs
sammyCofactory Aug 29, 2023
be0fcf4
Change extension of requirements file
sammyCofactory Aug 29, 2023
66bcf67
Add bot name restrictions
sammyCofactory Aug 29, 2023
7681ee5
python -> python3
kaustubh-cf Aug 29, 2023
5a8fa52
Merge pull request #57 from cofactoryai/small-change
sammyCofactory Aug 29, 2023
49c241f
Merge pull request #58 from cofactoryai/add-folder-structure
sammyCofactory Aug 31, 2023
1efa73d
Update mimic-bot.py
sammyCofactory Aug 31, 2023
736eeda
add checks for correct naming structure of bot name (#59)
kaustubh-cf Aug 31, 2023
6097b38
update README.md
sammyCofactory Aug 31, 2023
73e7724
Update docusaurus readme
sammyCofactory Aug 31, 2023
d4c7b0d
Merge pull request #60 from cofactoryai/add-macos-support
sammyCofactory Aug 31, 2023
e11cc80
Fix Address already in use error
sammyCofactory Sep 1, 2023
b19e333
update local bot UI
kaustubh-cf Sep 1, 2023
d2cf912
Fix Address already in use error (#63)
sammyCofactory Sep 1, 2023
a659410
Merge pull request #64 from cofactoryai/botUI
sammyCofactory Sep 1, 2023
a75680e
Remove landing page
sammyCofactory Sep 1, 2023
642610b
Fix broken links
sammyCofactory Sep 1, 2023
1804dd9
Remove landing page (#65)
sammyCofactory Sep 1, 2023
cc78e12
Delete index.tsx
sammyCofactory Sep 1, 2023
ba11ac4
Merge pull request #66 from cofactoryai/remove-landing-page
sammyCofactory Sep 1, 2023
cff014e
Update Docusaurus docs (#67)
sammyCofactory Sep 1, 2023
69b7f37
fix: windows err python not found and textbase module not found
kaustubh-cf Sep 2, 2023
ee8cf25
Merge pull request #68 from cofactoryai/os-err
sammyCofactory Sep 2, 2023
d6666ec
update readme
kaustubh-cf Sep 2, 2023
fc7746c
Merge pull request #71 from cofactoryai/new-readme
sammyCofactory Sep 2, 2023
1a3cc51
Remove files
sammyCofactory Sep 2, 2023
0064927
Remove .env.example
sammyCofactory Sep 2, 2023
5970f85
Move bots to their own folders
sammyCofactory Sep 2, 2023
ad1492d
Rename bot programs
sammyCofactory Sep 2, 2023
b6f62ad
Merge pull request #72 from cofactoryai/remove-files
sammyCofactory Sep 2, 2023
7f17fec
update path for main.py in README
kaustubh-cf Sep 2, 2023
e225228
Merge pull request #74 from cofactoryai/main-path
sammyCofactory Sep 2, 2023
7fa9834
Add usage (#75)
sammyCofactory Sep 2, 2023
3ff2184
Remove CMD step from Linux installation (#77)
sammyCofactory Sep 2, 2023
7f9f612
Minor doc changes (#78)
sammyCofactory Sep 2, 2023
f26e9e6
Add video link for Windows OS (#80)
sammyCofactory Sep 2, 2023
207a610
Mimic bot - added comment (#82)
bharatchhabraai Sep 3, 2023
90f54b6
update gcp local ui bucket link (#83)
kaustubh-cf Sep 3, 2023
3e2a688
Make path absolute instead of cwd
sammyCofactory Sep 3, 2023
f6ba210
Merge pull request #88 from cofactoryai/make-path-absolute
sammyCofactory Sep 3, 2023
f6d73d9
add mac zip software to docs (#96)
kaustubh-cf Sep 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ __pycache__/
.Python
build/
develop-eggs/
# dist/
downloads/
eggs/
.eggs/
Expand All @@ -30,6 +29,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
dist

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -88,13 +88,6 @@ ipython_config.py
# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

Expand All @@ -114,6 +107,7 @@ ENV/
env.bak/
venv.bak/
cpcli-env/
/poetry.lock

# Spyder project settings
.spyderproject
Expand Down
20 changes: 20 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Scope
`[Add context about what this feature is about and explain why of the feature and your technical decisions.]`



- [ ] `[Sub task]`


### Screenshots
---


## Code improvements
- `[Did you add some generic like utility, component, or anything else useful outside of this PR]`


### Developer checklist
- [ ] I’ve manually tested that code works locally on desktop and mobile browsers.
- [ ] I’ve reviewed my code.
- [ ] I’ve removed all my personal credentials (API keys etc.) from the code.
61 changes: 49 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,53 @@
# Textbase

✨ Textbase is a framework for building chatbots using NLP and ML. ✨
<p align="center">
<picture>
<img alt="Textbase python library" src="assets/logo.svg" width="352" height="59" style="max-width: 100%;">
</picture>
<br/>
<br/>
</p>

<p align="center">
<a href="https://docs.textbase.ai">
<img alt="Documentation" src="https://img.shields.io/website/http/huggingface.co/docs/transformers/index.svg?down_color=red&down_message=offline&up_message=online">
</a>
</p>

<h3 align="center">
<p>✨ Textbase is a framework for building chatbots using NLP and ML. ✨</p>
</h3>

<h3 align="center">
<a href="https://textbase.ai"><img src="assets/banner.png"></a>
</h3>

Just implement the `on_message` function in `main.py` and Textbase will take care of the rest :)

Since it is just Python you can use whatever models, libraries, vector databases and APIs you want.

_Coming soon:_

- [ ] PyPI package
Coming soon:
- [x] [PyPI package](https://pypi.org/project/textbase-client/)
- [x] Easy web deployment via [textbase deploy](/docs/deployment/deploy-from-cli)
- [ ] SMS integration
- [ ] Easy web deployment via `textbase deploy`
- [ ] Native integration of other models (Claude, Llama, ...)

![Demo Deploy GIF](assets/textbase-deploy.gif)

## Installation
Make sure you have `python version >=3.9.0`, it's always good to follow the [docs](https://docs.textbase.ai/get-started/installation) 👈🏻
### 1. Through pip
```bash
pip install textbase-client
```

### 2. Local installation
Clone the repository and install the dependencies using [Poetry](https://python-poetry.org/) (you might have to [install Poetry](https://python-poetry.org/docs/#installation) first).

For proper details see [here]()

```bash
git clone https://github.com/cofactoryai/textbase
cd textbase
poetry shell
poetry install
```

Expand All @@ -28,15 +56,24 @@ poetry install
> If you're using the default template, **remember to set the OpenAI API key** in `main.py`.

Run the following command:

- if installed locally
```bash
poetry run python textbase/textbase_cli.py test
```
- if installed through pip
```bash
textbase-client test
```
Response:
```bash
poetry run python textbase/textbase_cli.py test main.py
Path to the main.py file: examples/openai-bot/main.py # You can create a main.py by yourself and add that path here. NOTE: The path should not be in quotes
```
Now go to the link in blue color which is shown on the CLI and you will be able to chat with your bot!
![Local UI](assets/test_command.png)

Now go to [http://localhost:4000](http://localhost:4000) and start chatting with your bot! The bot will automatically reload when you change the code.
### `Other commands have been mentioned in the documentaion website.` [Have a look](https://docs.textbase.ai/usage) 😃!

_Simpler version using PyPI package and CLI coming soon!_

## Contributions

Contributions are welcome! Please open an issue or a pull request.
Contributions are welcome! Please open an issue or create a pull request.
Binary file added assets/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/test_command.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/textbase-deploy.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
Binary file added docs/assets/library_server.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/local_server.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/mac_zip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/select_interpreter.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/zipping.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
14 changes: 14 additions & 0 deletions docs/docs/FAQs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
sidebar_position: 6
---

### Why is my bot deploy failing even though I have followed the correct folder structure?
Make sure that you have an `on_message` function inside your `main.py` file and you also have the `bot()` decorator.

If you are a MacOS user, make sure that you use the website which we have provided in the [prerequisites](./deployment/prerequisites.md#important-note-for-macos-users) section to zip your files.

### Why am I getting a weird axios error when I am trying to deploy my bot using the CLI?
We currently have a two bot limit per user. If you have exceeded that, then you will get this error in the CLI.

### Why am I getting an Error: Got unexpected extra argument?
This is because your path has a space in between somewhere and it's considering whatever's there after the space as an entirely extra argument. Check your path and make sure that there are no spaces in between.
7 changes: 7 additions & 0 deletions docs/docs/deployment/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"label": "Deployment",
"position": 4,
"link": {
"type": "generated-index"
}
}
30 changes: 30 additions & 0 deletions docs/docs/deployment/deploy-from-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
sidebar_position: 2
---

# Deploy from CLI

## API key generation

Before deploying your bot from the CLI, you need to generate an API key in the dashboard. To do that, you need to:

1. Navigate to the Textbase [dashboard](https://textbase-dashboard-nextjs.vercel.app/).
2. Sign in using your google account.
3. Generate an API key by clicking on `Generate` in the bottom left section.

## Deployment

After this, you can execute the `textbase-client deploy` command to deploy your bot from a terminal.

After executing it, it will ask for:
1. Path to the zip folder
2. Bot name (**IMPORTANT:** can only contain lowercase alphanumeric characters, hyphens, and underscores)
3. Textbase API key

If you want to run this command in one shot, you can make use of flags:

```bash
textbase-client deploy --path=<path_to_zip_folder> --bot-name=<name_of_your_bot> --api_key=<api_key>
```

If this command executes successfully, it will return a table with `Status`, `Bot ID` and `URL` and you can click on that URL to view your bot!
12 changes: 12 additions & 0 deletions docs/docs/deployment/deploy-from-dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
sidebar_position: 3
---

# Deploy from Dashboard

1. Navigate to the Textbase [dashboard](https://textbase-dashboard-nextjs.vercel.app/).
2. Sign in using your google account.
3. Click on `Create Deployment` and then click on `Create Bot` on the top right.
4. You will need to provide a chatbot name and you need to upload the zip file. **IMPORTANT:** The bot name can only contain lowercase alphanumeric characters, hyphens, and underscores.
5. Click on `Create Bot` to start the deployment.
6. This will redirect you to the `Deployments` section after a few seconds. In here, you can check the status of your bot and if it's deployed successfully, a link will be generated. You can click on the blue button with the symbol: `</>` which will redirect to the link where the bot is deployed and you can test it out!
52 changes: 52 additions & 0 deletions docs/docs/deployment/prerequisites.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
sidebar_position: 1
---

# Prerequisites
There are two methods to deploy your bot to the internet so that everyone can use it.

Before using any method, you need to ensure that:
1. You have a `requirements.txt` file which includes all the additional requirements which you might have installed while coding up the logic for your bot.
2. The name of the file in which the `on_message` function is present is named `main.py`.
3. You can have your own packages and modules in different folders and have relative imports to them. But the `main.py` and `requirements.txt` must **ABSOLUTELY NOT** be in any folder of their own.
3. Zip these two (or more) files into a `.zip` archive. It's important that it's a **.zip** archive and not anything else. If you are using MacOS, please read the note below.

## Important note for MacOS users
Please download the software `RAR Extractor MAX` from App Store ![Mac Zip Software](../../assets/mac_zip.png) for creating archives as MacOS creates an extra `__MACOSX` folder when compressing using the native compress utility which causes some issues with our backend.


## Folder structure
When you decide to archive the files, please **MAKE SURE** that main.py and requirements.txt are available in the **root** of the archive itself. As in if the zip is extracted, it will produce two (or more) files/folders.

![Zip folder](../../assets/zipping.gif)

### Good folder structure :white_check_mark:
```
your-bot.zip/
├── main.py
├── requirements.txt
└── your_package/
└── your_module/
└── sub_module
```
### Bad folder structure 1 :x:
```
your-bot.zip/
└── bot_folder/
├── main.py
├── requirements.txt
└── your_package/
└── your_module/
└── sub_module
```

### Bad folder structure 2 :x:
```
your-bot.zip/
├── main_folder/
│ ├── main.py
│ └── requirements.txt
└── your_package/
└── your_module/
└── sub_module
```
7 changes: 7 additions & 0 deletions docs/docs/examples/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"label": "Examples",
"position": 5,
"link": {
"type": "generated-index"
}
}
Loading