proscenium 0.0.9__py3-none-any.whl → 0.0.11__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.
- proscenium/bin/bot.py +0 -0
- proscenium/patterns/rag.py +37 -3
- {proscenium-0.0.9.dist-info → proscenium-0.0.11.dist-info}/METADATA +21 -30
- {proscenium-0.0.9.dist-info → proscenium-0.0.11.dist-info}/RECORD +10 -9
- {proscenium-0.0.9.dist-info → proscenium-0.0.11.dist-info}/WHEEL +2 -1
- proscenium-0.0.11.dist-info/entry_points.txt +2 -0
- proscenium-0.0.11.dist-info/top_level.txt +1 -0
- proscenium-0.0.9.dist-info/entry_points.txt +0 -3
- {proscenium-0.0.9.dist-info → proscenium-0.0.11.dist-info/licenses}/LICENSE +0 -0
proscenium/bin/bot.py
CHANGED
File without changes
|
proscenium/patterns/rag.py
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
from typing import List, Dict
|
2
|
+
|
2
3
|
import logging
|
4
|
+
from rich.table import Table
|
3
5
|
|
4
6
|
from pymilvus import MilvusClient
|
5
7
|
from pymilvus import model
|
6
8
|
|
7
|
-
from lapidarist.verbs.display.milvus import chunk_hits_table
|
8
|
-
from lapidarist.verbs.vector_database import closest_chunks
|
9
|
-
|
10
9
|
from proscenium.verbs.complete import complete_simple
|
11
10
|
|
12
11
|
log = logging.getLogger(__name__)
|
@@ -38,6 +37,41 @@ def rag_prompt(chunks: List[Dict], query: str) -> str:
|
|
38
37
|
return rag_prompt_template.format(context=context, query=query)
|
39
38
|
|
40
39
|
|
40
|
+
def closest_chunks(
|
41
|
+
client: MilvusClient,
|
42
|
+
embedding_fn: model.dense.SentenceTransformerEmbeddingFunction,
|
43
|
+
query: str,
|
44
|
+
collection_name: str,
|
45
|
+
k: int = 4,
|
46
|
+
) -> List[Dict]:
|
47
|
+
|
48
|
+
client.load_collection(collection_name)
|
49
|
+
|
50
|
+
result = client.search(
|
51
|
+
collection_name=collection_name,
|
52
|
+
data=embedding_fn.encode_queries([query]),
|
53
|
+
anns_field="vector",
|
54
|
+
search_params={"metric": "IP", "offset": 0},
|
55
|
+
output_fields=["text"],
|
56
|
+
limit=k,
|
57
|
+
)
|
58
|
+
|
59
|
+
hits = result[0]
|
60
|
+
|
61
|
+
return hits
|
62
|
+
|
63
|
+
|
64
|
+
def chunk_hits_table(chunks: list[dict]) -> Table:
|
65
|
+
|
66
|
+
table = Table(title="Closest Chunks", show_lines=True)
|
67
|
+
table.add_column("id", justify="right")
|
68
|
+
table.add_column("distance")
|
69
|
+
table.add_column("entity.text", justify="right")
|
70
|
+
for chunk in chunks:
|
71
|
+
table.add_row(str(chunk["id"]), str(chunk["distance"]), chunk["entity"]["text"])
|
72
|
+
return table
|
73
|
+
|
74
|
+
|
41
75
|
def answer_question(
|
42
76
|
query: str,
|
43
77
|
model_id: str,
|
@@ -1,35 +1,27 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: proscenium
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.11
|
4
4
|
Summary: Frame AI Agents
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
Requires-Python: >=3.11,<4.0
|
9
|
-
Classifier: License :: Other/Proprietary License
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
11
|
-
Classifier: Programming Language :: Python :: 3.11
|
12
|
-
Classifier: Programming Language :: Python :: 3.12
|
13
|
-
Classifier: Programming Language :: Python :: 3.13
|
14
|
-
Provides-Extra: testing
|
15
|
-
Requires-Dist: aisuite[openai,anthropic] (>=0.1.10,<0.2.0)
|
16
|
-
Requires-Dist: datasets (>=3.3.2,<4.0.0)
|
17
|
-
Requires-Dist: docstring_parser (>=0.16,<0.17)
|
18
|
-
Requires-Dist: gofannon (>=0.25.13,<0.26.0)
|
19
|
-
Requires-Dist: langchain-community (>=0.3.18,<0.4.0)
|
20
|
-
Requires-Dist: langchain-huggingface (>=0.1.2,<0.2.0)
|
21
|
-
Requires-Dist: lapidarist (>=0.0.1,<0.0.2)
|
22
|
-
Requires-Dist: neo4j (>=5.28.1,<6.0.0)
|
23
|
-
Requires-Dist: pydantic (>=2.10.6,<3.0.0)
|
24
|
-
Requires-Dist: pymilvus (>=2.5.4,<3.0.0)
|
25
|
-
Requires-Dist: pymilvus_model (>=0.3.1,<0.4.0)
|
26
|
-
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
27
|
-
Requires-Dist: rich (>=13.9.4,<14.0.0)
|
28
|
-
Requires-Dist: slack_sdk (>=3.35.0,<4.0.0)
|
29
|
-
Requires-Dist: stringcase (>=1.2.0,<2.0.0)
|
30
|
-
Requires-Dist: tiktoken (>=0.9.0,<0.10.0)
|
31
|
-
Requires-Dist: typer (>=0.15.2,<0.16.0)
|
5
|
+
Author-email: Adam Pingel <oss@pingel.org>
|
6
|
+
License-Expression: Apache-2.0
|
7
|
+
Requires-Python: >=3.11
|
32
8
|
Description-Content-Type: text/markdown
|
9
|
+
License-File: LICENSE
|
10
|
+
Requires-Dist: aisuite>=0.1.10
|
11
|
+
Requires-Dist: docstring_parser>=0.16
|
12
|
+
Requires-Dist: pydantic>=2.10.6
|
13
|
+
Requires-Dist: rich>=13.9.4
|
14
|
+
Requires-Dist: slack_sdk>=3.35.0
|
15
|
+
Provides-Extra: test
|
16
|
+
Requires-Dist: pytest<9,>=8; extra == "test"
|
17
|
+
Requires-Dist: pytest-cov<6,>=5; extra == "test"
|
18
|
+
Requires-Dist: typer>=0.15.2; extra == "test"
|
19
|
+
Requires-Dist: click>=8.2.0; extra == "test"
|
20
|
+
Requires-Dist: pytest>=8.3.5; extra == "test"
|
21
|
+
Requires-Dist: neo4j>=5.28.1; extra == "test"
|
22
|
+
Requires-Dist: gofannon>=0.25.13; extra == "test"
|
23
|
+
Requires-Dist: lapidarist>=0.0.2; extra == "test"
|
24
|
+
Dynamic: license-file
|
33
25
|
|
34
26
|
# Proscenium
|
35
27
|
|
@@ -46,4 +38,3 @@ Currently, proscenium development prioritizes support for domains where the crea
|
|
46
38
|
See the [website](https://the-ai-alliance.github.io/proscenium/) for quickstart info, goals, and other links.
|
47
39
|
|
48
40
|
To find the Proscenium community, see the [discussions](https://github.com/The-AI-Alliance/proscenium/discussions)
|
49
|
-
|
@@ -7,19 +7,20 @@ proscenium/interfaces/__init__.py,sha256=nDWNd6_TSf4vDQuHVBoAf4QfZCB3ZUFQ0M7Xvif
|
|
7
7
|
proscenium/interfaces/slack.py,sha256=wjkdhqAHgISxdNG5Pwo-8_QIyQf76X7b-0WwZfNabI8,10600
|
8
8
|
proscenium/patterns/__init__.py,sha256=nDWNd6_TSf4vDQuHVBoAf4QfZCB3ZUFQ0M7XvifNJ-g,78
|
9
9
|
proscenium/patterns/graph_rag.py,sha256=1HH1xdlAA6ypvYdP4dWFm-KXrGPUmm0T4qIdAU8mgvE,1763
|
10
|
-
proscenium/patterns/rag.py,sha256=
|
10
|
+
proscenium/patterns/rag.py,sha256=iNPL7i8zfhEGIZAI7FjAs5yKgN1iV_E-PcJiQFrm7lE,2310
|
11
11
|
proscenium/patterns/tools.py,sha256=f2CD6f7CYiSs0Tm1Ff1sOL5Ti6DqJ5HQvMI7NmIgqNs,1740
|
12
12
|
proscenium/util/__init__.py,sha256=FC1hjA37VvmVpF9-OlYNp9TjArH6etr6KiAvF9t_6lI,679
|
13
13
|
proscenium/verbs/__init__.py,sha256=nDWNd6_TSf4vDQuHVBoAf4QfZCB3ZUFQ0M7XvifNJ-g,78
|
14
14
|
proscenium/verbs/complete.py,sha256=Y1T49OfAV7K8p0DMzE4aVqtkgVfjUqb6IeOazzdYGow,5071
|
15
|
-
proscenium/verbs/display/__init__.py,sha256=GXuvaMld8tzfJGngHdwVT-YLnuRmW2G0pMdti9Vj53s,238
|
16
|
-
proscenium/verbs/display/chat.py,sha256=2THBUdhG3cIIVZOnJ_AMYL4nWXKFG2cuSkX6wkm48yQ,1148
|
17
|
-
proscenium/verbs/display/tools.py,sha256=eR5g-r7MGKFZY0qg-ndkW3p0mfbupV0UaAUFqJPfnNM,1491
|
18
15
|
proscenium/verbs/display.py,sha256=hHFmktyJtjYLi4I1-8HUfmsuoMTIxc6JFfczASBsCbI,260
|
19
16
|
proscenium/verbs/invoke.py,sha256=-Bk7Pp0EEwRTS0MJUlViZeUNo8wxnDKJj5q78KU4CdM,339
|
20
17
|
proscenium/verbs/remember.py,sha256=Hh9BDRAYf7MGeMD4MzU73p6Q28KrSiLWPx4GjTW1amQ,296
|
21
|
-
proscenium
|
22
|
-
proscenium
|
23
|
-
proscenium
|
24
|
-
proscenium-0.0.
|
25
|
-
proscenium-0.0.
|
18
|
+
proscenium/verbs/display/__init__.py,sha256=GXuvaMld8tzfJGngHdwVT-YLnuRmW2G0pMdti9Vj53s,238
|
19
|
+
proscenium/verbs/display/chat.py,sha256=2THBUdhG3cIIVZOnJ_AMYL4nWXKFG2cuSkX6wkm48yQ,1148
|
20
|
+
proscenium/verbs/display/tools.py,sha256=eR5g-r7MGKFZY0qg-ndkW3p0mfbupV0UaAUFqJPfnNM,1491
|
21
|
+
proscenium-0.0.11.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
22
|
+
proscenium-0.0.11.dist-info/METADATA,sha256=wVnK3-0GveteN4CZ4JbmD2ytWZoBu7h8JoZ28ZUdl4w,2102
|
23
|
+
proscenium-0.0.11.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
24
|
+
proscenium-0.0.11.dist-info/entry_points.txt,sha256=bbrDWv4WKIx9UROGXcyH0eo40F8SNpDQKvXxoE8BTHI,58
|
25
|
+
proscenium-0.0.11.dist-info/top_level.txt,sha256=aiTgQy73e21wnSSxM5iICXmXT3zldN8cFKeXpvJ5Xx4,11
|
26
|
+
proscenium-0.0.11.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
proscenium
|
File without changes
|