Skip to content
Open
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
2 changes: 2 additions & 0 deletions weaviate_agents/query/classes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
IsNullPropertyFilter,
ModelUnitUsage,
NumericMetrics,
ParsedAskModeResponse,
ProgressDetails,
ProgressMessage,
QueryAgentResponse,
Expand Down Expand Up @@ -79,6 +80,7 @@
"GeoPropertyFilter",
"UnknownPropertyAggregation",
"UnknownPropertyFilter",
"ParsedAskModeResponse",
"ProgressDetails",
"ProgressMessage",
"QueryWithCollection",
Expand Down
9 changes: 8 additions & 1 deletion weaviate_agents/query/classes/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)
from uuid import UUID

from pydantic import BaseModel, ConfigDict, Field, field_validator
from pydantic import BaseModel, ConfigDict, Field, SerializeAsAny, field_validator
from typing_extensions import TypedDict
from weaviate.outputs.query import QueryReturn

Expand Down Expand Up @@ -479,6 +479,13 @@ def display(self) -> None:
return None


T = TypeVar("T", bound=Union[dict, BaseModel])


class ParsedAskModeResponse(AskModeResponse, Generic[T]):
final_answer_parsed: SerializeAsAny[T]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dannyjameswilliams can you help me understand this?

You say the bound of the type is a dict or any BaseModel? What does that do?



class ResearchModeResponse(BaseModel):
output_type: Literal["final_state"] = "final_state"

Expand Down
Loading
Loading