Skip to content

Commit 7048c37

Browse files
Revert RowParam import, use type: ignore for turbopuffer dict rows
Co-authored-by: Neevash Ramdial (Nash) <mail@neevash.com>
1 parent 32cbc2c commit 7048c37

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

plugins/turbopuffer/vision_agents/plugins/turbopuffer/turbopuffer_rag.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
from langchain_google_genai import GoogleGenerativeAIEmbeddings
4747
from langchain_text_splitters import RecursiveCharacterTextSplitter
4848
from turbopuffer import AsyncTurbopuffer, NotFoundError
49-
from turbopuffer.types import RowParam
5049

5150
from vision_agents.core.rag import RAG, Document
5251

@@ -182,22 +181,23 @@ async def add_documents(self, documents: list[Document]) -> int:
182181
None, self._embeddings.embed_documents, all_chunks
183182
)
184183

185-
rows: list[RowParam] = []
184+
rows = []
186185
for chunk, embedding, (source, idx) in zip(
187186
all_chunks, embeddings, chunk_sources
188187
):
189-
row: RowParam = {
190-
"id": f"{source}_{idx}",
191-
"vector": embedding,
192-
"text": chunk,
193-
"source": source,
194-
"chunk_index": idx,
195-
}
196-
rows.append(row)
188+
rows.append(
189+
{
190+
"id": f"{source}_{idx}",
191+
"vector": embedding,
192+
"text": chunk,
193+
"source": source,
194+
"chunk_index": idx,
195+
}
196+
)
197197

198198
ns = self._client.namespace(self._namespace_name)
199199
await ns.write(
200-
upsert_rows=rows,
200+
upsert_rows=rows, # type: ignore[arg-type]
201201
distance_metric="cosine_distance",
202202
schema=HYBRID_SCHEMA, # type: ignore[arg-type]
203203
)

0 commit comments

Comments
 (0)