Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 6d5b813

Browse files
authored
Release 0.1.1 (#21)
* Minor improvements (#16) * Starting work on Jupyterlite build of icortex * Changed metadata * Minor * Currently trying to fix jupyter_client import * Kernel resources get installed * Removed JupyterLite work for now because it's not as straightforward as expected * Bumped to version 0.1.0 to conform standards * Migrate prompt parsing to magic commands (#18) * Replaced / and // with magic commands %p and %icortex * Execute generated code with InteractiveShell.run_cell() * Cell outputs are saved to ICortexHistory * Minor * Improve documentation (#20) * Added issue templates * Minor * Minor * Minor * Minor * Minor * Minor * Minor * Updated README * Updated README * wip * wip * Minor * Added docstrings and more dcoumentation * Minor * Added rtd config * Added badge * Updated README * Minor * Minor * Minor * Minor
1 parent 13357bb commit 6d5b813

27 files changed

Lines changed: 1155 additions & 174 deletions
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: Bug report
3+
about: "Report a bug or unexpected behavior when running ICortex"
4+
title: ''
5+
labels: bug
6+
assignees: osolmaz
7+
8+
---
9+
10+
<!-- Fill in the details below where applicable: -->
11+
12+
## Description of bug / unexpected behavior
13+
<!-- Add a clear and concise description of the problem you encountered. -->
14+
15+
16+
## Expected behavior
17+
<!-- Add a clear and concise description of what you expected to happen. -->
18+
19+
20+
## How to reproduce the issue
21+
<!-- Provide a piece of code illustrating the undesired behavior. -->
22+
23+
<details><summary>Code for reproducing the problem</summary>
24+
25+
```py
26+
Paste your code here.
27+
```
28+
29+
</details>
30+
31+
32+
## Additional media files
33+
<!-- Paste in the files manim produced on rendering the code above. -->
34+
35+
<details><summary>Images/GIFs</summary>
36+
37+
<!-- PASTE MEDIA HERE -->
38+
39+
</details>
40+
41+
42+
## Logs
43+
<details><summary>Terminal output</summary>
44+
<!-- Add "-v DEBUG" when calling manim to generate more detailed logs -->
45+
46+
```
47+
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR
48+
```
49+
50+
<!-- Insert screenshots here (only when absolutely necessary, we prefer copy/pasted output!) -->
51+
52+
</details>
53+
54+
55+
## System specifications
56+
57+
<details><summary>System Details</summary>
58+
59+
60+
- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)):
61+
- RAM:
62+
- Python version (run `python/py/python3 --version`):
63+
- ICortex version (run `pip show icortex | grep -i version`):
64+
- Other relevant modules (provide output from `pip list`):
65+
- Versions of Jupyter related packages (run `jupyter --version`):
66+
67+
```
68+
PASTE HERE
69+
```
70+
</details>
71+
72+
</details>
73+
74+
## Additional comments
75+
<!-- Add further context that you think might be relevant for this issue here. -->
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature request
3+
about: Request a new feature for ICortex
4+
title: ""
5+
labels: enhancement
6+
assignees: 'osolmaz'
7+
8+
---
9+
10+
## Description of proposed feature
11+
<!-- Add a clear and concise description of the new feature, including a motivation: why do you think this will be useful? -->
12+
13+
14+
## How can the new feature be used?
15+
<!-- If possible, illustrate how this new feature could be used. -->
16+
17+
18+
## Additional comments
19+
<!-- Add further context that you think might be relevant. -->
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: "Installation issue"
3+
about: "Report issues with the installation process of manim-voiceover"
4+
title: ''
5+
labels: installation
6+
assignees: osolmaz
7+
8+
---
9+
10+
#### Preliminaries
11+
12+
- [ ] I have followed the latest version of the
13+
[installation instructions](https://github.com/textcortex/icortex/blob/main/README.md).
14+
15+
## Description of error
16+
<!-- Add a clear and concise description of the problem you encountered. -->
17+
18+
19+
## Installation logs
20+
<!-- Please paste the **full** terminal output; we can only help to identify the issue
21+
when we receive all required information. -->
22+
23+
<details><summary>Terminal output</summary>
24+
25+
```
26+
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR
27+
```
28+
29+
<!-- Insert screenshots here (only when absolutely necessary, we prefer copy/pasted output!) -->
30+
31+
</details>
32+
33+
34+
## System specifications
35+
36+
<details><summary>System Details</summary>
37+
38+
- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)):
39+
- RAM:
40+
- Python version (`python/py/python3 --version`):
41+
- Installed modules (provide output from `pip list`):
42+
```
43+
PASTE HERE
44+
```
45+
</details>
46+
47+
48+
## Additional comments
49+
<!-- Add further context that you think might be relevant for this issue here. -->

.readthedocs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
build:
3+
image: latest
4+
sphinx:
5+
configuration: docs/source/conf.py
6+
python:
7+
version: 3.8
8+
install:
9+
- requirements: docs/requirements.txt
10+
- method: pip
11+
path: .

README.md

Lines changed: 44 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,67 @@
1-
# ICortex Kernel
2-
3-
![Github Actions Status](https://github.com/textcortex/icortex/workflows/Build/badge.svg)
4-
[![License](https://img.shields.io/github/license/textcortex/icortex.svg?color=blue)](https://github.com/textcortex/icortex/blob/main/LICENSE)
5-
[![](https://dcbadge.vercel.app/api/server/QtfGgKneHX?style=flat)](https://discord.textcortex.com/)
6-
7-
ICortex is a [Jupyter kernel](https://jupyter-client.readthedocs.io/en/latest/kernels.html) that lets you program using plain English, by generating Python code from natural language prompts:
1+
<p align="center">
2+
<a href="https://icortex.ai/"><img src="https://raw.githubusercontent.com/textcortex/icortex/main/assets/logo/banner.svg"></a>
3+
<br />
4+
<br />
5+
<a href="https://github.com/textcortex/icortex/workflows/Build/badge.svg"><img src="https://github.com/textcortex/icortex/workflows/Build/badge.svg" alt="Github Actions Status"></a>
6+
<a href="https://pypi.org/project/icortex/"><img src="https://img.shields.io/pypi/v/icortex.svg?style=flat&logo=pypi" alt="PyPI Latest Release"></a>
7+
<a href="https://pepy.tech/project/icortex"><img src="https://pepy.tech/badge/icortex/month?" alt="Downloads"> </a>
8+
<a href="https://icortex.readthedocs.io/en/latest/?badge=latest"><img src="https://readthedocs.org/projects/icortex/badge/?version=latest" alt="Documentation Status"></a>
9+
<a href="https://github.com/textcortex/icortex/blob/main/LICENSE"><img src="https://img.shields.io/github/license/textcortex/icortex.svg?color=blue" alt="License"></a>
10+
<a href="https://discord.textcortex.com/"><img src="https://dcbadge.vercel.app/api/server/QtfGgKneHX?style=flat" alt="Discord"></a>
11+
<a href="https://twitter.com/TextCortex/"><img src="https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40TextCortex" alt="Twitter"></a>
12+
<br />
13+
<br />
14+
<i>A Python library for <a href="https://en.wikipedia.org/wiki/Soft_computing">soft-code</a> development — program in plain English with AI code generation!</i>
15+
</p>
16+
<hr />
17+
18+
ICortex is a [Jupyter kernel](https://jupyter-client.readthedocs.io/en/latest/kernels.html) that lets you develop **soft programs**:
19+
20+
- sets of instructions (i.e. prompts) [written in natural language](https://en.wikipedia.org/wiki/Natural-language_programming) (such as English)
21+
- processed by language models that generate Python code
22+
- to perform useful work in various contexts
23+
- more flexibly than regular software.
24+
25+
To put it simply—in goes English, out comes Python:
826

927
https://user-images.githubusercontent.com/2453968/196814906-1a0de2a1-27a7-4aec-a960-0eb21fbe2879.mp4
1028

1129
TODO: Prompts are given using the %prompt magic now, update the video accordingly
1230

13-
It is ...
31+
ICortex is ...
1432

1533
- a drop-in replacement for the IPython kernel. Prompts can be executed with the [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html) `%prompt` or `%p` for short.
16-
- an interface for [Natural Language Programming](https://en.wikipedia.org/wiki/Natural-language_programming) interface—prompts written in plain English automatically generate Python code which can then be executed globally.
1734
- interactive—install missing packages directly, decide whether to execute the generated code or not, and so on, directly in the Jupyter Notebook cell.
1835
- open source and fully extensible—if you think we are missing a model or an API, you can request it by creating an issue, or implement it yourself by subclassing `ServiceBase` under [`icortex/services`](icortex/services).
1936

20-
ICortex is currently in alpha, so expect breaking changes. We are giving free credits to our first users—[join our Discord](https://discord.textcortex.com/) to help us shape this product.
21-
22-
## Installation
23-
24-
To install the ICortex Kernel, run the following in the main project directory:
25-
26-
```sh
27-
pip install icortex
28-
```
29-
30-
This will install the Python package and the `icortex` command line interface. You will need to run `icortex` once to install the kernel spec to Jupyter.
31-
32-
## Using ICortex
33-
34-
Before you can use ICortex in Jupyter, you need to configure it for your current project.
35-
36-
If you are using the terminal:
37-
38-
```bash
39-
icortex init
40-
```
41-
42-
Alternatively, you can initialize directly in a Jupyter Notebook ([instructions on how to start JupyterLab](https://jupyterlab.readthedocs.io/en/stable/getting_started/starting.html)):
43-
44-
```
45-
%icortex init
46-
```
47-
48-
The shell will then instruct you step by step and create a configuration file `icortex.toml` in the current directory.
49-
50-
### Choosing a code generation service
51-
52-
ICortex supports different code generation services such as the TextCortex API, OpenAI Codex API, local HuggingFace transformers, and so on.
53-
54-
To use the TextCortex code generation API,
55-
56-
1. [sign up on the website](https://app.textcortex.com/user/signup),
57-
2. [generate an API key on the dashboard](https://app.textcortex.com/user/dashboard/settings/api-key),
58-
3. and proceed to configure `icortex` for your current project:
59-
60-
[![asciicast](https://asciinema.org/a/sTU1EaGFfi3jdSV8Ih7vulsfT.svg)](https://asciinema.org/a/sTU1EaGFfi3jdSV8Ih7vulsfT)
61-
62-
If you use up the starter credits and would like to continue testing out ICortex, [hit us up on our Discord on #icortex channel](https://discord.textcortex.com) and we will charge your account with more free credits.
37+
It is similar to [Github Copilot](https://github.com/features/copilot) but with certain differences that make it stand out:
6338

64-
You can also try out different services e.g. OpenAI's Codex API, if you have access. You can also run code generation models from HuggingFace locally, which we have optimized to run on the CPU—though these produce lower quality outputs due to being smaller.
39+
| Feature | GitHub Copilot | ICortex |
40+
|---|:---:|:---:|
41+
| Generates code ... | In the text editor | In a [Jupyter kernel](https://docs.jupyter.org/en/latest/projects/kernels.html) (language backend that provides the execution environment) |
42+
| From ... | Existing code and comments | Plain English prompts |
43+
| Level of control over context used to generate code | Low | High |
44+
| Plain language instructions are ... | Just comments | Standalone programs |
45+
| The resulting program is ... | Static | Dynamic—adapts to the context it is executed in |
46+
| Can connect to different code generation APIs | No | Yes |
6547

66-
## Usage
48+
The main difference between ICortex and a code-generation plugin like GitHub Copilot is that ICortex is a programming paradigm similar to [literate programming](https://en.wikipedia.org/wiki/Literate_programming) or [natural language programming](https://en.wikipedia.org/wiki/Natural-language_programming), where the natural language prompt is the first-class citizen, and which allows for fine-grained control over the code-generation context.
6749

68-
### Executing prompts
50+
ICortex is currently in alpha, so expect breaking changes. We are giving free credits to our first users—[join our Discord](https://discord.textcortex.com/) to help us shape it.
6951

70-
To execute a prompt with ICortex, use the `%prompt` [magic command](https://ipython.readthedocs.io/en/stable/interactive/magics.html) (or `%p` for short) as a prefix. Copy and paste the following prompt into a cell and try to run it:
71-
72-
```
73-
%p print Hello World. Then print the Fibonacci numbers till 100
74-
```
75-
76-
Depending on the response, you should see an output similar to the following:
77-
78-
```
79-
print('Hello World.', end=' ')
80-
a, b = 0, 1
81-
while b < 100:
82-
print(b, end=' ')
83-
a, b = b, a+b
84-
85-
Hello World.
86-
1 1 2 3 5 8 13 21 34 55 89
87-
```
88-
89-
You can also specify variables or options with command line flags, e.g. to auto-install packages, auto-execute the returned code and so on. To see the complete list of variables for your chosen service, run:
90-
91-
```
92-
%help
93-
```
94-
95-
### Using ICortex CLI
52+
## Installation
9653

97-
ICortex comes with a full-fledged CLI similar to git or Docker CLI, which you can use to configure how you generate code in your project. To see all the commands you can invoke, run
54+
Install directly from PyPI:
9855

9956
```sh
100-
icortex help
101-
```
102-
103-
For example the command `icortex service` lets you configure the code generation service you would like to use. To see how to use each command, call them with `help`
104-
105-
```
106-
icortex service help
107-
```
108-
109-
### Accessing ICortex CLI inside Jupyter
110-
111-
You can still access the `icortex` CLI in a Jupyter Notebook or shell by using the magic command `%icortex`. For example running the following in the terminal switches to a local HuggingFace model:
112-
113-
```
114-
icortex service set huggingface
57+
pip install icortex
58+
# This line is needed to install the kernel spec to Jupyter:
59+
python -m icortex.kernel.install
11560
```
11661

117-
To do the same in a Jupyter Notebook, you can run
118-
119-
```
120-
%icortex service set huggingface
121-
```
62+
## Quickstart
12263

123-
in a cell, which initializes and switches to the new service directly in your Jupyter session.
64+
[Click here to visit the docs and get started using ICortex](https://icortex.readthedocs.io/en/latest/quickstart.html).
12465

12566
## Getting help
12667

0 commit comments

Comments
 (0)