Skip to content

Commit 32cbc2c

Browse files
Fix mypy errors: SpeakV1Text type param, turbopuffer RowParam typing
Co-authored-by: Neevash Ramdial (Nash) <mail@neevash.com>
1 parent 6d1fdf4 commit 32cbc2c

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

plugins/deepgram/vision_agents/plugins/deepgram/tts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ async def stream_audio(self, text: str, *_, **__) -> AsyncIterator[PcmData]:
102102
self._stop_event.clear()
103103

104104
try:
105-
await socket.send_text(SpeakV1Text(text=text))
105+
await socket.send_text(SpeakV1Text(type="Speak", text=text))
106106
await socket.send_flush()
107107
except (websockets.exceptions.ConnectionClosed, ConnectionError):
108108
logger.warning("Deepgram TTS websocket dropped, reconnecting")
109109
await self._reset_connection()
110110
socket = await self._ensure_connection()
111-
await socket.send_text(SpeakV1Text(text=text))
111+
await socket.send_text(SpeakV1Text(type="Speak", text=text))
112112
await socket.send_flush()
113113

114114
self._generation += 1

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
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
4950

5051
from vision_agents.core.rag import RAG, Document
5152

@@ -181,19 +182,18 @@ async def add_documents(self, documents: list[Document]) -> int:
181182
None, self._embeddings.embed_documents, all_chunks
182183
)
183184

184-
rows = []
185+
rows: list[RowParam] = []
185186
for chunk, embedding, (source, idx) in zip(
186187
all_chunks, embeddings, chunk_sources
187188
):
188-
rows.append(
189-
{
190-
"id": f"{source}_{idx}",
191-
"vector": embedding,
192-
"text": chunk,
193-
"source": source,
194-
"chunk_index": idx,
195-
}
196-
)
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)
197197

198198
ns = self._client.namespace(self._namespace_name)
199199
await ns.write(

0 commit comments

Comments
 (0)