Skip to content

Commit

Permalink
s/base/base_url/
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyng committed Dec 22, 2023
1 parent cfc1dc2 commit 916fe11
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ollama/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@


class BaseClient:
def __init__(self, client, base_url='http://127.0.0.1:11434') -> None:
def __init__(self, client, base_url: str = 'http://127.0.0.1:11434') -> None:
self._client = client(base_url=base_url, follow_redirects=True, timeout=None)


class Client(BaseClient):
def __init__(self, base='http://localhost:11434') -> None:
super().__init__(httpx.Client, base)
def __init__(self, base_url: str = 'http://localhost:11434') -> None:
super().__init__(httpx.Client, base_url)

def _request(self, method: str, url: str, **kwargs) -> httpx.Response:
response = self._client.request(method, url, **kwargs)
Expand Down Expand Up @@ -223,8 +223,8 @@ def show(self, model: str) -> Mapping[str, Any]:


class AsyncClient(BaseClient):
def __init__(self, base='http://localhost:11434') -> None:
super().__init__(httpx.AsyncClient, base)
def __init__(self, base_url: str = 'http://localhost:11434') -> None:
super().__init__(httpx.AsyncClient, base_url)

async def _request(self, method: str, url: str, **kwargs) -> httpx.Response:
response = await self._client.request(method, url, **kwargs)
Expand Down

0 comments on commit 916fe11

Please sign in to comment.