Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:
WEAVIATE_131: 1.31.19
WEAVIATE_132: 1.32.16
WEAVIATE_133: 1.33.4
WEAVIATE_134: 1.34.0
WEAVIATE_134: 1.34.1

jobs:
lint-and-format:
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
folder: ["weaviate", "integration", "integration_embedded"]
steps:
- uses: actions/checkout@v4
Expand All @@ -79,7 +79,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
folder: ["test", "mock_tests"]
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
optional_dependencies: [false]
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -153,11 +153,11 @@ jobs:
fail-fast: false
matrix:
versions: [
{ py: "3.9", weaviate: $WEAVIATE_132, grpc: "1.59.0"},
{ py: "3.10", weaviate: $WEAVIATE_132, grpc: "1.66.0"},
{ py: "3.11", weaviate: $WEAVIATE_132, grpc: "1.70.0"},
{ py: "3.12", weaviate: $WEAVIATE_132, grpc: "1.72.1"},
{ py: "3.13", weaviate: $WEAVIATE_132, grpc: "1.74.0"}
{ py: "3.10", weaviate: $WEAVIATE_132, grpc: "1.59.0"},
{ py: "3.11", weaviate: $WEAVIATE_132, grpc: "1.66.0"},
{ py: "3.12", weaviate: $WEAVIATE_132, grpc: "1.70.0"},
{ py: "3.13", weaviate: $WEAVIATE_132, grpc: "1.72.1"},
{ py: "3.14", weaviate: $WEAVIATE_132, grpc: "1.76.0"}
]
optional_dependencies: [false]
steps:
Expand Down Expand Up @@ -208,11 +208,11 @@ jobs:
fail-fast: false
matrix:
versions: [
{ py: "3.9", weaviate: $WEAVIATE_132},
{ py: "3.10", weaviate: $WEAVIATE_132},
{ py: "3.11", weaviate: $WEAVIATE_132},
{ py: "3.12", weaviate: $WEAVIATE_132},
{ py: "3.13", weaviate: $WEAVIATE_132}
{ py: "3.13", weaviate: $WEAVIATE_132},
{ py: "3.14", weaviate: $WEAVIATE_132}
]
optional_dependencies: [false]
steps:
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.11.7
rev: v0.14.7
hooks:
# Run the linter.
- id: ruff
Expand All @@ -19,24 +19,24 @@ repos:
args: [ weaviate, integration, test, mock_tests, journey_tests ]

- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
rev: 7.3.0
hooks:
- id: flake8
name: linting
additional_dependencies: [
'flake8-bugbear==22.10.27',
'flake8-comprehensions==3.10.1',
'flake8-builtins==2.0.1'
'flake8-bugbear==24.12.12',
'flake8-comprehensions==3.17.0',
'flake8-builtins==3.0.0'
]
- id: flake8
name: docstrings
additional_dependencies: [
'flake8-docstrings==1.7.0',
'pydoclint==0.6.5',
'pydoclint==0.7.3',
]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v6.0.0
hooks:
- id: no-commit-to-branch
- id: trailing-whitespace
Expand Down
8 changes: 4 additions & 4 deletions requirements-devel.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
httpx==0.26.0
validators==0.34.0
authlib==1.6.5
grpcio==1.66.2
grpcio-tools==1.66.2
grpcio-health-checking==1.66.2
pydantic==2.8.0
grpcio==1.75.1
grpcio-tools==1.75.1
grpcio-health-checking==1.75.1
pydantic==2.12.0
deprecation==2.1.0

build
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ install_requires =
httpx>=0.26.0,<0.29.0
validators>=0.34.0,<1.0.0
authlib>=1.2.1,<2.0.0
pydantic>=2.8.0,<3.0.0
pydantic>=2.12.0,<3.0.0
grpcio>=1.59.5,<1.80.0
protobuf>=4.21.6,<7.0.0
deprecation>=2.1.0,<3.0.0
python_requires = >=3.9
python_requires = >=3.10

[options.extras_require]
agents =
Expand Down
50 changes: 36 additions & 14 deletions weaviate/collections/classes/generative.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path
from typing import List, Optional, Union

from pydantic import AnyHttpUrl, AnyUrl, BaseModel, Field
from pydantic import AnyHttpUrl, BaseModel, Field, TypeAdapter

from weaviate.collections.classes.config import (
AWSService,
Expand Down Expand Up @@ -503,7 +503,7 @@ def anthropic(
top_p: The top P to use. Defaults to `None`, which uses the server-defined default
"""
return _GenerativeAnthropic(
base_url=AnyUrl(base_url) if base_url is not None else None,
base_url=TypeAdapter(AnyHttpUrl).validate_python(base_url),
model=model,
max_tokens=max_tokens,
stop_sequences=stop_sequences,
Expand All @@ -527,7 +527,9 @@ def anyscale(
temperature: The temperature to use. Defaults to `None`, which uses the server-defined default
"""
return _GenerativeAnyscale(
base_url=AnyUrl(base_url) if base_url is not None else None,
base_url=TypeAdapter(AnyHttpUrl).validate_python(base_url)
if base_url is not None
else None,
model=model,
temperature=temperature,
)
Expand Down Expand Up @@ -564,7 +566,9 @@ def aws(
max_tokens=max_tokens,
region=region,
service=service,
endpoint=AnyUrl(endpoint) if endpoint is not None else None,
endpoint=TypeAdapter(AnyHttpUrl).validate_python(endpoint)
if endpoint is not None
else None,
target_model=target_model,
target_variant=target_variant,
temperature=temperature,
Expand Down Expand Up @@ -598,7 +602,9 @@ def cohere(
temperature: The temperature to use. Defaults to `None`, which uses the server-defined default
"""
return _GenerativeCohere(
base_url=AnyUrl(base_url) if base_url is not None else None,
base_url=TypeAdapter(AnyHttpUrl).validate_python(base_url)
if base_url is not None
else None,
k=k,
max_tokens=max_tokens,
model=model,
Expand Down Expand Up @@ -671,7 +677,7 @@ def databricks(
top_p: The top P value to use. Defaults to `None`, which uses the server-defined default
"""
return _GenerativeDatabricks(
endpoint=AnyUrl(endpoint),
endpoint=TypeAdapter(AnyHttpUrl).validate_python(endpoint),
frequency_penalty=frequency_penalty,
log_probs=log_probs,
max_tokens=max_tokens,
Expand Down Expand Up @@ -710,7 +716,9 @@ def friendliai(
top_p: The top P value to use. Defaults to `None`, which uses the server-defined default
"""
return _GenerativeFriendliai(
base_url=AnyUrl(base_url) if base_url is not None else None,
base_url=TypeAdapter(AnyHttpUrl).validate_python(base_url)
if base_url is not None
else None,
max_tokens=max_tokens,
model=model,
n=n,
Expand Down Expand Up @@ -754,7 +762,9 @@ def google(
top_p: The top P to use. Defaults to `None`, which uses the server-defined default
"""
return _GenerativeGoogle(
api_endpoint=AnyUrl(api_endpoint) if api_endpoint is not None else None,
api_endpoint=TypeAdapter(AnyHttpUrl).validate_python(api_endpoint)
if api_endpoint is not None
else None,
endpoint_id=endpoint_id,
frequency_penalty=frequency_penalty,
max_tokens=max_tokens,
Expand Down Expand Up @@ -787,7 +797,9 @@ def mistral(
top_p: The top P value to use. Defaults to `None`, which uses the server-defined default
"""
return _GenerativeMistral(
base_url=AnyUrl(base_url) if base_url is not None else None,
base_url=TypeAdapter(AnyHttpUrl).validate_python(base_url)
if base_url is not None
else None,
max_tokens=max_tokens,
model=model,
temperature=temperature,
Expand All @@ -813,7 +825,9 @@ def nvidia(
top_p: The top P value to use. Defaults to `None`, which uses the server-defined default
"""
return _GenerativeNvidia(
base_url=AnyUrl(base_url) if base_url is not None else None,
base_url=TypeAdapter(AnyHttpUrl).validate_python(base_url)
if base_url is not None
else None,
max_tokens=max_tokens,
model=model,
temperature=temperature,
Expand All @@ -840,7 +854,9 @@ def ollama(
The number of images passed to the prompt will match the value of `limit` in the search query.
"""
return _GenerativeOllama(
api_endpoint=AnyUrl(api_endpoint) if api_endpoint is not None else None,
api_endpoint=TypeAdapter(AnyHttpUrl).validate_python(api_endpoint)
if api_endpoint is not None
else None,
model=model,
temperature=temperature,
)
Expand Down Expand Up @@ -884,7 +900,9 @@ def openai(
"""
return _GenerativeOpenAI(
api_version=api_version,
base_url=AnyUrl(base_url) if base_url is not None else None,
base_url=TypeAdapter(AnyHttpUrl).validate_python(base_url)
if base_url is not None
else None,
deployment_id=deployment_id,
frequency_penalty=frequency_penalty,
max_tokens=max_tokens,
Expand Down Expand Up @@ -934,7 +952,9 @@ def azure_openai(
"""
return _GenerativeOpenAI(
api_version=api_version,
base_url=AnyUrl(base_url) if base_url is not None else None,
base_url=TypeAdapter(AnyHttpUrl).validate_python(base_url)
if base_url is not None
else None,
deployment_id=deployment_id,
frequency_penalty=frequency_penalty,
max_tokens=max_tokens,
Expand Down Expand Up @@ -971,7 +991,9 @@ def xai(
top_p: The top P to use. Defaults to `None`, which uses the server-defined default
"""
return _GenerativeXAI(
base_url=AnyUrl(base_url) if base_url is not None else None,
base_url=TypeAdapter(AnyHttpUrl).validate_python(base_url)
if base_url is not None
else None,
max_tokens=max_tokens,
model=model,
temperature=temperature,
Expand Down
5 changes: 3 additions & 2 deletions weaviate/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,9 @@ def _datetime_from_weaviate_str(string: str) -> datetime.datetime:
return datetime.datetime.strptime(string, date_format)
except ValueError as e:
# note that the year 9999 is valid and does not need to be handled. for 5 digit years only the first
# 4 digits are considered and it wrapps around
if "year 0 is out of range" in str(e):
# 4 digits are considered and it wrapps around. The datetime library changed the error message in python 3.14
# to include "year must be in ...", so we check for both messages here.
if "year 0 is out of range" in str(e) or "year must be in" in str(e):
_Warnings.datetime_year_zero(string)
return datetime.datetime.min
raise e
Expand Down