mirror of
https://github.com/ollama/ollama-python.git
synced 2026-02-04 02:54:08 -06:00
s/base/base_url/
This commit is contained in:
parent
de61864358
commit
2236de230c
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user