weaviate_agents.query.classes

pydantic model weaviate_agents.query.classes.QueryAgentCollectionConfig[source]

Bases: BaseModel

A collection configuration for the QueryAgent.

name

The name of the collection to query.

tenant

Tenant name for collections with multi-tenancy enabled.

view_properties

Optional list of property names the agent has the ability to view for this specific collection.

target_vector

Optional target vector name(s) for collections with named vectors. Can be a single vector name or a list of vector names.

additional_filters

Optional filters to apply when the query is executed, in addition to filters selected by the Query Agent (i.e., there are AND combined).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field additional_filters: Annotated[_Filters, PlainSerializer(func=serialise_filter, return_type=PydanticUndefined, when_used=always)] | None = None
field name: str [Required]
field target_vector: str | list[str] | None = None
field tenant: str | None = None
field view_properties: list[str] | None = None
pydantic model weaviate_agents.query.classes.QueryAgentResponse[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field aggregations: list[list[AggregationResultWithCollection]] [Required]
field collection_names: list[str] [Required]
field final_answer: str [Required]
field is_partial_answer: bool [Required]
field missing_information: list[str] [Required]
field original_query: str [Required]
field output_type: Literal['final_state'] = 'final_state'
field searches: list[list[QueryResultWithCollection]] [Required]
field sources: list[Source] [Required]
field total_time: float [Required]
field usage: Usage [Required]
display()[source]

Display a pretty-printed summary of the QueryAgentResponse object.

Return type:

None

pydantic model weaviate_agents.query.classes.Source[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field collection: str [Required]
field object_id: str [Required]
class weaviate_agents.query.classes.ComparisonOperator(*values)[source]

Bases: str, Enum

EQUALS = '='
LESS_THAN = '<'
GREATER_THAN = '>'
LESS_EQUAL = '<='
GREATER_EQUAL = '>='
NOT_EQUALS = '!='
LIKE = 'LIKE'
CONTAINS_ANY = 'contains_any'
CONTAINS_ALL = 'contains_all'
pydantic model weaviate_agents.query.classes.IntegerPropertyFilter[source]

Bases: KnownPropertyFilterBase

Filter numeric properties using comparison operators.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_type: Literal[KnownFilterType.INTEGER] = KnownFilterType.INTEGER
field operator: ComparisonOperator [Required]
field property_name: str [Required]
field value: float [Required]
pydantic model weaviate_agents.query.classes.TextPropertyFilter[source]

Bases: KnownPropertyFilterBase

Filter text properties using equality or LIKE operators.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_type: Literal[KnownFilterType.TEXT] = KnownFilterType.TEXT
field operator: ComparisonOperator [Required]
field property_name: str [Required]
field value: str [Required]
pydantic model weaviate_agents.query.classes.BooleanPropertyFilter[source]

Bases: KnownPropertyFilterBase

Filter boolean properties using equality operators.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_type: Literal[KnownFilterType.BOOLEAN] = KnownFilterType.BOOLEAN
field operator: ComparisonOperator [Required]
field property_name: str [Required]
field value: bool [Required]
pydantic model weaviate_agents.query.classes.QueryResult[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_operators: Literal['AND', 'OR'] [Required]
field filters: list[list[PropertyFilter]] = []
field queries: list[str | None] [Required]
class weaviate_agents.query.classes.NumericMetrics(*values)[source]

Bases: str, Enum

COUNT = 'COUNT'
MAX = 'MAXIMUM'
MEAN = 'MEAN'
MEDIAN = 'MEDIAN'
MIN = 'MINIMUM'
MODE = 'MODE'
SUM = 'SUM'
TYPE = 'TYPE'
class weaviate_agents.query.classes.TextMetrics(*values)[source]

Bases: str, Enum

COUNT = 'COUNT'
TYPE = 'TYPE'
TOP_OCCURRENCES = 'TOP_OCCURRENCES'
class weaviate_agents.query.classes.BooleanMetrics(*values)[source]

Bases: str, Enum

COUNT = 'COUNT'
TYPE = 'TYPE'
TOTAL_TRUE = 'TOTAL_TRUE'
TOTAL_FALSE = 'TOTAL_FALSE'
PERCENTAGE_TRUE = 'PERCENTAGE_TRUE'
PERCENTAGE_FALSE = 'PERCENTAGE_FALSE'
pydantic model weaviate_agents.query.classes.IntegerPropertyAggregation[source]

Bases: KnownPropertyAggregationBase

Aggregate numeric properties using statistical functions.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field aggregation_type: Literal[KnownAggregationType.INTEGER] = KnownAggregationType.INTEGER
field metrics: NumericMetrics [Required]
field property_name: str [Required]
pydantic model weaviate_agents.query.classes.TextPropertyAggregation[source]

Bases: KnownPropertyAggregationBase

Aggregate text properties using frequency analysis.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field aggregation_type: Literal[KnownAggregationType.TEXT] = KnownAggregationType.TEXT
field metrics: TextMetrics [Required]
field property_name: str [Required]
field top_occurrences_limit: int | None = None
pydantic model weaviate_agents.query.classes.BooleanPropertyAggregation[source]

Bases: KnownPropertyAggregationBase

Aggregate boolean properties using statistical functions.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field aggregation_type: Literal[KnownAggregationType.BOOLEAN] = KnownAggregationType.BOOLEAN
field metrics: BooleanMetrics [Required]
field property_name: str [Required]
pydantic model weaviate_agents.query.classes.AggregationResult[source]

Bases: BaseModel

The aggregations to be performed on a collection in a vector database.

They should be based on the original user query and can include multiple aggregations across different properties and metrics.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field aggregations: list[PropertyAggregation] [Required]
field filters: list[PropertyFilter] = []
field groupby_property: str | None = None
field search_query: str | None = None
pydantic model weaviate_agents.query.classes.Usage[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field details: Dict[str, int] | Dict[str, str] | None = None
field request_tokens: int | str | None = None
field requests: int | str = 0
field response_tokens: int | str | None = None
field total_tokens: int | str | None = None
pydantic model weaviate_agents.query.classes.AggregationResultWithCollection[source]

Bases: AggregationResult

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field aggregations: list[PropertyAggregation] [Required]
field collection: str [Required]
field filters: list[PropertyFilter] = []
field groupby_property: str | None = None
field search_query: str | None = None
pydantic model weaviate_agents.query.classes.QueryResultWithCollection[source]

Bases: QueryResult

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field collection: str [Required]
field filter_operators: Literal['AND', 'OR'] [Required]
field filters: list[list[PropertyFilter]] = []
field queries: list[str | None] [Required]
pydantic model weaviate_agents.query.classes.BooleanArrayPropertyFilter[source]

Bases: KnownPropertyFilterBase

Filter boolean-array properties using equality operators.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_type: Literal[KnownFilterType.BOOLEAN_ARRAY] = KnownFilterType.BOOLEAN_ARRAY
field operator: ComparisonOperator [Required]
field property_name: str [Required]
field value: list[bool] [Required]
pydantic model weaviate_agents.query.classes.DateArrayPropertyFilter[source]

Bases: KnownPropertyFilterBase

Filter datetime properties using equality operators.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_type: Literal[KnownFilterType.DATE_ARRAY] = KnownFilterType.DATE_ARRAY
field operator: ComparisonOperator [Required]
field property_name: str [Required]
field value: list[str] [Required]
class weaviate_agents.query.classes.DateMetrics(*values)[source]

Bases: str, Enum

COUNT = 'COUNT'
MAX = 'MAXIMUM'
MEDIAN = 'MEDIAN'
MIN = 'MINIMUM'
MODE = 'MODE'
pydantic model weaviate_agents.query.classes.DatePropertyAggregation[source]

Bases: KnownPropertyAggregationBase

Aggregate datetime properties using statistical functions.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field aggregation_type: Literal[KnownAggregationType.DATE] = KnownAggregationType.DATE
field metrics: DateMetrics [Required]
field property_name: str [Required]
pydantic model weaviate_agents.query.classes.DatePropertyFilter[source]

Bases: KnownPropertyFilterBase

Filter datetime properties using equality operators.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_type: Literal[KnownFilterType.DATE] = KnownFilterType.DATE
field property_name: str [Required]
field value: DateExact | DateRangeFrom | DateRangeTo | DateRangeBetween [Required]
pydantic model weaviate_agents.query.classes.IntegerArrayPropertyFilter[source]

Bases: KnownPropertyFilterBase

Filter numeric-array properties using comparison operators.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_type: Literal[KnownFilterType.INTEGER_ARRAY] = KnownFilterType.INTEGER_ARRAY
field operator: ComparisonOperator [Required]
field property_name: str [Required]
field value: list[float] [Required]
pydantic model weaviate_agents.query.classes.TextArrayPropertyFilter[source]

Bases: KnownPropertyFilterBase

Filter text-array properties using equality or LIKE operators.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_type: Literal[KnownFilterType.TEXT_ARRAY] = KnownFilterType.TEXT_ARRAY
field operator: ComparisonOperator [Required]
field property_name: str [Required]
field value: list[str] [Required]
pydantic model weaviate_agents.query.classes.GeoPropertyFilter[source]

Bases: KnownPropertyFilterBase

Filter geo-coordinates properties.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_type: Literal[KnownFilterType.GEO] = KnownFilterType.GEO
field latitude: float [Required]
field longitude: float [Required]
field max_distance_meters: float [Required]
field property_name: str [Required]
pydantic model weaviate_agents.query.classes.UnknownPropertyAggregation[source]

Bases: BaseModel

Catch-all aggregation for unknown aggregation types, to preserve future back-compatibility.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field aggregation_type: None [Required]
Validated by:
  • ensure_filter_type_unknown

model_post_init(context)[source]

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

Parameters:

context (Any)

Return type:

None

pydantic model weaviate_agents.query.classes.UnknownPropertyFilter[source]

Bases: BaseModel

Catch-all filter for unknown filter types, to preserve future back-compatibility.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_type: None [Required]
Validated by:
  • ensure_filter_type_unknown

model_post_init(context)[source]

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

Parameters:

context (Any)

Return type:

None

class weaviate_agents.query.classes.ProgressDetails[source]

Bases: TypedDict

queries: list[QueryWithCollection]
pydantic model weaviate_agents.query.classes.ProgressMessage[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field details: ProgressDetails = {}
field message: str [Required]
field output_type: Literal['progress_message'] = 'progress_message'
field stage: str [Required]
class weaviate_agents.query.classes.QueryWithCollection[source]

Bases: TypedDict

query: str
collection: str
pydantic model weaviate_agents.query.classes.StreamedTokens[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field delta: str [Required]
field output_type: Literal['streamed_tokens'] = 'streamed_tokens'
pydantic model weaviate_agents.query.classes.IsNullPropertyFilter[source]

Bases: KnownPropertyFilterBase

Filter by property null state.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field filter_type: Literal[KnownFilterType.IS_NULL] = KnownFilterType.IS_NULL
field is_null: bool [Required]
field property_name: str [Required]
pydantic model weaviate_agents.query.classes.SearchModeResponseBase[source]

Bases: BaseModel, ABC, Generic[SearcherT]

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field search_results: QueryReturn [Required]
field searches: list[QueryResultWithCollectionNormalized] | None = None
field total_time: float [Required]
field usage: ModelUnitUsage [Required]
model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

abstractmethod next(limit=20, offset=0)[source]
Parameters:
  • self (SearchModeResponseT)

  • limit (int)

  • offset (int)

Return type:

SearchModeResponseT | Coroutine[Any, Any, SearchModeResponseT]

class weaviate_agents.query.classes.ChatMessage[source]

Bases: TypedDict

role: Literal['user', 'assistant']
content: str
pydantic model weaviate_agents.query.classes.AskModeResponse[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field aggregations: list[AggregationResultWithCollectionNormalized] [Required]
field final_answer: str [Required]
field is_partial_answer: bool | None [Required]
field missing_information: list[str] | None [Required]
field output_type: Literal['final_state'] = 'final_state'
field searches: list[QueryResultWithCollectionNormalized] [Required]
field sources: list[Source] | None [Required]
field total_time: float [Required]
field usage: ModelUnitUsage [Required]
display()[source]

Display a pretty-printed summary of the AskModeResponse object.

Return type:

None

pydantic model weaviate_agents.query.classes.ModelUnitUsage[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field model_units: int [Required]
field remaining_plan_requests: int [Required]
field usage_in_plan: bool [Required]
pydantic model weaviate_agents.query.classes.FilterAndOr[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field combine: Literal['AND', 'OR'] [Required]
field filters: list[PropertyFilter | FilterAndOr] [Required]
pydantic model weaviate_agents.query.classes.QueryResultWithCollectionNormalized[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field collection: str [Required]
field filters: PropertyFilter | FilterAndOr | None [Required]
field query: str | None [Required]
field sort_property: QuerySort | None = None
pydantic model weaviate_agents.query.classes.AggregationResultWithCollectionNormalized[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field aggregation: PropertyAggregation [Required]
field collection: str [Required]
field filters: PropertyFilter | FilterAndOr | None [Required]
field groupby_property: str | None [Required]
pydantic model weaviate_agents.query.classes.QuerySort[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field order: Literal['ascending', 'descending'] [Required]
field property_name: str [Required]
field tie_break: QuerySort | None [Required]