jupyterlab / jupyter-ai

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

api_version in GUI not considered, need to set OPENAI_API_VERSION #807

Open OliverKleinBST opened 3 months ago

OliverKleinBST commented 3 months ago

Description

I am using Azure as per below setting. The api_version I set in the GUI. When I do so the code complains that I need to set the api_version as parameter or via OPENAI_API_VERSION. even though I have set it in the GUI. The problem disappears when I set environment variable.

Reproduce

{ "model_provider_id": "azure-chat-openai:gpt-35-turbo-16k", "embeddings_provider_id": null, "send_with_shift_enter": false, "fields": { "azure-chat-openai:gpt-35-turbo-16k": { "api_version": "2023-07-01-preview", "azure_endpoint": "https://bst-openai-instance.openai.azure.com" } }, ...

jupyter_ai 2.16.0 langchain 0.1.20 langchain-community 0.0.38 langchain-core 0.1.52 langchain-openai 0.0.8 langchain-text-splitters 0.0.2 openai 1.30.3

welcome[bot] commented 3 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

albertmichaelj commented 1 month ago

I am also running into this issue. Is there a known workaround?