Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions jupyter_ai_jupyternaut/extension_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from asyncio import get_event_loop_policy
from jupyter_server.extension.application import ExtensionApp
from jupyter_server.serverapp import ServerApp
import os
from tornado.web import StaticFileHandler

from traitlets import List, Unicode, Dict
from traitlets.config import Config
from typing import TYPE_CHECKING
Expand All @@ -17,10 +16,6 @@
if TYPE_CHECKING:
from asyncio import AbstractEventLoop

JUPYTERNAUT_AVATAR_PATH = str(
os.path.join(os.path.dirname(__file__), "static", "jupyternaut.svg")
)


class JupyternautExtension(ExtensionApp):
"""
Expand All @@ -40,11 +35,6 @@ class JupyternautExtension(ExtensionApp):
(r"api/jupyternaut/config/?", ConfigRestAPI),
(r"api/jupyternaut/model-parameters/?", ModelParametersRestAPI),
(r"api/jupyternaut/secrets/?", SecretsRestAPI),
(
r"api/jupyternaut/static/jupyternaut.svg()/?",
StaticFileHandler,
{"path": JUPYTERNAUT_AVATAR_PATH},
),
]

allowed_providers = List(
Expand Down
6 changes: 5 additions & 1 deletion jupyter_ai_jupyternaut/jupyternaut/jupyternaut.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@

MEMORY_STORE_PATH = os.path.join(jupyter_data_dir(), "jupyter_ai", "memory.sqlite")

JUPYTERNAUT_AVATAR_PATH = str(os.path.abspath(
os.path.join(os.path.dirname(__file__), "../static", "jupyternaut.svg")
))


def format_tool_args_compact(args_dict, threshold=25):
"""
Expand Down Expand Up @@ -105,7 +109,7 @@ def __init__(self, *args, **kwargs):
def defaults(self):
return PersonaDefaults(
name="Jupyternaut",
avatar_path="/api/jupyternaut/static/jupyternaut.svg",
avatar_path=JUPYTERNAUT_AVATAR_PATH,
description="The standard agent provided by JupyterLab. Currently has no tools.",
system_prompt="...",
)
Expand Down