Skip to content

Commit 64f7ca2

Browse files
committed
Fixes avatar path
1 parent 68e9c53 commit 64f7ca2

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

jupyter_ai_jupyternaut/extension_app.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from asyncio import get_event_loop_policy
33
from jupyter_server.extension.application import ExtensionApp
44
from jupyter_server.serverapp import ServerApp
5-
import os
6-
from tornado.web import StaticFileHandler
5+
76
from traitlets import List, Unicode, Dict
87
from traitlets.config import Config
98
from typing import TYPE_CHECKING
@@ -17,10 +16,6 @@
1716
if TYPE_CHECKING:
1817
from asyncio import AbstractEventLoop
1918

20-
JUPYTERNAUT_AVATAR_PATH = str(
21-
os.path.join(os.path.dirname(__file__), "static", "jupyternaut.svg")
22-
)
23-
2419

2520
class JupyternautExtension(ExtensionApp):
2621
"""
@@ -40,11 +35,6 @@ class JupyternautExtension(ExtensionApp):
4035
(r"api/jupyternaut/config/?", ConfigRestAPI),
4136
(r"api/jupyternaut/model-parameters/?", ModelParametersRestAPI),
4237
(r"api/jupyternaut/secrets/?", SecretsRestAPI),
43-
(
44-
r"api/jupyternaut/static/jupyternaut.svg()/?",
45-
StaticFileHandler,
46-
{"path": JUPYTERNAUT_AVATAR_PATH},
47-
),
4838
]
4939

5040
allowed_providers = List(

jupyter_ai_jupyternaut/jupyternaut/jupyternaut.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525

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

28+
JUPYTERNAUT_AVATAR_PATH = str(os.path.abspath(
29+
os.path.join(os.path.dirname(__file__), "../static", "jupyternaut.svg")
30+
))
31+
2832

2933
def format_tool_args_compact(args_dict, threshold=25):
3034
"""
@@ -105,7 +109,7 @@ def __init__(self, *args, **kwargs):
105109
def defaults(self):
106110
return PersonaDefaults(
107111
name="Jupyternaut",
108-
avatar_path="/api/jupyternaut/static/jupyternaut.svg",
112+
avatar_path=JUPYTERNAUT_AVATAR_PATH,
109113
description="The standard agent provided by JupyterLab. Currently has no tools.",
110114
system_prompt="...",
111115
)

0 commit comments

Comments
 (0)