beekeeper-core 1.0.3__tar.gz → 1.0.6__tar.gz
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-1.0.3 → beekeeper_core-1.0.6}/.gitignore +1 -1
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/PKG-INFO +1 -1
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/embeddings/base.py +6 -1
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/llms/__init__.py +1 -3
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/llms/base.py +3 -3
- beekeeper_core-1.0.6/beekeeper/core/monitors/__init__.py +3 -0
- beekeeper_core-1.0.6/beekeeper/core/monitors/base.py +36 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/observers/__init__.py +1 -1
- beekeeper_core-1.0.6/beekeeper/core/observers/base.py +33 -0
- beekeeper_core-1.0.6/beekeeper/core/observers/types.py +11 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/prompts/__init__.py +1 -1
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/prompts/base.py +12 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/pyproject.toml +1 -1
- beekeeper_core-1.0.3/beekeeper/core/observers/base.py +0 -46
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/README.md +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/__init__.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/document/__init__.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/document/base.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/embeddings/__init__.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/evaluation/__init__.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/evaluation/context_similarity.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/flows/__init__.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/flows/ingestion_flow.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/llms/decorators.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/llms/types.py +0 -0
- {beekeeper_core-1.0.3/beekeeper/core/observers → beekeeper_core-1.0.6/beekeeper/core/monitors}/types.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/prompts/utils.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/readers/__init__.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/readers/base.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/readers/directory.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/schema.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/text_chunkers/__init__.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/text_chunkers/base.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/text_chunkers/semantic.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/text_chunkers/sentence.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/text_chunkers/token.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/text_chunkers/utils.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/tools/__init__.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/tools/base.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/utils/pairwise.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/vector_stores/__init__.py +0 -0
- {beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/vector_stores/base.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: beekeeper-core
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.6
|
|
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>
|
|
@@ -49,7 +49,12 @@ class BaseEmbedding(TransformerComponent, ABC):
|
|
|
49
49
|
"""Embed one or more text strings."""
|
|
50
50
|
|
|
51
51
|
def embed_documents(self, documents: List[Document]) -> List[Document]:
|
|
52
|
-
"""
|
|
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
|
+
"""
|
|
53
58
|
texts = [document.get_content() for document in documents]
|
|
54
59
|
embeddings = self.embed_text(texts)
|
|
55
60
|
|
|
@@ -2,7 +2,7 @@ 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
|
|
|
@@ -10,14 +10,14 @@ 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
19
|
def convert_chat_messages(self, messages: List[ChatMessage]) -> List[dict]:
|
|
20
|
-
"""Convert
|
|
20
|
+
"""Convert ChatMessage to LLM message dict format."""
|
|
21
21
|
return [message.model_dump() for message in messages]
|
|
22
22
|
|
|
23
23
|
@abstractmethod
|
|
@@ -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"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from beekeeper.core.monitors import BaseMonitor, PromptMonitor
|
|
2
|
+
from deprecated import deprecated
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class BaseObserver(BaseMonitor):
|
|
6
|
+
"""DEPRECATED: An interface for observability."""
|
|
7
|
+
|
|
8
|
+
|
|
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."""
|
|
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."""
|
|
25
|
+
|
|
26
|
+
|
|
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."""
|
|
@@ -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.
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "beekeeper-core"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.6"
|
|
8
8
|
description = "Load any data in one line of code and connect with AI applications"
|
|
9
9
|
authors = [{ name = "Leonardo Furnielis", email = "leonardofurnielis@outlook.com" }]
|
|
10
10
|
license = { text = "Apache-2.0" }
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import Optional
|
|
3
|
-
|
|
4
|
-
from beekeeper.core.observers.types import PayloadRecord
|
|
5
|
-
from beekeeper.core.prompts import PromptTemplate
|
|
6
|
-
from deprecated import deprecated
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class BaseObserver(ABC):
|
|
10
|
-
"""An interface for observability."""
|
|
11
|
-
|
|
12
|
-
@classmethod
|
|
13
|
-
def class_name(cls) -> str:
|
|
14
|
-
return "BaseObserver"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class PromptObserver(BaseObserver):
|
|
18
|
-
"""Abstract base class defining the interface for prompt observability."""
|
|
19
|
-
|
|
20
|
-
def __init__(self, prompt_template: Optional[PromptTemplate] = None) -> None:
|
|
21
|
-
self.prompt_template = prompt_template
|
|
22
|
-
|
|
23
|
-
@classmethod
|
|
24
|
-
def class_name(cls) -> str:
|
|
25
|
-
return "PromptObserver"
|
|
26
|
-
|
|
27
|
-
@abstractmethod
|
|
28
|
-
def __call__(self, payload: PayloadRecord) -> None:
|
|
29
|
-
"""PromptObserver."""
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@deprecated(
|
|
33
|
-
reason="'ModelObserver()' is deprecated and will be removed in a future version. Use 'PromptObserver()' instead.",
|
|
34
|
-
version="1.0.3",
|
|
35
|
-
action="always",
|
|
36
|
-
)
|
|
37
|
-
class ModelObserver(PromptObserver):
|
|
38
|
-
"""DEPRECATED: This class is deprecated and kept only for backward compatibility."""
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class TelemetryObserver(BaseObserver):
|
|
42
|
-
"""Abstract base class defining the interface for telemetry observability."""
|
|
43
|
-
|
|
44
|
-
@classmethod
|
|
45
|
-
def class_name(cls) -> str:
|
|
46
|
-
return "TelemetryObserver"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{beekeeper_core-1.0.3 → beekeeper_core-1.0.6}/beekeeper/core/evaluation/context_similarity.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|