mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-14 02:28:30 +00:00
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
### Qdrant Client * Add core client with collection, search, and document APIs (sync + async) * Refactor utilities, types, and vector params (default 384-dim) * Improve error handling with `ClientMethodMismatchError` * Add score normalization, async embeddings, and optional `qdrant-client` dep * Expand tests and type safety throughout
27 lines
858 B
Python
27 lines
858 B
Python
"""Core exceptions for RAG module."""
|
|
|
|
|
|
class ClientMethodMismatchError(TypeError):
|
|
"""Raised when a method is called with the wrong client type.
|
|
|
|
Typically used when a sync method is called with an async client,
|
|
or vice versa.
|
|
"""
|
|
|
|
def __init__(
|
|
self, method_name: str, expected_client: str, alt_method: str, alt_client: str
|
|
) -> None:
|
|
"""Create a ClientMethodMismatchError.
|
|
|
|
Args:
|
|
method_name: Method that was called incorrectly.
|
|
expected_client: Required client type.
|
|
alt_method: Suggested alternative method.
|
|
alt_client: Client type for the alternative method.
|
|
"""
|
|
message = (
|
|
f"Method {method_name}() requires a {expected_client}. "
|
|
f"Use {alt_method}() for {alt_client}."
|
|
)
|
|
super().__init__(message)
|