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

Windows Client Bug #37

Open
an-gains opened this issue Jan 23, 2025 · 0 comments
Open

Windows Client Bug #37

an-gains opened this issue Jan 23, 2025 · 0 comments

Comments

@an-gains
Copy link

an-gains commented Jan 23, 2025

I am testing your serveless endpoints to build our company chatbot and I am developing on Windows.

There is a bug in the method _build_http_url() of the BaseAPI class: https://github.com/friendliai/friendli-client/blob/main/friendli/sdk/api/base.py.

The use of os.path.join to create the endpoint URL creates invalid paths on Windows machine because of the different default OS separator with respect to UNIX systems. I believe using pathlib.PurePosixPath to build the URL would solve the issue.

On my Windows machine, your example code:

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="meta-llama-3.1-8b-instruct",
    base_url="https://api.friendli.ai/serverless/v1",
    api_key=os.environ["FRIENDLI_TOKEN"],
)

result = llm.invoke("Tell me a joke.")
print(result.content)

Will ultimately raise the error:

socket.gaierror: [Errno 11001] getaddrinfo failed

because _build_http_url() generates the non-valid URL: https://inference.friendli.ai\\v1/chat/completions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant