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

Running Langsmith locally not working #9435

Closed
mrcmoresi opened this issue Aug 18, 2023 · 1 comment
Closed

Running Langsmith locally not working #9435

mrcmoresi opened this issue Aug 18, 2023 · 1 comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@mrcmoresi
Copy link

mrcmoresi commented Aug 18, 2023

Issue you'd like to raise.

Hello, I'm trying to run langsmith locally, together with Azure OpenAi services.
I started langsmith in docker and it looks like below
image

And I'm running the chatbot from here https://github.com/langchain-ai/langsmith-cookbook/blob/main/feedback-examples/streamlit/README.md

Looks like the app is not allowed to send the interaction to langsmith.

  File "/home/azureuser/anaconda3/envs/snowflake/lib/python3.8/site-packages/langsmith/utils.py", line 55, in raise_for_status_with_text
    response.raise_for_status()
  File "/home/azureuser/anaconda3/envs/snowflake/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 405 Client Error: Not Allowed for url: http://20.79.217.xxx/runs/3abf1f4c-2b48-4d1b-9628-979f7d12d9d5/share

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/azureuser/anaconda3/envs/snowflake/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)
  File "/home/azureuser/langsmith/main.py", line 126, in <module>
    url = client.share_run(run.id)
  File "/home/azureuser/anaconda3/envs/snowflake/lib/python3.8/site-packages/langsmith/client.py", line 831, in share_run
    raise_for_status_with_text(response)
  File "/home/azureuser/anaconda3/envs/snowflake/lib/python3.8/site-packages/langsmith/utils.py", line 57, in raise_for_status_with_text
    raise ValueError(response.text) from e
ValueError: <html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.24.0</center>
</body>
</html>

Also something that looks a bit odd is when I open the website, it's not showing me the projects
image
and i can't create a new one, keeps telling me that the field is required

image

what could I do, any hint is more than appreaciated

Suggestion:

No response

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Aug 18, 2023
@dosubot
Copy link

dosubot bot commented Aug 18, 2023

🤖

Hello,

The "405 Not Allowed" error you're encountering typically occurs when the HTTP method you're trying to use is not supported by the server. In the context of the LangChain framework, this error might occur if the Azure endpoint you're trying to reach does not support the HTTP method used in the call method.

To resolve this issue, you should modify the call method in the AzureMLEndpointClient class to use the POST method. Here's how you can do it:

def call(self, body: bytes, **kwargs: Any) -> bytes:
    """call."""

    headers = {
        "Content-Type": "application/json",
        "Authorization": ("Bearer " + self.endpoint_api_key),
    }
    if self.deployment_name != "":
        headers["azureml-model-deployment"] = self.deployment_name

    req = urllib.request.Request(self.endpoint_url, body, headers, method='POST')
    response = urllib.request.urlopen(req, timeout=kwargs.get("timeout", 50))
    result = response.read()
    return result

In this code, I added the method='POST' argument to the urllib.request.Request function to specify that the POST method should be used. This should resolve the "405 Not Allowed" error if it was caused by using the wrong HTTP method.

As for the share_run method in the Langsmith client, I wasn't able to find specific information about its function within the LangChain repository. It would be helpful if you could provide more details about the context in which this method is used.

Please try the suggested solution and let me know if it resolves your issue or if you need further assistance.

Best,
Dosu

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant