beekeeper-core 1.0.1__py3-none-any.whl → 1.0.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- beekeeper/core/document/base.py +1 -1
- beekeeper/core/embeddings/base.py +49 -7
- beekeeper/core/evaluation/context_similarity.py +14 -14
- beekeeper/core/flows/ingestion_flow.py +16 -16
- beekeeper/core/guardrails/__init__.py +4 -0
- beekeeper/core/guardrails/base.py +15 -0
- beekeeper/core/guardrails/types.py +13 -0
- beekeeper/core/llms/__init__.py +1 -3
- beekeeper/core/llms/base.py +14 -10
- beekeeper/core/llms/decorators.py +80 -1
- beekeeper/core/llms/types.py +4 -0
- beekeeper/core/monitors/__init__.py +3 -0
- beekeeper/core/monitors/base.py +36 -0
- beekeeper/core/monitors/types.py +11 -0
- beekeeper/core/observers/__init__.py +2 -2
- beekeeper/core/observers/base.py +25 -28
- beekeeper/core/prompts/__init__.py +1 -1
- beekeeper/core/prompts/base.py +17 -5
- beekeeper/core/readers/base.py +1 -7
- beekeeper/core/readers/directory.py +5 -5
- beekeeper/core/text_chunkers/base.py +22 -5
- beekeeper/core/text_chunkers/semantic.py +13 -13
- beekeeper/core/text_chunkers/sentence.py +15 -15
- beekeeper/core/text_chunkers/token.py +15 -15
- beekeeper/core/tools/base.py +1 -1
- beekeeper/core/vector_stores/base.py +11 -2
- {beekeeper_core-1.0.1.dist-info → beekeeper_core-1.0.10.dist-info}/METADATA +7 -7
- beekeeper_core-1.0.10.dist-info/RECORD +43 -0
- beekeeper_core-1.0.1.dist-info/RECORD +0 -37
- {beekeeper_core-1.0.1.dist-info → beekeeper_core-1.0.10.dist-info}/WHEEL +0 -0
beekeeper/core/document/base.py
CHANGED
|
@@ -8,7 +8,7 @@ from pydantic.v1 import BaseModel, Field, validator
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class BaseDocument(ABC, BaseModel):
|
|
11
|
-
"""
|
|
11
|
+
"""Abstract base class defining the interface for retrievable documents."""
|
|
12
12
|
|
|
13
13
|
id_: str = Field(
|
|
14
14
|
default_factory=lambda: str(uuid.uuid4()),
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod
|
|
2
2
|
from enum import Enum
|
|
3
|
-
from typing import List
|
|
3
|
+
from typing import List, Union
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
from beekeeper.core.document import Document
|
|
7
7
|
from beekeeper.core.schema import TransformerComponent
|
|
8
8
|
from beekeeper.core.utils.pairwise import cosine_similarity
|
|
9
|
+
from deprecated import deprecated
|
|
9
10
|
|
|
10
11
|
Embedding = List[float]
|
|
11
12
|
|
|
@@ -35,23 +36,64 @@ def similarity(
|
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
class BaseEmbedding(TransformerComponent, ABC):
|
|
38
|
-
"""
|
|
39
|
+
"""Abstract base class defining the interface for embedding models."""
|
|
39
40
|
|
|
40
41
|
@classmethod
|
|
41
42
|
def class_name(cls) -> str:
|
|
42
43
|
return "BaseEmbedding"
|
|
43
44
|
|
|
44
45
|
@abstractmethod
|
|
46
|
+
def embed_text(
|
|
47
|
+
self, input: Union[str, List[str]]
|
|
48
|
+
) -> Union[Embedding, List[Embedding]]:
|
|
49
|
+
"""Embed one or more text strings."""
|
|
50
|
+
|
|
51
|
+
def embed_documents(self, documents: List[Document]) -> List[Document]:
|
|
52
|
+
"""
|
|
53
|
+
Embed a list of documents and assign the computed embeddings to the 'embedding' attribute.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
documents (List[Document]): List of documents to compute embeddings.
|
|
57
|
+
"""
|
|
58
|
+
texts = [document.get_content() for document in documents]
|
|
59
|
+
embeddings = self.embed_text(texts)
|
|
60
|
+
|
|
61
|
+
for document, embedding in zip(documents, embeddings):
|
|
62
|
+
document.embedding = embedding
|
|
63
|
+
|
|
64
|
+
return documents
|
|
65
|
+
|
|
66
|
+
@deprecated(
|
|
67
|
+
reason="'embed_texts()' is deprecated and will be removed in a future version. Use 'embed_text()' instead.",
|
|
68
|
+
version="1.0.3",
|
|
69
|
+
action="always",
|
|
70
|
+
)
|
|
71
|
+
def embed_texts(self, texts: List[str]) -> List[Embedding]:
|
|
72
|
+
return self.embed_text(texts)
|
|
73
|
+
|
|
74
|
+
@deprecated(
|
|
75
|
+
reason="'get_text_embedding()' is deprecated and will be removed in a future version. Use 'embed_text()' instead.",
|
|
76
|
+
version="1.0.2",
|
|
77
|
+
action="always",
|
|
78
|
+
)
|
|
45
79
|
def get_text_embedding(self, query: str) -> Embedding:
|
|
46
|
-
|
|
80
|
+
return self.embed_text(query)
|
|
47
81
|
|
|
48
|
-
@
|
|
82
|
+
@deprecated(
|
|
83
|
+
reason="'get_texts_embedding()' is deprecated and will be removed in a future version. Use 'embed_texts()' instead.",
|
|
84
|
+
version="1.0.2",
|
|
85
|
+
action="always",
|
|
86
|
+
)
|
|
49
87
|
def get_texts_embedding(self, texts: List[str]) -> List[Embedding]:
|
|
50
|
-
|
|
88
|
+
return self.embed_texts(texts)
|
|
51
89
|
|
|
52
|
-
@
|
|
90
|
+
@deprecated(
|
|
91
|
+
reason="'get_documents_embedding()' is deprecated and will be removed in a future version. Use 'embed_documents()' instead.",
|
|
92
|
+
version="1.0.2",
|
|
93
|
+
action="always",
|
|
94
|
+
)
|
|
53
95
|
def get_documents_embedding(self, documents: List[Document]) -> List[Document]:
|
|
54
|
-
|
|
96
|
+
return self.embed_documents(documents)
|
|
55
97
|
|
|
56
98
|
@staticmethod
|
|
57
99
|
def similarity(
|
|
@@ -10,7 +10,7 @@ class ContextSimilarityEvaluator(BaseModel):
|
|
|
10
10
|
Measures how much context has contributed to the answer’s.
|
|
11
11
|
A higher value suggests a greater proportion of the context is present in the LLM's response.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Attributes:
|
|
14
14
|
embed_model (BaseEmbedding): The embedding model used to compute vector representations.
|
|
15
15
|
similarity_mode (str, optional): Similarity strategy to use. Supported options are
|
|
16
16
|
`"cosine"`, `"dot_product"`, and `"euclidean"`. Defaults to `"cosine"`.
|
|
@@ -18,13 +18,13 @@ class ContextSimilarityEvaluator(BaseModel):
|
|
|
18
18
|
whether a context segment "passes". Defaults to `0.8`.
|
|
19
19
|
|
|
20
20
|
Example:
|
|
21
|
-
|
|
21
|
+
```python
|
|
22
|
+
from beekeeper.core.evaluation import ContextSimilarityEvaluator
|
|
23
|
+
from beekeeper.embeddings.huggingface import HuggingFaceEmbedding
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
embedding = HuggingFaceEmbedding()
|
|
27
|
-
ctx_sim_evaluator = ContextSimilarityEvaluator(embed_model=embedding)
|
|
25
|
+
embedding = HuggingFaceEmbedding()
|
|
26
|
+
ctx_sim_evaluator = ContextSimilarityEvaluator(embed_model=embedding)
|
|
27
|
+
```
|
|
28
28
|
"""
|
|
29
29
|
|
|
30
30
|
embed_model: BaseEmbedding
|
|
@@ -41,11 +41,11 @@ class ContextSimilarityEvaluator(BaseModel):
|
|
|
41
41
|
generated_text (str): LLM response based on given context.
|
|
42
42
|
|
|
43
43
|
Example:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
```python
|
|
45
|
+
evaluation_result = ctx_sim_evaluator.evaluate(
|
|
46
|
+
contexts=[], generated_text="<candidate>"
|
|
47
|
+
)
|
|
48
|
+
```
|
|
49
49
|
"""
|
|
50
50
|
if not contexts or not generated_text:
|
|
51
51
|
raise ValueError(
|
|
@@ -53,10 +53,10 @@ class ContextSimilarityEvaluator(BaseModel):
|
|
|
53
53
|
)
|
|
54
54
|
|
|
55
55
|
evaluation_result = {"contexts_score": [], "score": 0}
|
|
56
|
-
candidate_embedding = self.embed_model.
|
|
56
|
+
candidate_embedding = self.embed_model.embed_text(generated_text)
|
|
57
57
|
|
|
58
58
|
for context in contexts:
|
|
59
|
-
context_embedding = self.embed_model.
|
|
59
|
+
context_embedding = self.embed_model.embed_text(context)
|
|
60
60
|
evaluation_result["contexts_score"].append(
|
|
61
61
|
self.embed_model.similarity(
|
|
62
62
|
candidate_embedding,
|
|
@@ -22,7 +22,7 @@ class IngestionFlow:
|
|
|
22
22
|
"""
|
|
23
23
|
An ingestion flow for processing and storing data.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Attributes:
|
|
26
26
|
transformers (List[TransformerComponent]): A list of transformer components applied to the input documents.
|
|
27
27
|
doc_strategy (DocStrategy): The strategy used for handling document duplicates.
|
|
28
28
|
Defaults to `DocStrategy.DUPLICATE_ONLY`.
|
|
@@ -32,18 +32,18 @@ class IngestionFlow:
|
|
|
32
32
|
vector_store (BaseVectorStore, optional): Vector store for saving processed documents
|
|
33
33
|
|
|
34
34
|
Example:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
```python
|
|
36
|
+
from beekeeper.core.flows import IngestionFlow
|
|
37
|
+
from beekeeper.core.text_chunkers import TokenTextChunker
|
|
38
|
+
from beekeeper.embeddings.huggingface import HuggingFaceEmbedding
|
|
39
|
+
|
|
40
|
+
ingestion_flow = IngestionFlow(
|
|
41
|
+
transformers=[
|
|
42
|
+
TokenTextChunker(),
|
|
43
|
+
HuggingFaceEmbedding(model_name="intfloat/multilingual-e5-small"),
|
|
44
|
+
]
|
|
45
|
+
)
|
|
46
|
+
```
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
49
|
def __init__(
|
|
@@ -139,9 +139,9 @@ class IngestionFlow:
|
|
|
139
139
|
documents: Set of documents to be transformed.
|
|
140
140
|
|
|
141
141
|
Example:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
```python
|
|
143
|
+
ingestion_flow.run(documents: List[Document])
|
|
144
|
+
```
|
|
145
145
|
"""
|
|
146
146
|
documents_processed = []
|
|
147
147
|
input_documents = self._read_documents(documents)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
|
|
3
|
+
from beekeeper.core.guardrails.types import GuardrailResponse
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class BaseGuardrail(ABC):
|
|
7
|
+
"""Abstract base class defining the interface for LLMs."""
|
|
8
|
+
|
|
9
|
+
@classmethod
|
|
10
|
+
def class_name(cls) -> str:
|
|
11
|
+
return "BaseGuardrail"
|
|
12
|
+
|
|
13
|
+
@abstractmethod
|
|
14
|
+
def enforce(self, text: str, direction: str) -> GuardrailResponse:
|
|
15
|
+
"""Runs policies enforcement to specified guardrail."""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from typing import Any, Optional
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class GuardrailResponse(BaseModel):
|
|
7
|
+
"""Guardrail response."""
|
|
8
|
+
|
|
9
|
+
text: str = Field(..., description="Generated text response")
|
|
10
|
+
action: Optional[str] = Field(
|
|
11
|
+
default=None, description="Action taken by the guardrail"
|
|
12
|
+
)
|
|
13
|
+
raw: Optional[Any] = Field(default=None)
|
beekeeper/core/llms/__init__.py
CHANGED
beekeeper/core/llms/base.py
CHANGED
|
@@ -2,32 +2,36 @@ from abc import ABC, abstractmethod
|
|
|
2
2
|
from typing import Any, List, Optional
|
|
3
3
|
|
|
4
4
|
from beekeeper.core.llms.types import ChatMessage, ChatResponse, GenerateResponse
|
|
5
|
-
from beekeeper.core.
|
|
5
|
+
from beekeeper.core.monitors import BaseMonitor
|
|
6
6
|
from pydantic import BaseModel
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class BaseLLM(ABC, BaseModel):
|
|
10
|
-
"""
|
|
10
|
+
"""Abstract base class defining the interface for LLMs."""
|
|
11
11
|
|
|
12
12
|
model_config = {"arbitrary_types_allowed": True}
|
|
13
|
-
callback_manager: Optional[
|
|
13
|
+
callback_manager: Optional[BaseMonitor] = None
|
|
14
14
|
|
|
15
15
|
@classmethod
|
|
16
16
|
def class_name(cls) -> str:
|
|
17
17
|
return "BaseLLM"
|
|
18
18
|
|
|
19
|
-
def
|
|
20
|
-
"""
|
|
21
|
-
|
|
19
|
+
def text_completion(self, prompt: str, **kwargs: Any) -> str:
|
|
20
|
+
"""
|
|
21
|
+
Generates a chat completion for LLM. Using OpenAI's standard endpoint (/completions).
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
prompt (str): The input prompt to generate a completion for.
|
|
25
|
+
**kwargs (Any): Additional keyword arguments to customize the LLM completion request.
|
|
26
|
+
"""
|
|
27
|
+
response = self.completion(prompt=prompt, **kwargs)
|
|
28
|
+
|
|
29
|
+
return response.text
|
|
22
30
|
|
|
23
31
|
@abstractmethod
|
|
24
32
|
def completion(self, prompt: str, **kwargs: Any) -> GenerateResponse:
|
|
25
33
|
"""Generates a completion for LLM."""
|
|
26
34
|
|
|
27
|
-
@abstractmethod
|
|
28
|
-
def text_completion(self, prompt: str, **kwargs: Any) -> str:
|
|
29
|
-
"""Generates a text completion for LLM."""
|
|
30
|
-
|
|
31
35
|
@abstractmethod
|
|
32
36
|
def chat_completion(
|
|
33
37
|
self, messages: List[ChatMessage], **kwargs: Any
|
|
@@ -5,11 +5,17 @@ from logging import getLogger
|
|
|
5
5
|
from typing import Callable
|
|
6
6
|
|
|
7
7
|
from beekeeper.core.llms.types import ChatMessage
|
|
8
|
-
from beekeeper.core.
|
|
8
|
+
from beekeeper.core.monitors.types import PayloadRecord
|
|
9
|
+
from deprecated import deprecated
|
|
9
10
|
|
|
10
11
|
logger = getLogger(__name__)
|
|
11
12
|
|
|
12
13
|
|
|
14
|
+
@deprecated(
|
|
15
|
+
reason="'llm_chat_observer()' is deprecated and will be removed in a future version. Use 'llm_chat_monitor()'.",
|
|
16
|
+
version="1.0.8",
|
|
17
|
+
action="always",
|
|
18
|
+
)
|
|
13
19
|
def llm_chat_observer() -> Callable:
|
|
14
20
|
"""
|
|
15
21
|
Decorator to wrap a method with llm handler logic.
|
|
@@ -81,3 +87,76 @@ def llm_chat_observer() -> Callable:
|
|
|
81
87
|
return async_wrapper
|
|
82
88
|
|
|
83
89
|
return decorator
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def llm_chat_monitor() -> Callable:
|
|
93
|
+
"""
|
|
94
|
+
Decorator to wrap a method with llm handler logic.
|
|
95
|
+
Looks for observability instances in `self.callback_manager`.
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
def decorator(f: Callable) -> Callable:
|
|
99
|
+
def async_wrapper(self, *args, **kwargs):
|
|
100
|
+
callback_manager_fns = getattr(self, "callback_manager", None)
|
|
101
|
+
|
|
102
|
+
start_time = time.time()
|
|
103
|
+
llm_return_val = f(self, *args, **kwargs)
|
|
104
|
+
response_time = int((time.time() - start_time) * 1000)
|
|
105
|
+
|
|
106
|
+
if callback_manager_fns:
|
|
107
|
+
|
|
108
|
+
def async_callback_thread():
|
|
109
|
+
try:
|
|
110
|
+
# Extract input messages
|
|
111
|
+
if len(args) > 0 and isinstance(args[0], ChatMessage):
|
|
112
|
+
input_chat_messages = args[0]
|
|
113
|
+
elif "messages" in kwargs:
|
|
114
|
+
input_chat_messages = kwargs["messages"]
|
|
115
|
+
else:
|
|
116
|
+
raise ValueError(
|
|
117
|
+
"No messages provided in positional or keyword arguments"
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
# Get the user's latest message after each interaction to chat observability.
|
|
121
|
+
user_messages = [
|
|
122
|
+
msg for msg in input_chat_messages if msg.role == "user"
|
|
123
|
+
]
|
|
124
|
+
last_user_message = (
|
|
125
|
+
user_messages[-1].content if user_messages else None
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
# Get the system/instruct (first) message to chat observability.
|
|
129
|
+
system_messages = [
|
|
130
|
+
msg for msg in input_chat_messages if msg.role == "system"
|
|
131
|
+
]
|
|
132
|
+
system_message = (
|
|
133
|
+
system_messages[0].content if system_messages else None
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
callback = callback_manager_fns(
|
|
137
|
+
payload=PayloadRecord(
|
|
138
|
+
input_text=(system_message or "") + last_user_message,
|
|
139
|
+
generated_text=llm_return_val.message.content,
|
|
140
|
+
generated_token_count=llm_return_val.raw["usage"][
|
|
141
|
+
"completion_tokens"
|
|
142
|
+
],
|
|
143
|
+
input_token_count=llm_return_val.raw["usage"][
|
|
144
|
+
"prompt_tokens"
|
|
145
|
+
],
|
|
146
|
+
response_time=response_time,
|
|
147
|
+
)
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
if asyncio.iscoroutine(callback):
|
|
151
|
+
asyncio.run(callback)
|
|
152
|
+
|
|
153
|
+
except Exception as e:
|
|
154
|
+
logger.error(f"Observability callback error: {e}")
|
|
155
|
+
|
|
156
|
+
threading.Thread(target=async_callback_thread).start()
|
|
157
|
+
|
|
158
|
+
return llm_return_val
|
|
159
|
+
|
|
160
|
+
return async_wrapper
|
|
161
|
+
|
|
162
|
+
return decorator
|
beekeeper/core/llms/types.py
CHANGED
|
@@ -18,6 +18,10 @@ class ChatMessage(BaseModel):
|
|
|
18
18
|
role: MessageRole = Field(default=MessageRole.USER)
|
|
19
19
|
content: Optional[str] = Field(default=None)
|
|
20
20
|
|
|
21
|
+
def to_dict(self) -> dict:
|
|
22
|
+
"""Convert ChatMessage to dict."""
|
|
23
|
+
return self.model_dump(exclude_none=True)
|
|
24
|
+
|
|
21
25
|
|
|
22
26
|
class GenerateResponse(BaseModel):
|
|
23
27
|
"""Generate response."""
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
from beekeeper.core.monitors.types import PayloadRecord
|
|
5
|
+
from beekeeper.core.prompts import PromptTemplate
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class BaseMonitor(ABC):
|
|
9
|
+
"""Abstract base class defining the interface for monitors."""
|
|
10
|
+
|
|
11
|
+
@classmethod
|
|
12
|
+
def class_name(cls) -> str:
|
|
13
|
+
return "BaseMonitor"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class PromptMonitor(BaseMonitor):
|
|
17
|
+
"""Abstract base class defining the interface for prompt observability."""
|
|
18
|
+
|
|
19
|
+
def __init__(self, prompt_template: Optional[PromptTemplate] = None) -> None:
|
|
20
|
+
self.prompt_template = prompt_template
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def class_name(cls) -> str:
|
|
24
|
+
return "PromptMonitor"
|
|
25
|
+
|
|
26
|
+
@abstractmethod
|
|
27
|
+
def __call__(self, payload: PayloadRecord) -> None:
|
|
28
|
+
"""PromptMonitor."""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class TelemetryMonitor(BaseMonitor):
|
|
32
|
+
"""Abstract base class defining the interface for telemetry observability."""
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def class_name(cls) -> str:
|
|
36
|
+
return "TelemetryMonitor"
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
from beekeeper.core.observers.base import BaseObserver, ModelObserver
|
|
1
|
+
from beekeeper.core.observers.base import BaseObserver, ModelObserver, PromptObserver
|
|
2
2
|
|
|
3
|
-
__all__ =
|
|
3
|
+
__all__ = ["BaseObserver", "ModelObserver", "PromptObserver"]
|
beekeeper/core/observers/base.py
CHANGED
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
1
|
+
from beekeeper.core.monitors import BaseMonitor, PromptMonitor
|
|
2
|
+
from deprecated import deprecated
|
|
3
3
|
|
|
4
|
-
from beekeeper.core.observers.types import PayloadRecord
|
|
5
|
-
from beekeeper.core.prompts import PromptTemplate
|
|
6
4
|
|
|
5
|
+
class BaseObserver(BaseMonitor):
|
|
6
|
+
"""DEPRECATED: An interface for observability."""
|
|
7
7
|
|
|
8
|
-
class BaseObserver(ABC):
|
|
9
|
-
"""An interface for observability."""
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
@deprecated(
|
|
10
|
+
reason="'PromptObserver()' is deprecated and will be removed in a future version. Use 'PromptMonitor()' from 'beekeeper.core.monitors' instead.",
|
|
11
|
+
version="1.0.4",
|
|
12
|
+
action="always",
|
|
13
|
+
)
|
|
14
|
+
class PromptObserver(PromptMonitor):
|
|
15
|
+
"""DEPRECATED: Abstract base class defining the interface for prompt observability."""
|
|
14
16
|
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
+
@deprecated(
|
|
19
|
+
reason="'ModelObserver()' is deprecated and will be removed in a future version. Use 'PromptMonitor()' from 'beekeeper.core.monitors' instead.",
|
|
20
|
+
version="1.0.3",
|
|
21
|
+
action="always",
|
|
22
|
+
)
|
|
23
|
+
class ModelObserver(PromptMonitor):
|
|
24
|
+
"""DEPRECATED: This class is deprecated and kept only for backward compatibility."""
|
|
18
25
|
|
|
19
|
-
def __init__(self, prompt_template: Optional[PromptTemplate] = None) -> None:
|
|
20
|
-
self.prompt_template = prompt_template
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class TelemetryObserver(BaseObserver):
|
|
32
|
-
"""An interface for telemetry observability."""
|
|
33
|
-
|
|
34
|
-
@classmethod
|
|
35
|
-
def class_name(cls) -> str:
|
|
36
|
-
return "TelemetryObserver"
|
|
27
|
+
@deprecated(
|
|
28
|
+
reason="'TelemetryObserver()' is deprecated and will be removed in a future version. Use 'TelemetryMonitor()' from 'beekeeper.core.monitors' instead.",
|
|
29
|
+
version="1.0.4",
|
|
30
|
+
action="always",
|
|
31
|
+
)
|
|
32
|
+
class TelemetryObserver(BaseMonitor):
|
|
33
|
+
"""DEPRECATED: Abstract base class defining the interface for telemetry observability."""
|
beekeeper/core/prompts/base.py
CHANGED
|
@@ -6,15 +6,15 @@ class PromptTemplate(BaseModel):
|
|
|
6
6
|
"""
|
|
7
7
|
Prompt Template.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Attributes:
|
|
10
10
|
template (str): Prompt template string.
|
|
11
11
|
|
|
12
12
|
Example:
|
|
13
|
-
|
|
13
|
+
```python
|
|
14
|
+
from beekeeper.core.prompts import PromptTemplate
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
PromptTemplate("Summarize the following text: {input_text}")
|
|
16
|
+
PromptTemplate("Summarize the following text: {input_text}")
|
|
17
|
+
```
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
template: str
|
|
@@ -22,6 +22,18 @@ class PromptTemplate(BaseModel):
|
|
|
22
22
|
def __init__(self, template: str):
|
|
23
23
|
super().__init__(template=template)
|
|
24
24
|
|
|
25
|
+
@classmethod
|
|
26
|
+
def from_value(cls, value: str) -> "PromptTemplate":
|
|
27
|
+
if isinstance(value, cls):
|
|
28
|
+
return value
|
|
29
|
+
|
|
30
|
+
if isinstance(value, str):
|
|
31
|
+
return cls(value)
|
|
32
|
+
|
|
33
|
+
raise TypeError(
|
|
34
|
+
f"Invalid type for parameter 'prompt_template'. Expected str or PromptTemplate, but received {type(value).__name__}."
|
|
35
|
+
)
|
|
36
|
+
|
|
25
37
|
def format(self, **kwargs):
|
|
26
38
|
"""
|
|
27
39
|
Formats the template using the provided dynamic variables.
|
beekeeper/core/readers/base.py
CHANGED
|
@@ -6,7 +6,7 @@ from pydantic.v1 import BaseModel
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class BaseReader(ABC, BaseModel):
|
|
9
|
-
"""
|
|
9
|
+
"""Abstract base class defining the interface for document reader."""
|
|
10
10
|
|
|
11
11
|
@classmethod
|
|
12
12
|
def class_name(cls) -> str:
|
|
@@ -15,9 +15,3 @@ class BaseReader(ABC, BaseModel):
|
|
|
15
15
|
@abstractmethod
|
|
16
16
|
def load_data(self) -> List[Document]:
|
|
17
17
|
"""Loads data."""
|
|
18
|
-
|
|
19
|
-
def load(self) -> List[Document]:
|
|
20
|
-
return self.load_data()
|
|
21
|
-
|
|
22
|
-
def lazy_load(self) -> List[Document]:
|
|
23
|
-
return self.load_data()
|
|
@@ -29,18 +29,18 @@ class DirectoryReader(BaseReader):
|
|
|
29
29
|
Reads files from a directory, optionally filtering by file extension and
|
|
30
30
|
allowing recursive directory traversal.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Attributes:
|
|
33
33
|
required_exts (List[str], optional): List of file extensions to filter by.
|
|
34
34
|
Only files with these extensions will be loaded. Defaults to `None` (no filtering).
|
|
35
35
|
recursive (bool, optional): Whether to recursively search subdirectories for files.
|
|
36
36
|
Defaults to `False`.
|
|
37
37
|
|
|
38
38
|
Example:
|
|
39
|
-
|
|
39
|
+
```python
|
|
40
|
+
from beekeeper.core.readers import DirectoryReader
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
directory_reader = DirectoryReader()
|
|
42
|
+
directory_reader = DirectoryReader()
|
|
43
|
+
```
|
|
44
44
|
"""
|
|
45
45
|
|
|
46
46
|
required_exts: List[str] = [".pdf", ".docx", ".html"]
|
|
@@ -3,22 +3,39 @@ from typing import List
|
|
|
3
3
|
|
|
4
4
|
from beekeeper.core.document import Document
|
|
5
5
|
from beekeeper.core.schema import TransformerComponent
|
|
6
|
+
from deprecated import deprecated
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class BaseTextChunker(TransformerComponent, ABC):
|
|
9
|
-
"""
|
|
10
|
+
"""Abstract base class defining the interface for text chunker."""
|
|
10
11
|
|
|
11
12
|
@classmethod
|
|
12
13
|
def class_name(cls) -> str:
|
|
13
14
|
return "BaseTextChunker"
|
|
14
15
|
|
|
15
16
|
@abstractmethod
|
|
16
|
-
def
|
|
17
|
-
"""
|
|
17
|
+
def chunk_text(self, text: str) -> List[str]:
|
|
18
|
+
"""Split a single string of text into smaller chunks."""
|
|
18
19
|
|
|
19
20
|
@abstractmethod
|
|
21
|
+
def chunk_documents(self, documents: List[Document]) -> List[Document]:
|
|
22
|
+
"""Split a list of documents into smaller document chunks."""
|
|
23
|
+
|
|
24
|
+
@deprecated(
|
|
25
|
+
reason="'from_text()' is deprecated and will be removed in a future version. Use 'chunk_text' instead.",
|
|
26
|
+
version="1.0.2",
|
|
27
|
+
action="always",
|
|
28
|
+
)
|
|
29
|
+
def from_text(self, text: str) -> List[str]:
|
|
30
|
+
return self.chunk_text(text)
|
|
31
|
+
|
|
32
|
+
@deprecated(
|
|
33
|
+
reason="'from_documents()' is deprecated and will be removed in a future version. Use 'chunk_documents' instead.",
|
|
34
|
+
version="1.0.2",
|
|
35
|
+
action="always",
|
|
36
|
+
)
|
|
20
37
|
def from_documents(self, documents: List[Document]) -> List[Document]:
|
|
21
|
-
|
|
38
|
+
return self.chunk_documents(documents)
|
|
22
39
|
|
|
23
40
|
def __call__(self, documents: List[Document]) -> List[Document]:
|
|
24
|
-
return self.
|
|
41
|
+
return self.chunk_documents(documents)
|
|
@@ -14,9 +14,9 @@ class SemanticChunker(BaseTextChunker, BaseModel):
|
|
|
14
14
|
Python class designed to split text into chunks using semantic understanding.
|
|
15
15
|
|
|
16
16
|
Credit to Greg Kamradt's notebook:
|
|
17
|
-
|
|
17
|
+
[5 Levels Of Text Splitting](https://github.com/FullStackRetrieval-com/RetrievalTutorials/blob/main/tutorials/LevelsOfTextSplitting/5_Levels_Of_Text_Splitting.ipynb)
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Attributes:
|
|
20
20
|
embed_model (BaseEmbedding): Embedding model used for semantic chunking.
|
|
21
21
|
buffer_size (int, optional): Number of sentences to group together. Default is `1`.
|
|
22
22
|
breakpoint_threshold_amount (int, optional): Threshold percentage for detecting breakpoints between group of sentences.
|
|
@@ -24,13 +24,13 @@ class SemanticChunker(BaseTextChunker, BaseModel):
|
|
|
24
24
|
device (str, optional): Device to use for processing. Currently supports "cpu" and "cuda". Default is `cpu`.
|
|
25
25
|
|
|
26
26
|
Example:
|
|
27
|
-
|
|
27
|
+
```python
|
|
28
|
+
from beekeeper.core.text_chunkers import SemanticChunker
|
|
29
|
+
from beekeeper.embeddings.huggingface import HuggingFaceEmbedding
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
embedding = HuggingFaceEmbedding()
|
|
33
|
-
text_chunker = SemanticChunker(embed_model=embedding)
|
|
31
|
+
embedding = HuggingFaceEmbedding()
|
|
32
|
+
text_chunker = SemanticChunker(embed_model=embedding)
|
|
33
|
+
```
|
|
34
34
|
"""
|
|
35
35
|
|
|
36
36
|
embed_model: BaseEmbedding
|
|
@@ -99,9 +99,9 @@ class SemanticChunker(BaseTextChunker, BaseModel):
|
|
|
99
99
|
|
|
100
100
|
return [i for i, x in enumerate(distances) if x > distance_threshold]
|
|
101
101
|
|
|
102
|
-
def
|
|
102
|
+
def chunk_text(self, text: str) -> List[str]:
|
|
103
103
|
"""
|
|
104
|
-
Split text into chunks.
|
|
104
|
+
Split a single string of text into smaller chunks.
|
|
105
105
|
|
|
106
106
|
Args:
|
|
107
107
|
text (str): Input text to split.
|
|
@@ -133,9 +133,9 @@ class SemanticChunker(BaseTextChunker, BaseModel):
|
|
|
133
133
|
|
|
134
134
|
return chunks
|
|
135
135
|
|
|
136
|
-
def
|
|
136
|
+
def chunk_documents(self, documents: List[Document]) -> List[Document]:
|
|
137
137
|
"""
|
|
138
|
-
Split documents into chunks.
|
|
138
|
+
Split a list of documents into smaller document chunks.
|
|
139
139
|
|
|
140
140
|
Args:
|
|
141
141
|
documents (List[Document]): List of `Document` objects to split.
|
|
@@ -146,7 +146,7 @@ class SemanticChunker(BaseTextChunker, BaseModel):
|
|
|
146
146
|
chunks = []
|
|
147
147
|
|
|
148
148
|
for document in documents:
|
|
149
|
-
texts = self.
|
|
149
|
+
texts = self.chunk_text(document.get_content())
|
|
150
150
|
metadata = {**document.get_metadata()}
|
|
151
151
|
|
|
152
152
|
for text in texts:
|
|
@@ -18,17 +18,17 @@ class SentenceChunker(BaseTextChunker):
|
|
|
18
18
|
Designed to split input text into smaller chunks, particularly useful for processing
|
|
19
19
|
large documents or texts. Tries to keep sentences and paragraphs together.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Attributes:
|
|
22
22
|
chunk_size (int, optional): Size of each chunk. Default is `512`.
|
|
23
23
|
chunk_overlap (int, optional): Amount of overlap between chunks. Default is `256`.
|
|
24
24
|
separator (str, optional): Separator used for splitting text. Default is `" "`.
|
|
25
25
|
|
|
26
26
|
Example:
|
|
27
|
-
|
|
27
|
+
```python
|
|
28
|
+
from beekeeper.core.text_chunkers import SentenceChunker
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
text_chunker = SentenceChunker()
|
|
30
|
+
text_chunker = SentenceChunker()
|
|
31
|
+
```
|
|
32
32
|
"""
|
|
33
33
|
|
|
34
34
|
def __init__(
|
|
@@ -53,9 +53,9 @@ class SentenceChunker(BaseTextChunker):
|
|
|
53
53
|
split_by_char(),
|
|
54
54
|
]
|
|
55
55
|
|
|
56
|
-
def
|
|
56
|
+
def chunk_text(self, text: str) -> List[str]:
|
|
57
57
|
"""
|
|
58
|
-
Split text into chunks.
|
|
58
|
+
Split a single string of text into smaller chunks.
|
|
59
59
|
|
|
60
60
|
Args:
|
|
61
61
|
text (str): Input text to split.
|
|
@@ -64,19 +64,19 @@ class SentenceChunker(BaseTextChunker):
|
|
|
64
64
|
List[str]: List of text chunks.
|
|
65
65
|
|
|
66
66
|
Example:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
```python
|
|
68
|
+
chunks = text_chunker.chunk_text(
|
|
69
|
+
"Beekeeper is a data framework to load any data in one line of code and connect with AI applications."
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
72
|
"""
|
|
73
73
|
splits = self._split(text)
|
|
74
74
|
|
|
75
75
|
return merge_splits(splits, self.chunk_size, self.chunk_overlap)
|
|
76
76
|
|
|
77
|
-
def
|
|
77
|
+
def chunk_documents(self, documents: List[Document]) -> List[Document]:
|
|
78
78
|
"""
|
|
79
|
-
Split documents into chunks.
|
|
79
|
+
Split a list of documents into smaller document chunks.
|
|
80
80
|
|
|
81
81
|
Args:
|
|
82
82
|
documents (List[Document]): List of `Document` objects to split.
|
|
@@ -87,7 +87,7 @@ class SentenceChunker(BaseTextChunker):
|
|
|
87
87
|
chunks = []
|
|
88
88
|
|
|
89
89
|
for document in documents:
|
|
90
|
-
texts = self.
|
|
90
|
+
texts = self.chunk_text(document.get_content())
|
|
91
91
|
metadata = {**document.get_metadata()}
|
|
92
92
|
|
|
93
93
|
for text in texts:
|
|
@@ -16,17 +16,17 @@ class TokenTextChunker(BaseTextChunker):
|
|
|
16
16
|
This is the simplest splitting method. Designed to split input text into smaller chunks
|
|
17
17
|
by looking at word tokens.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Attributes:
|
|
20
20
|
chunk_size (int, optional): Size of each chunk. Default is `512`.
|
|
21
21
|
chunk_overlap (int, optional): Amount of overlap between chunks. Default is `256`.
|
|
22
22
|
separator (str, optional): Separators used for splitting into words. Default is `\\n\\n`.
|
|
23
23
|
|
|
24
24
|
Example:
|
|
25
|
-
|
|
25
|
+
```python
|
|
26
|
+
from beekeeper.core.text_chunkers import TokenTextChunker
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
text_chunker = TokenTextChunker()
|
|
28
|
+
text_chunker = TokenTextChunker()
|
|
29
|
+
```
|
|
30
30
|
"""
|
|
31
31
|
|
|
32
32
|
def __init__(
|
|
@@ -48,9 +48,9 @@ class TokenTextChunker(BaseTextChunker):
|
|
|
48
48
|
|
|
49
49
|
self._sub_split_fns = [split_by_char()]
|
|
50
50
|
|
|
51
|
-
def
|
|
51
|
+
def chunk_text(self, text: str) -> List[str]:
|
|
52
52
|
"""
|
|
53
|
-
Split text into chunks.
|
|
53
|
+
Split a single string of text into smaller chunks.
|
|
54
54
|
|
|
55
55
|
Args:
|
|
56
56
|
text (str): Input text to split.
|
|
@@ -59,19 +59,19 @@ class TokenTextChunker(BaseTextChunker):
|
|
|
59
59
|
List[str]: List of text chunks.
|
|
60
60
|
|
|
61
61
|
Example:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
```python
|
|
63
|
+
chunks = text_chunker.chunk_text(
|
|
64
|
+
"Beekeeper is a data framework to load any data in one line of code and connect with AI applications."
|
|
65
|
+
)
|
|
66
|
+
```
|
|
67
67
|
"""
|
|
68
68
|
splits = self._split(text)
|
|
69
69
|
|
|
70
70
|
return merge_splits(splits, self.chunk_size, self.chunk_overlap)
|
|
71
71
|
|
|
72
|
-
def
|
|
72
|
+
def chunk_documents(self, documents: List[Document]) -> List[Document]:
|
|
73
73
|
"""
|
|
74
|
-
Split documents into chunks.
|
|
74
|
+
Split a list of documents into smaller document chunks.
|
|
75
75
|
|
|
76
76
|
Args:
|
|
77
77
|
documents (List[Document]): List of `Document` objects to split.
|
|
@@ -82,7 +82,7 @@ class TokenTextChunker(BaseTextChunker):
|
|
|
82
82
|
chunks = []
|
|
83
83
|
|
|
84
84
|
for document in documents:
|
|
85
|
-
texts = self.
|
|
85
|
+
texts = self.chunk_text(document.get_content())
|
|
86
86
|
metadata = {**document.get_metadata()}
|
|
87
87
|
|
|
88
88
|
for text in texts:
|
beekeeper/core/tools/base.py
CHANGED
|
@@ -2,10 +2,11 @@ from abc import ABC, abstractmethod
|
|
|
2
2
|
from typing import List, Tuple
|
|
3
3
|
|
|
4
4
|
from beekeeper.core.document import Document
|
|
5
|
+
from deprecated import deprecated
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class BaseVectorStore(ABC):
|
|
8
|
-
"""
|
|
9
|
+
"""Abstract base class defining the interface for vector store."""
|
|
9
10
|
|
|
10
11
|
@classmethod
|
|
11
12
|
def class_name(cls) -> str:
|
|
@@ -16,8 +17,16 @@ class BaseVectorStore(ABC):
|
|
|
16
17
|
"""Add documents to vector store."""
|
|
17
18
|
|
|
18
19
|
@abstractmethod
|
|
20
|
+
def query_documents(self, query: str, top_k: int = 4) -> List[Document]:
|
|
21
|
+
"""Query for similar documents in the vector store based on the input query provided."""
|
|
22
|
+
|
|
23
|
+
@deprecated(
|
|
24
|
+
reason="'search_documents()' is deprecated and will be removed in a future version. Use 'query_documents' instead.",
|
|
25
|
+
version="1.0.2",
|
|
26
|
+
action="always",
|
|
27
|
+
)
|
|
19
28
|
def search_documents(self, query: str, top_k: int = 4) -> List[Document]:
|
|
20
|
-
|
|
29
|
+
return self.query_documents(query, top_k)
|
|
21
30
|
|
|
22
31
|
@abstractmethod
|
|
23
32
|
def delete_documents(self, ids: List[str]) -> None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: beekeeper-core
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.10
|
|
4
4
|
Summary: Load any data in one line of code and connect with AI applications
|
|
5
5
|
Project-URL: Repository, https://github.com/beekeeper-ai/beekeeper
|
|
6
6
|
Author-email: Leonardo Furnielis <leonardofurnielis@outlook.com>
|
|
@@ -9,14 +9,14 @@ Keywords: AI,LLM,QA,RAG,data,observability,retrieval,semantic-search
|
|
|
9
9
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
10
10
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
11
11
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
12
|
-
Requires-Python: <
|
|
13
|
-
Requires-Dist: deprecated<2.0.0,>=1.
|
|
14
|
-
Requires-Dist: nltk<4.0.0,>=3.9.
|
|
12
|
+
Requires-Python: <3.14,>=3.11
|
|
13
|
+
Requires-Dist: deprecated<2.0.0,>=1.3.1
|
|
14
|
+
Requires-Dist: nltk<4.0.0,>=3.9.2
|
|
15
15
|
Requires-Dist: numpy<1.27.0,>=1.26.4
|
|
16
|
-
Requires-Dist: pydantic<3.0.0,>=2.
|
|
17
|
-
Requires-Dist: tiktoken<0.
|
|
16
|
+
Requires-Dist: pydantic<3.0.0,>=2.12.5
|
|
17
|
+
Requires-Dist: tiktoken<0.13.0,>=0.12.0
|
|
18
18
|
Provides-Extra: dev
|
|
19
|
-
Requires-Dist: ruff>=0.
|
|
19
|
+
Requires-Dist: ruff>=0.14.9; extra == 'dev'
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
|
|
22
22
|
# Beekeeper Core
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
beekeeper/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
beekeeper/core/schema.py,sha256=8OZkRVDry6nglof38w4AvWaRDpf0zOUtqGyfWBhj8lk,267
|
|
3
|
+
beekeeper/core/document/__init__.py,sha256=nCN0CNee1v-28W5a26Ca6iAVefcr_KAieAH6QfN4eyw,144
|
|
4
|
+
beekeeper/core/document/base.py,sha256=NBlyj8C0uvvsiElU1wFcXU27LOb3VP0U11nMgOR6cgY,2635
|
|
5
|
+
beekeeper/core/embeddings/__init__.py,sha256=4AzGUtoL7wComtQ-bEVwzoMQgahBhpxcF_4M5rQ0ClQ,159
|
|
6
|
+
beekeeper/core/embeddings/base.py,sha256=3r_gr9ceezuAXexkeS5Bq23778BeF7h--IDEvL5pLjE,3464
|
|
7
|
+
beekeeper/core/evaluation/__init__.py,sha256=FyZGpbTXcIM3BynssiS6wUm2KZkMnLVmKF50D7iqkXM,135
|
|
8
|
+
beekeeper/core/evaluation/context_similarity.py,sha256=kT1J3HUgF51HHQA5Sew9ahbSV_jhgbCBMRYqPLKlljQ,2690
|
|
9
|
+
beekeeper/core/flows/__init__.py,sha256=v6VLJ309l5bHYcG1JLUu6_kRoOwIZazonH4-n_UQzYQ,91
|
|
10
|
+
beekeeper/core/flows/ingestion_flow.py,sha256=lfZM6lHF9rBTviimSlptHm_1htaA5qLLhE-Sm_7fwGY,6110
|
|
11
|
+
beekeeper/core/guardrails/__init__.py,sha256=onznwYWAyOaxOVeYZle7oDtj3QJODQvJHcf5td_laZg,169
|
|
12
|
+
beekeeper/core/guardrails/base.py,sha256=T-Ywr80iTL0EFYarCymFEEI3QkMsrw27JVh_0407sEU,427
|
|
13
|
+
beekeeper/core/guardrails/types.py,sha256=7sgw1S5BZY0OqO-n04pHXPU7sG-NEZJlQyIeb2Fsq9Q,359
|
|
14
|
+
beekeeper/core/llms/__init__.py,sha256=PN-5Y_Km_l2vO8v9d7iJ6_5xPCZJBh8UzwqRvQZlmTo,250
|
|
15
|
+
beekeeper/core/llms/base.py,sha256=jFU1om9Qk6KTIsZXeke7lMp--x009G6-fnM1615l2BQ,1292
|
|
16
|
+
beekeeper/core/llms/decorators.py,sha256=wRYXlKD5Cc8k1qPGYEEv-RSJdoHj-MQqKuAAQzkN9Fc,6534
|
|
17
|
+
beekeeper/core/llms/types.py,sha256=lWswZ_bJkPmoTeheWxB1-OnABTYIVAcASkZCwjaTLzE,847
|
|
18
|
+
beekeeper/core/monitors/__init__.py,sha256=TvoiIUJtWRO_4zqCICsFaGl_v4Tpvft1M542Bi13pOI,112
|
|
19
|
+
beekeeper/core/monitors/base.py,sha256=3ooSfgVpWoRLe2TqizHMRK_bI5C-sla57aYJ47FmIXM,980
|
|
20
|
+
beekeeper/core/monitors/types.py,sha256=s-4tB8OdeaCUIRvi6FLuib2u4Yl9evqQdCundNREXQY,217
|
|
21
|
+
beekeeper/core/observers/__init__.py,sha256=Z5sDAajai4QLdGIrjq-vr5eJEBhriMMCw5u46j6xHvA,149
|
|
22
|
+
beekeeper/core/observers/base.py,sha256=y1SE_0WQusKhVomFuZCkk42Jb7r93ZS6r_j8vs_Y_r4,1203
|
|
23
|
+
beekeeper/core/observers/types.py,sha256=s-4tB8OdeaCUIRvi6FLuib2u4Yl9evqQdCundNREXQY,217
|
|
24
|
+
beekeeper/core/prompts/__init__.py,sha256=kFp2N5giNEMA4hc3eZqstqaZu0c0BRAnP0NuF5aUaqI,85
|
|
25
|
+
beekeeper/core/prompts/base.py,sha256=Edh77DuYm8lDhJvHazC5hgaiQEit-R4M-TWLX8-gIU0,1106
|
|
26
|
+
beekeeper/core/prompts/utils.py,sha256=Cqpefzzxd6DxPbOKVyUCsIs-ibBGKhYU6ppYqhPT9vM,1378
|
|
27
|
+
beekeeper/core/readers/__init__.py,sha256=vPCmWmK92LYL-R0LFcPqjOKFHqxW0xUP5r6M9GNxoqY,157
|
|
28
|
+
beekeeper/core/readers/base.py,sha256=46VRNkCmKP2RWJT1-kRTSHG9SjY1xbhKUy1a7-OrgPg,418
|
|
29
|
+
beekeeper/core/readers/directory.py,sha256=IjFuqrBXonr5MhsRLVdTIi4U5I1xd1ZlD2Xh_F8F1h8,2873
|
|
30
|
+
beekeeper/core/text_chunkers/__init__.py,sha256=RIqqTGgn2BhbIgDGmTETw65DAQeI5Zls_A5H29jZVgA,366
|
|
31
|
+
beekeeper/core/text_chunkers/base.py,sha256=RB7Qb_tlsCx11Q5Dl9IQ0wUpMuxMq4DGEwpFnT7ZOQw,1413
|
|
32
|
+
beekeeper/core/text_chunkers/semantic.py,sha256=Q2HXgveT0EC8GALHwOls8az2ctioKnRbrfYMhEC1JN8,5903
|
|
33
|
+
beekeeper/core/text_chunkers/sentence.py,sha256=HOCPAGRCiYnZ5zt9LR-bhsvwBHJkAkKhs0e8V7Jjkhk,4134
|
|
34
|
+
beekeeper/core/text_chunkers/token.py,sha256=xCbCpS6wr0Q1OOygsxfQkJ1dV09x7SXwwWbYcRor-rs,3901
|
|
35
|
+
beekeeper/core/text_chunkers/utils.py,sha256=ImYUlU3dC44MqB1_thal6skynMhR6RF-JuPEDRREBUg,4586
|
|
36
|
+
beekeeper/core/tools/__init__.py,sha256=M0WCBWkKrkVcezlMtZqYtHiuWdCiJFk681JakWAFlVA,78
|
|
37
|
+
beekeeper/core/tools/base.py,sha256=A6TXn7g3DAZMREYAobfVlyOBuJn_8mIeCByc5412L9Y,948
|
|
38
|
+
beekeeper/core/utils/pairwise.py,sha256=cpi8GItPFSYP4sjB5zgTFHi6JfBVWsMnNu8koA9VYQU,536
|
|
39
|
+
beekeeper/core/vector_stores/__init__.py,sha256=R5SRG3YpOZqRwIfBLB8KVV6FALWqhIzIhCjRGj-bwPc,93
|
|
40
|
+
beekeeper/core/vector_stores/base.py,sha256=YFW1ioZbFEcJovAh0ZCpHnj0eiXtZvqy_pj2lxPS92k,1652
|
|
41
|
+
beekeeper_core-1.0.10.dist-info/METADATA,sha256=6yt3XFndeAKudQ_UsnQFZ_B_MeibOrrrIk_yt_zRV_0,1331
|
|
42
|
+
beekeeper_core-1.0.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
43
|
+
beekeeper_core-1.0.10.dist-info/RECORD,,
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
beekeeper/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
beekeeper/core/schema.py,sha256=8OZkRVDry6nglof38w4AvWaRDpf0zOUtqGyfWBhj8lk,267
|
|
3
|
-
beekeeper/core/document/__init__.py,sha256=nCN0CNee1v-28W5a26Ca6iAVefcr_KAieAH6QfN4eyw,144
|
|
4
|
-
beekeeper/core/document/base.py,sha256=S6pmOLE16ddO4Mg4EE4g1kz7fHMx4yPanhqeJlZZSdE,2619
|
|
5
|
-
beekeeper/core/embeddings/__init__.py,sha256=4AzGUtoL7wComtQ-bEVwzoMQgahBhpxcF_4M5rQ0ClQ,159
|
|
6
|
-
beekeeper/core/embeddings/base.py,sha256=_vhdfNLdJjYotLYNdIvbkax4XDSNyspOsE66Wyllbys,1829
|
|
7
|
-
beekeeper/core/evaluation/__init__.py,sha256=FyZGpbTXcIM3BynssiS6wUm2KZkMnLVmKF50D7iqkXM,135
|
|
8
|
-
beekeeper/core/evaluation/context_similarity.py,sha256=kDhVLofNjQ4QrRxT9yGPU-x0OAclAbA-qhnA8yFt078,2728
|
|
9
|
-
beekeeper/core/flows/__init__.py,sha256=v6VLJ309l5bHYcG1JLUu6_kRoOwIZazonH4-n_UQzYQ,91
|
|
10
|
-
beekeeper/core/flows/ingestion_flow.py,sha256=q3D-PC-Jlzz26CzU5HRsxMNRnRJyWU5i3Aj-n17BfEA,6144
|
|
11
|
-
beekeeper/core/llms/__init__.py,sha256=8fPQqw9vYdQJtQlYyFF9YskFSQBHBstmqurPOyEb0rA,259
|
|
12
|
-
beekeeper/core/llms/base.py,sha256=SiVt7JkjDdz6Oss7wdvn0XKWhR-Dhtel423sdsWJ9Bg,1144
|
|
13
|
-
beekeeper/core/llms/decorators.py,sha256=lPfrQPFiCLAp468mVsiX6DIxSIvmrHjz3urnV9-q54U,3284
|
|
14
|
-
beekeeper/core/llms/types.py,sha256=CqLsB78y6-y8actABp87nHQh3AhHcE5i4IjeUxaXyA4,722
|
|
15
|
-
beekeeper/core/observers/__init__.py,sha256=O2TNVupW0UKBDnhPAoz1YB6uQXws7YdDPi-GOGw2il0,118
|
|
16
|
-
beekeeper/core/observers/base.py,sha256=aCqjWtca-u3T-Ug6XxML8Ed-AfVxmVJFzE7OJjd64QI,901
|
|
17
|
-
beekeeper/core/observers/types.py,sha256=s-4tB8OdeaCUIRvi6FLuib2u4Yl9evqQdCundNREXQY,217
|
|
18
|
-
beekeeper/core/prompts/__init__.py,sha256=MKVxQKhA72Pm4oaVMDIRYE3fB70A2Jd2Re0UZSmFIoE,88
|
|
19
|
-
beekeeper/core/prompts/base.py,sha256=m1CIPWleadHTxCpvNWO9JfYcIDoBebyv8oYSQ7JAa6s,743
|
|
20
|
-
beekeeper/core/prompts/utils.py,sha256=Cqpefzzxd6DxPbOKVyUCsIs-ibBGKhYU6ppYqhPT9vM,1378
|
|
21
|
-
beekeeper/core/readers/__init__.py,sha256=vPCmWmK92LYL-R0LFcPqjOKFHqxW0xUP5r6M9GNxoqY,157
|
|
22
|
-
beekeeper/core/readers/base.py,sha256=WP_g-kw2MQmjcNaYa_BiuSsUnqoQzJZrze3phcZ2EWk,535
|
|
23
|
-
beekeeper/core/readers/directory.py,sha256=Pgj-rb0XaSyqF2mp3S4cEqp3410xeSSPA49IDLrgWuE,2877
|
|
24
|
-
beekeeper/core/text_chunkers/__init__.py,sha256=RIqqTGgn2BhbIgDGmTETw65DAQeI5Zls_A5H29jZVgA,366
|
|
25
|
-
beekeeper/core/text_chunkers/base.py,sha256=RAtyMbW4huvphgF1WYO2ixxF8jpmbxQC6O-fyfuKihY,684
|
|
26
|
-
beekeeper/core/text_chunkers/semantic.py,sha256=kFrELS_tCXMIovxmSbN_07TQa-hS-CbFI7GKnxyUuOM,5861
|
|
27
|
-
beekeeper/core/text_chunkers/sentence.py,sha256=h1LYqtbhfIKdeFRU1dDEsqFKT-IpCKP01eFGWl0wlys,4090
|
|
28
|
-
beekeeper/core/text_chunkers/token.py,sha256=7LBJMppJkn5GISGjhwppdD5EheSrZZZVY_aoWR208sg,3857
|
|
29
|
-
beekeeper/core/text_chunkers/utils.py,sha256=ImYUlU3dC44MqB1_thal6skynMhR6RF-JuPEDRREBUg,4586
|
|
30
|
-
beekeeper/core/tools/__init__.py,sha256=M0WCBWkKrkVcezlMtZqYtHiuWdCiJFk681JakWAFlVA,78
|
|
31
|
-
beekeeper/core/tools/base.py,sha256=9O38vPqPSp8f656bcxHCGrWuYZWk6ghsVwjg36IDNF8,941
|
|
32
|
-
beekeeper/core/utils/pairwise.py,sha256=cpi8GItPFSYP4sjB5zgTFHi6JfBVWsMnNu8koA9VYQU,536
|
|
33
|
-
beekeeper/core/vector_stores/__init__.py,sha256=R5SRG3YpOZqRwIfBLB8KVV6FALWqhIzIhCjRGj-bwPc,93
|
|
34
|
-
beekeeper/core/vector_stores/base.py,sha256=_nx_F_ySthostd4gVzRt6gwljZQfMLJLytZdRHIe0wU,1263
|
|
35
|
-
beekeeper_core-1.0.1.dist-info/METADATA,sha256=HTpqTUMzHZ8MkscPSS3S3FuJhrOv7E1LfZc3TC039hw,1330
|
|
36
|
-
beekeeper_core-1.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
37
|
-
beekeeper_core-1.0.1.dist-info/RECORD,,
|
|
File without changes
|