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

Can't pass Base API URL from UI #1088

Open
Yuto-24 opened this issue Nov 5, 2024 · 2 comments
Open

Can't pass Base API URL from UI #1088

Yuto-24 opened this issue Nov 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Yuto-24
Copy link

Yuto-24 commented Nov 5, 2024

Description

Reproduce

  1. Go to 'LLM Registration UI'
  2. Fill All requirements including 'Base API URL'
  3. Save Changes and go to Chat section
  4. You need to pass openai_endpoint
  5. I set AZURE_OPENAI_ENDPOINT, then it is resolved.

Expected behavior

Context

  • Operating System and version:
  • Browser and version:
  • JupyterLab version:
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
$ python --version
Python 3.10.12

$ pip list | grep jupyter
jupyter                           1.1.1
jupyter_ai                        2.27.0
jupyter_ai_magics                 2.27.0
jupyter_client                    8.6.3
jupyter-console                   6.6.3
jupyter_core                      5.7.2
jupyter-events                    0.10.0
jupyter-lsp                       2.2.5
jupyter_server                    2.14.2
jupyter_server_terminals          0.5.3
jupyterlab                        4.2.5
jupyterlab_pygments               0.3.0
jupyterlab_server                 2.27.3
jupyterlab_widgets                3.0.13

$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
Browser Output
Paste the output from your browser Javascript console here, if applicable.
@Yuto-24 Yuto-24 added the bug Something isn't working label Nov 5, 2024
@dlqqq
Copy link
Member

dlqqq commented Nov 5, 2024

@Yuto-24 Thank you for reporting this issue to our team! I'm leaving some notes here for other contributors to help with this issue.

Here is the definition of the Azure provider:

class AzureChatOpenAIProvider(BaseProvider, AzureChatOpenAI):
    id = "azure-chat-openai"
    name = "Azure OpenAI"
    models = ["*"]
    model_id_key = "azure_deployment"
    model_id_label = "Deployment name"
    pypi_package_deps = ["langchain_openai"]
    # Confusingly, langchain uses both OPENAI_API_KEY and AZURE_OPENAI_API_KEY for azure
    # https://github.com/langchain-ai/langchain/blob/f2579096993ae460516a0aae1d3e09f3eb5c1772/libs/partners/openai/langchain_openai/llms/azure.py#L85
    auth_strategy = EnvAuthStrategy(
        name="AZURE_OPENAI_API_KEY", keyword_param="openai_api_key"
    )
    registry = True

    fields = [
        TextField(key="azure_endpoint", label="Base API URL (required)", format="text"),
        TextField(key="api_version", label="API version (required)", format="text"),
    ]

The Azure endpoint is being passed via the azure_endpoint keyword parameter. However, this may have been renamed, which may be causing the issue you are describing.

We should find the definition of AzureChatOpenAI, see which keyword parameter it expects for AZURE_OPENAI_ENDPOINT, and then update the key defined in the field.

@Yuto-24
Copy link
Author

Yuto-24 commented Nov 5, 2024

Exactly. I also found this, but I couldn't detect where it is used.

I hope someone who knows this arch will resolve this issues.

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

No branches or pull requests

2 participants