langroid 0.28.6__py3-none-any.whl → 0.28.7__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.
- langroid/agent/team.py +41 -0
- langroid/vector_store/base.py +5 -1
- {langroid-0.28.6.dist-info → langroid-0.28.7.dist-info}/METADATA +1 -1
- {langroid-0.28.6.dist-info → langroid-0.28.7.dist-info}/RECORD +7 -6
- pyproject.toml +1 -1
- {langroid-0.28.6.dist-info → langroid-0.28.7.dist-info}/LICENSE +0 -0
- {langroid-0.28.6.dist-info → langroid-0.28.7.dist-info}/WHEEL +0 -0
langroid/agent/team.py
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
|
3
|
+
class TeamComponent(ABC):
|
4
|
+
@abstractmethod
|
5
|
+
def run(self, msg):
|
6
|
+
pass
|
7
|
+
|
8
|
+
class Team(TeamComponent):
|
9
|
+
def __init__(self):
|
10
|
+
self.components = []
|
11
|
+
self.input_port = []
|
12
|
+
self.followers = []
|
13
|
+
self.scheduler = None
|
14
|
+
|
15
|
+
def follow(self, team):
|
16
|
+
team.followers.append(self)
|
17
|
+
|
18
|
+
def add_component(self, component):
|
19
|
+
self.components.append(component)
|
20
|
+
|
21
|
+
def notify_followers(self, result):
|
22
|
+
for follower in self.followers:
|
23
|
+
follower.input_port.append(result)
|
24
|
+
|
25
|
+
def run(self, msg):
|
26
|
+
if self.scheduler:
|
27
|
+
return self.scheduler.run(self.components, msg)
|
28
|
+
# Default sequential execution
|
29
|
+
result = ""
|
30
|
+
for component in self.components:
|
31
|
+
result += component.run(msg)
|
32
|
+
self.notify_followers(result)
|
33
|
+
return result
|
34
|
+
|
35
|
+
class Agent(TeamComponent):
|
36
|
+
def __init__(self, name):
|
37
|
+
self.name = name
|
38
|
+
|
39
|
+
def run(self, msg):
|
40
|
+
result = f"Agent {self.name} processed: {msg}"
|
41
|
+
return result
|
langroid/vector_store/base.py
CHANGED
@@ -30,6 +30,7 @@ class VectorStoreConfig(BaseSettings):
|
|
30
30
|
embedding: EmbeddingModelsConfig = OpenAIEmbeddingsConfig(
|
31
31
|
model_type="openai",
|
32
32
|
)
|
33
|
+
embedding_model: Optional[EmbeddingModel] = None
|
33
34
|
timeout: int = 60
|
34
35
|
host: str = "127.0.0.1"
|
35
36
|
port: int = 6333
|
@@ -46,7 +47,10 @@ class VectorStore(ABC):
|
|
46
47
|
|
47
48
|
def __init__(self, config: VectorStoreConfig):
|
48
49
|
self.config = config
|
49
|
-
|
50
|
+
if config.embedding_model is None:
|
51
|
+
self.embedding_model = EmbeddingModel.create(config.embedding)
|
52
|
+
else:
|
53
|
+
self.embedding_model = config.embedding_model
|
50
54
|
|
51
55
|
@staticmethod
|
52
56
|
def create(config: VectorStoreConfig) -> Optional["VectorStore"]:
|
@@ -39,6 +39,7 @@ langroid/agent/special/sql/utils/tools.py,sha256=ovCePzq5cmbqw0vsVPBzxdZpUcSUIfT
|
|
39
39
|
langroid/agent/special/table_chat_agent.py,sha256=d9v2wsblaRx7oMnKhLV7uO_ujvk9gh59pSGvBXyeyNc,9659
|
40
40
|
langroid/agent/structured_message.py,sha256=y7pud1EgRNeTFZlJmBkLmwME3yQJ_IYik-Xds9kdZbY,282
|
41
41
|
langroid/agent/task.py,sha256=_iQTpjPIR1OGF0lq-ZFzQ92f_OmdIFmv7LlhoUA1QB8,89729
|
42
|
+
langroid/agent/team.py,sha256=y0cpR0KvBQhBKJcEYRAY2n6URa6WMN1tZSih6qnSiHM,1063
|
42
43
|
langroid/agent/tool_message.py,sha256=aaJSypRy2sC8b2qOszc7efgr5TrQva51SUGnxTwKXEg,14406
|
43
44
|
langroid/agent/tools/__init__.py,sha256=IMgCte-_ZIvCkozGQmvMqxIw7_nKLKzD78ccJL1bnQU,804
|
44
45
|
langroid/agent/tools/duckduckgo_search_tool.py,sha256=NhsCaGZkdv28nja7yveAhSK_w6l_Ftym8agbrdzqgfo,1935
|
@@ -135,15 +136,15 @@ langroid/utils/types.py,sha256=4GrOnU3HLWh-UwaUPp7LlB3V413q3K5OSzc0ggDoQ6A,2510
|
|
135
136
|
langroid/utils/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
136
137
|
langroid/utils/web/login.py,sha256=1iz9eUAHa87vpKIkzwkmFa00avwFWivDSAr7QUhK7U0,2528
|
137
138
|
langroid/vector_store/__init__.py,sha256=6xBjb_z4QtUy4vz4RuFbcbSwmHrggHL8-q0DwCf3PMM,972
|
138
|
-
langroid/vector_store/base.py,sha256=
|
139
|
+
langroid/vector_store/base.py,sha256=WhVtiO_EuIMiwww_3ICQK6I7hwlmEyXEFKfWdbsES2Y,13952
|
139
140
|
langroid/vector_store/chromadb.py,sha256=KH_4K8ZfSv3ReiUxXGM6ZUy7ZKBp9LF3RGyuCRwwBlk,7870
|
140
141
|
langroid/vector_store/lancedb.py,sha256=l7C0UAMSQIntVE8a5Scg4V5f1odW40NJIbkKB_kxA2E,14626
|
141
142
|
langroid/vector_store/meilisearch.py,sha256=6frB7GFWeWmeKzRfLZIvzRjllniZ1cYj3HmhHQICXLs,11663
|
142
143
|
langroid/vector_store/momento.py,sha256=UNHGT6jXuQtqY9f6MdqGU14bVnS0zHgIJUa30ULpUJo,10474
|
143
144
|
langroid/vector_store/qdrant_cloud.py,sha256=3im4Mip0QXLkR6wiqVsjV1QvhSElfxdFSuDKddBDQ-4,188
|
144
145
|
langroid/vector_store/qdrantdb.py,sha256=v7mCsijc2GdRJyil-yFaUVAX4SX5D75mD3vzlpjCMuo,17393
|
145
|
-
pyproject.toml,sha256=
|
146
|
-
langroid-0.28.
|
147
|
-
langroid-0.28.
|
148
|
-
langroid-0.28.
|
149
|
-
langroid-0.28.
|
146
|
+
pyproject.toml,sha256=8yHJUY980ArmEfZOP_SS4L2blz9COR6rVGNr2YBw_qg,7533
|
147
|
+
langroid-0.28.7.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
|
148
|
+
langroid-0.28.7.dist-info/METADATA,sha256=Sr2BUV_iAsrCbT0zWopduyU484Lmr52eYvupFFUXvMQ,57569
|
149
|
+
langroid-0.28.7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
150
|
+
langroid-0.28.7.dist-info/RECORD,,
|
pyproject.toml
CHANGED
File without changes
|
File without changes
|