-
Notifications
You must be signed in to change notification settings - Fork 507
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
Add URL path to client URL in in Client._parse_host() #170
Conversation
Someone please approve the PR and merge the code. 🥺 ChatOllama uses this library, which has an issue that needs to be addressed as well. from langchain_ollama import ChatOllama
chat_model = ChatOllama(
model="llama3.1",
base_url = "https://aaaaaaaaaaa.com/copilot"
)
chat_model.invoke("hello") |
Resolves #244 as well. I'd love to see this PR get merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I can merge this is you add some doc tests. Something like this should be sufficient:
>>> _parse_host('example.com/path')
'http://example.com:11434/path'
>>> _parse_host('example.com:56789/path')
'http://example.com:56789/path'
>>> _parse_host('https://example.com:56789/path')
'https://example.com:56789/path'
>>> _parse_host('example.com:56789/path/')
'http://example.com:56789/path'
thanks @mxyng I've added your suggestions to the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks!
Co-authored-by: Michael Yang <mxyng@pm.me>
This fix for #113 allows instantiating a client with a custom URL path as part of the host argument.
Resolves #244
Resolves #113