Skip to content

Commit e662a7c

Browse files
v29.0.0 (#104)
* wip * update deps * wip * wip * need to test * pdfs fully working * fix bug with doc text add * fix document deletion * fix failing test
1 parent de673af commit e662a7c

File tree

11 files changed

+2113
-2499
lines changed

11 files changed

+2113
-2499
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ config = {
388388

389389
### Knowledge Base
390390

391-
The Knowledge Base (KB) is meant to store text values and/or small PDFs.
391+
The Knowledge Base (KB) is meant to store text values and/or PDFs (extracts text) - can handle very large PDFs.
392392

393393
```python
394394
config = {

poetry.lock

+119-119
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "solana-agent"
3-
version = "28.3.3"
3+
version = "29.0.0"
44
description = "AI Agents for Solana"
55
authors = ["Bevan Hunt <[email protected]>"]
66
license = "MIT"
@@ -24,10 +24,10 @@ python_paths = [".", "tests"]
2424

2525
[tool.poetry.dependencies]
2626
python = ">=3.12,<4.0"
27-
openai = "1.76.2"
27+
openai = "1.77.0"
2828
pydantic = ">=2"
2929
pymongo = "4.12.1"
30-
zep-cloud = "2.11.0"
30+
zep-cloud = "2.12.1"
3131
instructor = "1.7.9"
3232
pinecone = "6.0.2"
3333
llama-index-core = "0.12.32"

solana_agent/adapters/mongodb_adapter.py

+10
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ def insert_one(self, collection: str, document: Dict) -> str:
3232
self.db[collection].insert_one(document)
3333
return document["_id"]
3434

35+
def insert_many(self, collection: str, documents: List[Dict]) -> List[str]:
36+
for document in documents:
37+
if "_id" not in document:
38+
document["_id"] = str(uuid.uuid4())
39+
result = self.db[collection].insert_many(documents)
40+
return [str(doc_id) for doc_id in result.inserted_ids]
41+
42+
def delete_many(self, collection: str, query: Dict):
43+
return self.db[collection].delete_many(query)
44+
3545
def find_one(self, collection: str, query: Dict) -> Optional[Dict]:
3646
return self.db[collection].find_one(query)
3747

solana_agent/client/solana_agent.py

-42
Original file line numberDiff line numberDiff line change
@@ -227,48 +227,6 @@ async def kb_delete_document(
227227
kb = self._ensure_kb()
228228
return await kb.delete_document(document_id, namespace)
229229

230-
async def kb_update_document(
231-
self,
232-
document_id: str,
233-
text: Optional[str] = None,
234-
metadata: Optional[Dict[str, Any]] = None,
235-
namespace: Optional[str] = None,
236-
) -> bool:
237-
"""
238-
Update an existing document in the knowledge base.
239-
240-
Args:
241-
document_id: ID of document to update.
242-
text: Optional new text content.
243-
metadata: Optional metadata to update.
244-
namespace: Optional Pinecone namespace.
245-
246-
Returns:
247-
True if successful.
248-
"""
249-
kb = self._ensure_kb()
250-
return await kb.update_document(document_id, text, metadata, namespace)
251-
252-
async def kb_add_documents_batch(
253-
self,
254-
documents: List[Dict[str, Any]],
255-
namespace: Optional[str] = None,
256-
batch_size: int = 50,
257-
) -> List[str]:
258-
"""
259-
Add multiple documents to the knowledge base in batches.
260-
261-
Args:
262-
documents: List of documents ({'text': ..., 'metadata': ...}).
263-
namespace: Optional Pinecone namespace.
264-
batch_size: Number of documents per batch.
265-
266-
Returns:
267-
List of added document IDs.
268-
"""
269-
kb = self._ensure_kb()
270-
return await kb.add_documents_batch(documents, namespace, batch_size)
271-
272230
async def kb_add_pdf_document(
273231
self,
274232
pdf_data: Union[bytes, str],

solana_agent/interfaces/client/client.py

-21
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,6 @@ async def kb_delete_document(
9191
"""Delete a document from the knowledge base."""
9292
pass
9393

94-
@abstractmethod
95-
async def kb_update_document(
96-
self,
97-
document_id: str,
98-
text: Optional[str] = None,
99-
metadata: Optional[Dict[str, Any]] = None,
100-
namespace: Optional[str] = None,
101-
) -> bool:
102-
"""Update an existing document in the knowledge base."""
103-
pass
104-
105-
@abstractmethod
106-
async def kb_add_documents_batch(
107-
self,
108-
documents: List[Dict[str, Any]],
109-
namespace: Optional[str] = None,
110-
batch_size: int = 50,
111-
) -> List[str]:
112-
"""Add multiple documents to the knowledge base in batches."""
113-
pass
114-
11594
@abstractmethod
11695
async def kb_add_pdf_document(
11796
self,

solana_agent/interfaces/services/knowledge_base.py

-25
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,6 @@ async def delete_document(
4444
"""
4545
pass
4646

47-
@abstractmethod
48-
async def update_document(
49-
self,
50-
document_id: str,
51-
text: Optional[str] = None,
52-
metadata: Optional[Dict[str, Any]] = None,
53-
namespace: Optional[str] = None,
54-
) -> bool:
55-
"""
56-
Update an existing document in the knowledge base.
57-
"""
58-
pass
59-
60-
@abstractmethod
61-
async def add_documents_batch(
62-
self,
63-
documents: List[Dict[str, Any]],
64-
namespace: Optional[str] = None,
65-
batch_size: int = 50,
66-
) -> List[str]:
67-
"""
68-
Add multiple documents in batches.
69-
"""
70-
pass
71-
7247
@abstractmethod
7348
async def add_pdf_document(
7449
self,

0 commit comments

Comments
 (0)