Skip to content
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
6 changes: 6 additions & 0 deletions ollama/_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import contextlib
import ipaddress
import json
import logging
import os
import platform
import sys
Expand All @@ -26,52 +27,57 @@
import anyio
from pydantic.json_schema import JsonSchemaValue

# Set httpx logger to WARNING level to suppress verbose HTTP request logs at INFO level.
# Users who want to see these logs can set the level back to INFO or DEBUG in their application.
# See: https://github.com/ollama/ollama-python/issues/539
logging.getLogger('httpx').setLevel(logging.WARNING)

from ollama._utils import convert_function_to_tool

Check failure on line 35 in ollama/_client.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (E402)

ollama/_client.py:35:1: E402 Module level import not at top of file

if sys.version_info < (3, 9):
from typing import AsyncIterator, Iterator
else:
from collections.abc import AsyncIterator, Iterator

from importlib import metadata

Check failure on line 42 in ollama/_client.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (E402)

ollama/_client.py:42:1: E402 Module level import not at top of file

try:
__version__ = metadata.version('ollama')
except metadata.PackageNotFoundError:
__version__ = '0.0.0'

import httpx

Check failure on line 49 in ollama/_client.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (E402)

ollama/_client.py:49:1: E402 Module level import not at top of file

from ollama._types import (
ChatRequest,
ChatResponse,
CopyRequest,
CreateRequest,
DeleteRequest,
EmbeddingsRequest,
EmbeddingsResponse,
EmbedRequest,
EmbedResponse,
GenerateRequest,
GenerateResponse,
Image,
ListResponse,
Message,
Options,
ProcessResponse,
ProgressResponse,
PullRequest,
PushRequest,
ResponseError,
ShowRequest,
ShowResponse,
StatusResponse,
Tool,
WebFetchRequest,
WebFetchResponse,
WebSearchRequest,
WebSearchResponse,
)

Check failure on line 80 in ollama/_client.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (E402)

ollama/_client.py:51:1: E402 Module level import not at top of file

T = TypeVar('T')

Expand Down
Loading