Skip to content

Sourcery Starbot ⭐ refactored KennyRich/ollama-python #6

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ollama_python/endpoints/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ def _format_base_url(self, base_url: str) -> str:
:param base_url: The base URL to format
:return: The formatted base URL
"""
if base_url.endswith("/"):
base_url = base_url[:-1]
return base_url
return base_url.removesuffix("/")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BaseAPI._format_base_url refactored with the following changes:


def _stream(
self, endpoint: str, parameters: dict, return_type: Optional[Callable] = None
Expand Down