Skip to content

Commit 1703886

Browse files
srdasandrii-i
andauthored
Return error message when the completion model is not specified for the Jupyternaut persona (#1408)
* Return error message when the completion model is not specified for the Jupyternaut persona * use early return for missing model check --------- Co-authored-by: Andrii Ieroshenko <[email protected]>
1 parent e91f214 commit 1703886

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/jupyter-ai/jupyter_ai/personas/jupyternaut/jupyternaut.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ def defaults(self):
2727
)
2828

2929
async def process_message(self, message: Message) -> None:
30+
if not self.config_manager.lm_provider:
31+
self.send_message(
32+
"No language model provider configured. Please set one in the Jupyter AI settings."
33+
)
34+
return
35+
3036
provider_name = self.config_manager.lm_provider.name
3137
model_id = self.config_manager.lm_provider_params["model_id"]
3238

0 commit comments

Comments
 (0)