weaviate_agents.personalization.classes package
- class weaviate_agents.personalization.classes.Persona(*, persona_id, properties)[source]
Bases:
BaseModelCreate 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.
- Parameters:
persona_id (UUID)
properties (Dict[str, Any])
- persona_id: UUID
- properties: Dict[str, Any]
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate_agents.personalization.classes.PersonaInteraction(*, persona_id, item_id, weight, replace_previous_interactions=False, created_at=None)[source]
Bases:
BaseModelInteraction between a persona and an item.
If replace_previous_interactions is True, the interaction history for that specific item and persona pair will be replaced with the new interaction.
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.
- Parameters:
persona_id (UUID)
item_id (UUID)
weight (float)
replace_previous_interactions (bool)
created_at (datetime | None)
- persona_id: UUID
- item_id: UUID
- weight: float
- replace_previous_interactions: bool
- created_at: datetime | None
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate_agents.personalization.classes.PersonaInteractionResponse(*, uuid, weight, createdAt)[source]
Bases:
BaseModelResponse model for persona interactions when retrieving them.
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.
- Parameters:
uuid (UUID)
weight (float)
createdAt (str)
- item_id: UUID
- weight: float
- created_at: str
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate_agents.personalization.classes.PersonalizationAgentGetObjectsResponse(*, objects, ranking_rationale=None, usage)[source]
Bases:
BaseModelCreate 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.
- Parameters:
objects (list[PersonalizedObject])
ranking_rationale (str | None)
usage (Usage)
- objects: list[PersonalizedObject]
- ranking_rationale: str | None
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate_agents.personalization.classes.PersonalizedObject(*, uuid, original_rank, personalized_rank, properties)[source]
Bases:
BaseModelCreate 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.
- Parameters:
uuid (UUID)
original_rank (int)
personalized_rank (int | None)
properties (Dict[str, Any])
- uuid: UUID
- original_rank: int
- personalized_rank: int | None
- properties: Dict[str, Any]
- model_dump(**kwargs)[source]
- !!! abstract “Usage Documentation”
[model_dump](../concepts/serialization.md#python-mode)
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
- Parameters:
mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.
include – A set of fields to include in the output.
exclude – A set of fields to exclude from the output.
context – Additional context to pass to the serializer.
by_alias – Whether to use the field’s alias in the dictionary key if defined.
exclude_unset – Whether to exclude fields that have not been explicitly set.
exclude_defaults – Whether to exclude fields that are set to their default value.
exclude_none – Whether to exclude fields that have a value of None.
exclude_computed_fields – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended tu use the dedicated round_trip parameter instead.
round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].
warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].
fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.
serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.
- Returns:
A dictionary representation of the model.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate_agents.personalization.classes.Usage(*, requests=0, request_tokens=None, response_tokens=None, total_tokens=None, details=None)[source]
Bases:
BaseModelCreate 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.
- Parameters:
requests (int | str)
request_tokens (int | str | None)
response_tokens (int | str | None)
total_tokens (int | str | None)
details (Dict[str, int] | Dict[str, str] | None)
- requests: int | str
- request_tokens: int | str | None
- response_tokens: int | str | None
- total_tokens: int | str | None
- details: Dict[str, int] | Dict[str, str] | None
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate_agents.personalization.classes.PersonalizedQueryResponse(*, objects, usage)[source]
Bases:
BaseModel,QueryReturnCreate 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.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate_agents.personalization.classes.GetObjectsRequest(*, persona_id, limit=10, recent_interactions_count=100, exclude_interacted_items=True, decay_rate=0.1, exclude_items=[], use_agent_ranking=True, explain_results=True, instruction=None, filters=None)[source]
Bases:
BaseModelCreate 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.
- Parameters:
persona_id (UUID)
limit (int)
recent_interactions_count (int)
exclude_interacted_items (bool)
decay_rate (float)
exclude_items (List[str])
use_agent_ranking (bool)
explain_results (bool)
instruction (str | None)
filters (Annotated[_Filters, PlainSerializer(func=~weaviate_agents.serialise.serialise_filter, return_type=PydanticUndefined, when_used=always)] | None)
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- persona_id: UUID
- limit: int
- recent_interactions_count: int
- exclude_interacted_items: bool
- decay_rate: float
- exclude_items: List[str]
- use_agent_ranking: bool
- explain_results: bool
- instruction: str | None
- class weaviate_agents.personalization.classes.PersonalizationRequest(*, collection_name, create=True, headers=None, persona_properties=None, item_collection_vector_name=None)[source]
Bases:
BaseModelCreate 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.
- Parameters:
collection_name (str)
create (bool)
headers (Dict[str, str] | None)
persona_properties (Dict[str, str] | None)
item_collection_vector_name (str | None)
- collection_name: str
- create: bool
- headers: Dict[str, str] | None
- persona_properties: Dict[str, str] | None
- item_collection_vector_name: str | None
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate_agents.personalization.classes.BM25QueryParameters(*, query_method='bm25', query, query_properties=None, limit=None, offset=None, auto_limit=None, filters=None, rerank=None, include_vector=False, return_metadata=None, return_properties=None, return_references=None)[source]
Bases:
BaseModelCreate 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.
- Parameters:
query_method (Literal['bm25'])
query (str | None)
query_properties (List[str] | None)
limit (int | None)
offset (int | None)
auto_limit (int | None)
filters (Annotated[_Filters, PlainSerializer(func=~weaviate_agents.serialise.serialise_filter, return_type=PydanticUndefined, when_used=always)] | None)
rerank (Rerank | None)
include_vector (bool | str | List[str])
return_metadata (List[Literal['creation_time', 'last_update_time', 'distance', 'certainty', 'score', 'explain_score', 'is_consistent']] | ~weaviate.collections.classes.grpc.MetadataQuery | None)
return_properties (Sequence[str | QueryNested] | str | QueryNested | bool | Type[dict] | None)
return_references (_QueryReference | Sequence[_QueryReference] | Type[dict] | None)
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- query_method: Literal['bm25']
- query: str | None
- query_properties: List[str] | None
- limit: int | None
- offset: int | None
- auto_limit: int | None
- include_vector: bool | str | List[str]
- return_metadata: METADATA | None
- return_properties: ReturnProperties[dict] | None
- return_references: ReturnReferences[dict] | None
- class weaviate_agents.personalization.classes.HybridQueryParameters(*, query_method='hybrid', query, alpha=0.7, vector=None, query_properties=None, fusion_type=None, max_vector_distance=None, limit=None, offset=None, auto_limit=None, filters=None, rerank=None, target_vector=None, include_vector=False, return_metadata=None, return_properties=None, return_references=None)[source]
Bases:
BaseModelCreate 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.
- Parameters:
query_method (Literal['hybrid'])
query (str | None)
alpha (int | float)
vector (Annotated[Sequence[int | float] | Sequence[Sequence[int | float]] | Mapping[str, Sequence[int | float] | Sequence[Sequence[int | float]] | _ListOfVectorsQuery[Sequence[Union[int, float]]] | _ListOfVectorsQuery[Sequence[Sequence[Union[int, float]]]]] | _HybridNearText | _HybridNearVector, PlainSerializer(func=~weaviate_agents.serialise.serialise_hybrid_vector_type, return_type=PydanticUndefined, when_used=always)] | None)
query_properties (List[str] | None)
fusion_type (HybridFusion | None)
max_vector_distance (int | float | None)
limit (int | None)
offset (int | None)
auto_limit (int | None)
filters (Annotated[_Filters, PlainSerializer(func=~weaviate_agents.serialise.serialise_filter, return_type=PydanticUndefined, when_used=always)] | None)
rerank (Rerank | None)
target_vector (str | List[str] | _MultiTargetVectorJoin | None)
include_vector (bool | str | List[str])
return_metadata (List[Literal['creation_time', 'last_update_time', 'distance', 'certainty', 'score', 'explain_score', 'is_consistent']] | ~weaviate.collections.classes.grpc.MetadataQuery | None)
return_properties (Sequence[str | QueryNested] | str | QueryNested | bool | Type[dict] | None)
return_references (_QueryReference | Sequence[_QueryReference] | Type[dict] | None)
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- query_method: Literal['hybrid']
- query: str | None
- alpha: int | float
- vector: Annotated[HybridVectorType, serialise_hybrid_vector_type] | None
- query_properties: List[str] | None
- fusion_type: HybridFusion | None
- max_vector_distance: int | float | None
- limit: int | None
- offset: int | None
- auto_limit: int | None
- target_vector: TargetVectorJoinType | None
- include_vector: bool | str | List[str]
- return_metadata: METADATA | None
- return_properties: ReturnProperties[dict] | None
- return_references: ReturnReferences[dict] | None
- class weaviate_agents.personalization.classes.NearTextQueryParameters(*, query_method='near_text', query, certainty=None, distance=None, move_to=None, move_away=None, limit=None, offset=None, auto_limit=None, filters=None, rerank=None, target_vector=None, include_vector=False, return_metadata=None, return_properties=None, return_references=None)[source]
Bases:
BaseModelCreate 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.
- Parameters:
query_method (Literal['near_text'])
query (List[str] | str)
certainty (int | float | None)
distance (int | float | None)
move_to (Annotated[Move, PlainSerializer(func=~weaviate_agents.serialise.serialise_move, return_type=PydanticUndefined, when_used=always)] | None)
move_away (Annotated[Move, PlainSerializer(func=~weaviate_agents.serialise.serialise_move, return_type=PydanticUndefined, when_used=always)] | None)
limit (int | None)
offset (int | None)
auto_limit (int | None)
filters (Annotated[_Filters, PlainSerializer(func=~weaviate_agents.serialise.serialise_filter, return_type=PydanticUndefined, when_used=always)] | None)
rerank (Rerank | None)
target_vector (str | List[str] | _MultiTargetVectorJoin | None)
include_vector (bool | str | List[str])
return_metadata (List[Literal['creation_time', 'last_update_time', 'distance', 'certainty', 'score', 'explain_score', 'is_consistent']] | ~weaviate.collections.classes.grpc.MetadataQuery | None)
return_properties (Sequence[str | QueryNested] | str | QueryNested | bool | Type[dict] | None)
return_references (_QueryReference | Sequence[_QueryReference] | Type[dict] | None)
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- query_method: Literal['near_text']
- query: List[str] | str
- certainty: int | float | None
- distance: int | float | None
- limit: int | None
- offset: int | None
- auto_limit: int | None
- target_vector: TargetVectorJoinType | None
- include_vector: bool | str | List[str]
- return_metadata: METADATA | None
- return_properties: ReturnProperties[dict] | None
- return_references: ReturnReferences[dict] | None
- class weaviate_agents.personalization.classes.QueryRequest(*, persona_id, strength, recent_interactions_count, decay_rate, overfetch_factor, query_parameters)[source]
Bases:
BaseModelCreate 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.
- Parameters:
persona_id (UUID)
strength (float)
recent_interactions_count (int)
decay_rate (float)
overfetch_factor (float)
query_parameters (NearTextQueryParameters | BM25QueryParameters | HybridQueryParameters)
- strength: float
- recent_interactions_count: int
- decay_rate: float
- overfetch_factor: float
- query_parameters: QueryParameters
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].