-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…#715) * improve support for custom providers adds 3 new provider class attributes: 1. `manages_history` 2. `unsupported_slash_commands` 3. `persona` * pre-commit * add comment about jupyternaut icon in frontend * remove 'avatar_path' from 'Persona', drop 'PersonaDescription' * pre-commit
- Loading branch information
Showing
13 changed files
with
195 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/jupyter-ai-magics/jupyter_ai_magics/models/persona.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from langchain.pydantic_v1 import BaseModel | ||
|
||
|
||
class Persona(BaseModel): | ||
""" | ||
Model of an **agent persona**, a struct that includes the name & avatar | ||
shown on agent replies in the chat UI. | ||
Each persona is specific to a single provider, set on the `persona` field. | ||
""" | ||
|
||
name: str = ... | ||
""" | ||
Name of the persona, e.g. "Jupyternaut". This is used to render the name | ||
shown on agent replies in the chat UI. | ||
""" | ||
|
||
avatar_route: str = ... | ||
""" | ||
The server route that should be used the avatar of this persona. This is | ||
used to render the avatar shown on agent replies in the chat UI. | ||
""" | ||
|
||
|
||
JUPYTERNAUT_AVATAR_ROUTE = "api/ai/static/jupyternaut.svg" | ||
JupyternautPersona = Persona(name="Jupyternaut", avatar_route=JUPYTERNAUT_AVATAR_ROUTE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.