diff --git a/README.md b/README.md index 6bdae66..55ee303 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ litchi is a ai client for jupyter lab ## Requirements - JupyterLab >= 4.0.0 +- Ollama at http://localhost:11434 ## Install @@ -26,6 +27,24 @@ To remove the extension, execute: pip uninstall litchi ``` +## How to use it + +After install success. Just start `jupyter lab` in your computer and create a notebook. + +You can see the toolbar in jupyterlab notebook: + +![Loaded](./doc/images/loaded.png) + +Now, we can write content and choice a model from model list in toolbar. + +![Loaded](./doc/images/chat.png) + +And then use command palette or click the "send activate cell" button + +Wait a moment. The replay will place into a new cell below current. + +![Loaded](./doc/images/replay.png) + ## Contributing ### Development install diff --git a/demo.ipynb b/demo.ipynb new file mode 100644 index 0000000..662f717 --- /dev/null +++ b/demo.ipynb @@ -0,0 +1,57 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "6fe97655-002f-48a3-8732-1f05f7a50b05", + "metadata": {}, + "source": [ + "# A Magic Furit \n", + "\n", + "Tell me somthing about lichi." + ] + }, + { + "cell_type": "markdown", + "id": "2b015bf0-a303-4aaa-a8da-848f62970e3e", + "metadata": {}, + "source": [ + "Lychee (Litchi chinensis), also spelled as lichi, is a tropical fruit native to southern China and is one of the oldest cultivated tree species in the world. Here are some interesting facts and information about lychees:\n", + "\n", + "1. **Appearance**: Lychees have a unique appearance with their red or pinkish-red rind that's rough-textured but thin and easily removable, revealing a translucent white fruit inside.\n", + "\n", + "2. **Taste**: The flesh of a lychee is sweet and juicy with a floral aroma similar to grapes combined with rosewater. It can be enjoyed fresh, canned in syrup, or used in various dishes like salads, cocktails, desserts, and even savory dishes.\n", + "\n", + "3. **Nutritional Value**: Lychees are rich in vitamin C, B vitamins, potassium, copper, zinc, and other minerals. They also contain antioxidants that may have health benefits.\n", + "\n", + "4. **Cultivation**: The tree can grow up to 10 meters tall and requires a tropical climate with high humidity. It is grown in various parts of Asia including China, India, Thailand, and Vietnam, as well as in Hawaii and some parts of the United States like Florida.\n", + "\n", + "5. **Health Benefits**: Some studies suggest that lychees may have anti-inflammatory properties due to their flavonoid content. However, they are also associated with a rare condition known as \"lychee disease\" where unripe or overconsumption can lead to hypoglycemia in children.\n", + "\n", + "6. **Cultural Significance**: In Chinese culture, lychees symbolize luck and prosperity due to the pronunciation of their name which sounds similar to words meaning “having enough.”\n", + "\n", + "Lychees are a delightful tropical fruit enjoyed for their unique taste and health benefits around the world." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.5" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/doc/images/chat.png b/doc/images/chat.png new file mode 100644 index 0000000..ca07ec0 Binary files /dev/null and b/doc/images/chat.png differ diff --git a/doc/images/command.png b/doc/images/command.png new file mode 100644 index 0000000..056b6d6 Binary files /dev/null and b/doc/images/command.png differ diff --git a/doc/images/loaded.png b/doc/images/loaded.png new file mode 100644 index 0000000..0aecf9f Binary files /dev/null and b/doc/images/loaded.png differ diff --git a/doc/images/replay.png b/doc/images/replay.png new file mode 100644 index 0000000..e186461 Binary files /dev/null and b/doc/images/replay.png differ diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..3b30640 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,3 @@ +[aliases] +release = register sdist bdist_egg upload + diff --git a/setup.py b/setup.py index aefdf20..07c8e2f 100644 --- a/setup.py +++ b/setup.py @@ -1 +1,33 @@ -__import__("setuptools").setup() +# __import__("setuptools").setup() +from setuptools import setup +from pathlib import Path + +this_directory = Path(__file__).parent +long_description = (this_directory / "README.md").read_text() + +setup(name="pyparsec", + version="0.1.0", + description="Litchi is a Jupyterlab extension for AI Client", + long_description=long_description, + long_description_content_type='text/markdown', + author="marsliu", + author_email="mars.liu@outlook.com", + url="https://github.com/MarchLiu/litchi", + license="MIT", + packages=["litchi"], + package_dir={ + "ui": "src", + "litchi": "litchi" + }, + keywords= ["jupyter", "jupyterlab", "jupyterlab-extension", "ai", "ollama"], + classifiers=[ + "Topic :: Utilities", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3 :: Only", + "License :: OSI Approved :: MIT License" + ] + ) \ No newline at end of file diff --git a/src/toolbar.tsx b/src/toolbar.tsx index 4409dfe..37093e3 100644 --- a/src/toolbar.tsx +++ b/src/toolbar.tsx @@ -44,8 +44,8 @@ function ModelsComponent(props: { app: JupyterFrontEnd; state: IStateDB }) { return ( - Litchi Toolbar - + {'(*☻-☻*)'}{' '} +