Skip to content
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

error if model does not return a valid outline["description"] #328

Closed
jhgoebbert opened this issue Aug 9, 2023 · 1 comment · Fixed by #407
Closed

error if model does not return a valid outline["description"] #328

jhgoebbert opened this issue Aug 9, 2023 · 1 comment · Fixed by #407
Labels
bug Something isn't working

Comments

@jhgoebbert
Copy link

Description

jupyter-ai fails if the model does not return a json-outline with a key=="description".
https://github.com/jupyterlab/jupyter-ai/blob/main/packages/jupyter-ai/jupyter_ai/chat_handlers/generate.py#L190

A check for outline["sections"] and outline["description"] could ensure that this is caught.

Backtrace

File “/lib/python3.10/site-packages/jupyter_ai/chat_handlers/[base.py](http://base.py/)”, line 38, in process_message
await self._process_message(message)
File “/lib/python3.10/site-packages/jupyter_ai/chat_handlers/[generate.py](http://generate.py/)”, line 241, in _process_message
await fill_outline(outline, llm=self.llm, verbose=True)
File “/lib/python3.10/site-packages/jupyter_ai/chat_handlers/[generate.py](http://generate.py/)”, line 190, in fill_outline
generate_code(section, outline[“description”], llm=llm, verbose=verbose)
KeyError: ‘description’
@jhgoebbert
Copy link
Author

This are great news.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant