jupyterlab / jupyter-ai

A generative AI extension for JupyterLab
https://jupyter-ai.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
3.25k stars 335 forks source link

Missing Request Schema for SageMaker Endpoint in jupyter-ai Extension #1006

Open Naveen-Annam-CMA opened 2 months ago

Naveen-Annam-CMA commented 2 months ago

Description:

When trying to use a SageMaker Endpoint as the completion model in the jupyter-ai chat UI, we encounter the following error:

Traceback (most recent call last):
  File "/home/ubuntu/miniconda/lib/python3.10/site-packages/jupyter_ai/chat_handlers/base.py", line 196, in on_message
    await self.process_message(message)
  File "/home/ubuntu/miniconda/lib/python3.10/site-packages/jupyter_ai/chat_handlers/default.py", line 96, in process_message
    self.get_llm_chain()
  File "/home/ubuntu/miniconda/lib/python3.10/site-packages/jupyter_ai/chat_handlers/base.py", line 345, in get_llm_chain
    self create_llm_chain(lm_provider, lm_provider_params)
  File "/home/ubuntu/miniconda/lib/python3.10/site-packages/jupyter_ai/chat_handlers/default.py", line 38, in create_llm_chain
    llm = provider(**unified_parameters)
  File "/home/ubuntu/miniconda/lib/python3.10/site-packages/jupyter_ai_magics/partner_providers/aws.py", line 205, in __init__
    request_schema = kwargs.pop("request_schema")
KeyError: 'request_schema'

Error related to a missing request_schema. We have set all the required fields (including the request_schema) but we seem to be encountering the above. It appears that the request schema for the SageMaker Endpoint is missing or not being properly handled by the extension.

Environment:

Request for Assistance:

dlqqq commented 3 days ago

Thanks for reporting this. I've left a detailed reply in #1007.