You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
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 theBaseAPI
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 usingpathlib.PurePosixPath
to build the URL would solve the issue.On my Windows machine, your example code:
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/completionsThe text was updated successfully, but these errors were encountered: