Metadata-Version: 2.4
Name: ipy-yasi
Version: 0.0.2
Summary: DIY alternative to solve it from fast.ai (Yet-Another-SolveIt)
Home-page: https://github.com/Jack-Byte/yasi
Author: Jack-Byte
Author-email: tobi.klings@t-online.de
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ipylab
Requires-Dist: openai
Provides-Extra: dev
Requires-Dist: ipylab; extra == "dev"
Requires-Dist: openai; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# yasi


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Usage

### Installation

Install latest from the GitHub
[repository](https://github.com/Jack-Byte/yasi):

``` sh
$ pip install git+https://github.com/Jack-Byte/yasi.git
```

or from [pypi](https://pypi.org/project/yasi/)

``` sh
$ pip install yasi
```

### Documentation

Documentation can be found hosted on this GitHub
[repository](https://github.com/Jack-Byte/yasi)’s
[pages](https://Jack-Byte.github.io/yasi/). Additionally you can find
package manager specific guidelines on
[conda](https://anaconda.org/Jack-Byte/yasi) and
[pypi](https://pypi.org/project/yasi/) respectively.

## How to use

You can try it online with Binder
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Jack-Byte/yasi/HEAD?urlpath=%2Fdoc%2Ftree%2F%2Fexamples%2Fmoney_and_kangaroos.ipynb)

Import JupyterChat, set openai_base_url (only if you are not using
Openai itself), and provide your api key directly or as the env variable
`OPENAI_API_KEY`.

``` python
from yasi.core import JupyterChat

jc = JupyterChat(openai_base_url="https://openrouter.ai/api/v1", api_key=None)
```

### Query Openai directly

You can use the `send_query` method to interacte through a code cell
directly. The response will be added as a new markdown cell in your
current notebook.

``` python
jc.send_query('Kia ora, how are you?')
```

Kia ora! I’m doing well, thanks for asking! It’s great to connect with
you and practice some basic Maori phrases. How can I help you today?

### Send Dialoge from your Notebook

JupyterChat is designed to extract messages from your current notebook
and construct a dialoge.

It’s searching for markdown cells that contain the tags

- `#| chat_system` (optional) sets the context for the conversation,
  providing the AI with a “hint” about the type of response expected
- `#| chat_user` your messages
- `#| chat_assistant` the AIs real responses, or the ones that you
  ingest into the dialog

and sends the dialog to the Openai API.

![](files/yasi_demo_roos.gif)
