s/base/base_url/

This commit is contained in:
Michael Yang 2023-12-21 16:38:52 -08:00
parent de61864358
commit 2236de230c

View File

@ -19,13 +19,13 @@ from ollama._types import Message, Options
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)
@ -223,8 +223,8 @@ class Client(BaseClient):
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)