-
-
Notifications
You must be signed in to change notification settings - Fork 405
Overhaul v3 developer documentation #1344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@fperez Hey Fernando, this PR adds documentation on defining custom AI personas & providing them to Jupyter AI via entry points. 👍 The Jupyter AI docs have been split into 2 versions: v2 and v3. The docs page defaults to ![]() |
You can also click the link in the PR description to view the developer documentation right now, before this PR is merged. |
|
||
## How-to: define custom code completions | ||
|
||
Any model provider derived from `BaseProvider` can be used as a completion provider. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and everything below is roughly duplicated in inline_completions.md
. I don't know which copy you intended to keep but just highlighting this with assumption that only one was meant to be included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch, thanks! I'll look into this when I'm able
``` | ||
|
||
Jupyter AI uses entry points to discover embedding providers. | ||
In the `pyproject.toml` file, add your custom embedding provider to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mention here that the specific pyproject.toml
file is in jupyter-ai-magics
.
The [**entry points API**][entry_points] allows other packages to add custom | ||
objects to Jupyter AI's backend. Jupyter AI defines a set of **entry point | ||
groups**. Each entry point group is reserved for a specific type of object, e.g. | ||
one group may be reserved for personas and another may be reserved for model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's out convention for personas
, do we want to capitalize it to Personas
?
|
||
The `auth_strategy` handles specifying API keys for providers and models. | ||
The example shows the `EnvAuthStrategy` which takes the API key from the | ||
environment variable with the name specified in `name` and be provided to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awkward sentence, maybe use "it will be" instead of just "be"
For example, if your Jupyter AI instance has `Jupyternaut` and `MyCustomPersona` | ||
as 2 AI personas, then each persona will only respond when `@`-mentioned. | ||
|
||
- To call `Jupyternaut`, your message must include `@Jupyternaut`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to say that the message should be prefixed by @Jupyternaut
?
`jupyter_ai.personas:BasePersona`. Instructions on defining one are given in the | ||
next section. | ||
|
||
## How-to: define a custom AI persona |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize "Define"
`process_message()` method. | ||
|
||
- `defaults` defines the default settings of the persona. This is mainly used to | ||
control the name & avatar shown in the Jupyter AI chat. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace & with "and"
by Jupyternaut, you can access that through the `self.config: ConfigManager` | ||
attribute available to subclasses. | ||
|
||
Add & call this method on a persona to access the LangChain runnable used by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace & with "and"
To provide entry points, your custom Python package must use a `pyproject.toml` | ||
manifest. To provide an existing class as an entry point, fill out the following | ||
template and add it to the end of your package's | ||
`pyproject.toml` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add to the end of the sentence: "in the jupyter-ai-test
folder"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs look really good. Left some comments. Questions:
- Will we be moving Personas out from
jupyter-ai-test
into their own folder underjupyter-ai
? - Should Personas and all related files (READMEs, tools, requirements) be in subfolders under a separate folder?
Description
v3
developer documentation:jupyterlab_chat
frontend.Demo
The new dev docs look much nicer. See demo: https://jupyter-ai--1344.org.readthedocs.build/en/1344/developers/index.html