Skip to content

Commit d61c41b

Browse files
committed
some cleanup
1 parent b343d5a commit d61c41b

File tree

10 files changed

+38
-13
lines changed

10 files changed

+38
-13
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Pytest configuration for phone example tests."""
22

3-
import pytest
43

54
# Override root conftest - we don't need blockbuster for these tests

examples/03_phone_and_rag_example/test_rag_turbopuffer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for TurboPuffer Hybrid RAG."""
22

3+
import logging
34
from pathlib import Path
45

56
import pytest
@@ -8,7 +9,6 @@
89
from rag_turbopuffer import TurboPufferRAG
910

1011
load_dotenv()
11-
import logging
1212

1313
logger = logging.getLogger(__name__)
1414
logger.setLevel(logging.DEBUG)
@@ -31,6 +31,5 @@ async def test_index_and_search(knowledge_dir: Path):
3131
result = await rag.search("chat messaging")
3232
assert "Chat" in result
3333
logger.info("result %s", result)
34-
import pdb; pdb.set_trace()
3534

3635
await rag.close()

plugins/gemini/vision_agents/plugins/gemini/file_search.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ async def create(self) -> str:
8686
)
8787
self._store_name = store.name
8888
logger.info(f"Created FileSearchStore '{self.name}': {self._store_name}")
89+
assert self._store_name is not None
8990
return self._store_name
9091

9192
async def upload_file(self, file_path: str | Path, display_name: Optional[str] = None) -> None:
@@ -99,6 +100,8 @@ async def upload_file(self, file_path: str | Path, display_name: Optional[str] =
99100
if not self._store_name:
100101
raise ValueError("Store not created. Call create() first.")
101102

103+
store_name = self._store_name
104+
102105
file_path = Path(file_path)
103106
if not file_path.exists():
104107
raise FileNotFoundError(f"File not found: {file_path}")
@@ -112,7 +115,7 @@ async def upload_file(self, file_path: str | Path, display_name: Optional[str] =
112115
None,
113116
lambda: self._client.file_search_stores.upload_to_file_search_store(
114117
file=str(file_path),
115-
file_search_store_name=self._store_name,
118+
file_search_store_name=store_name,
116119
config={"display_name": display_name}
117120
)
118121
)

plugins/gemini/vision_agents/plugins/gemini/gemini_realtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def get_config(self) -> LiveConnectConfigDict:
353353
if self.file_search_store and self.file_search_store.is_created:
354354
file_search_config = self.file_search_store.get_tool_config()
355355
tools.append(file_search_config)
356-
logger.info(f"Adding file search tool to Gemini Live config")
356+
logger.info("Adding file search tool to Gemini Live config")
357357

358358
if tools:
359359
config["tools"] = tools # type: ignore[typeddict-item]

plugins/twilio/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies = [
1313
"vision-agents",
1414
"twilio>=9.0.0",
1515
"numpy>=1.24.0",
16+
"fastapi>=0.100.0",
1617
]
1718

1819
[project.urls]

plugins/twilio/tests/test_audio.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Comprehensive tests for mulaw/PCM audio conversion."""
22

33
import numpy as np
4-
import pytest
54
from getstream.video.rtc.track_util import PcmData, AudioFormat
65

76
from vision_agents.plugins.twilio.audio import (
@@ -131,7 +130,7 @@ def test_encode_matches_reference(self):
131130
f"PCM {pcm_val}: ours={our_mulaw:#04x}, expected={expected_mulaw:#04x}"
132131
)
133132

134-
assert not mismatches, f"Encoding mismatches:\n" + "\n".join(mismatches)
133+
assert not mismatches, "Encoding mismatches:\n" + "\n".join(mismatches)
135134

136135
def test_encode_symmetry(self):
137136
"""Positive and negative values should encode symmetrically."""

plugins/twilio/tests/test_twilio.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pytest
21
from datetime import datetime
32
from dotenv import load_dotenv
43

@@ -90,7 +89,6 @@ class TestAudioConversion:
9089
def test_mulaw_to_pcm(self):
9190
"""Test mulaw to PCM conversion."""
9291
# Create some test mulaw bytes
93-
import numpy as np
9492
mulaw_bytes = bytes([0xFF, 0x7F, 0x00, 0x80]) # Various mulaw values
9593

9694
pcm = twilio.mulaw_to_pcm(mulaw_bytes)

plugins/twilio/vision_agents/plugins/twilio/audio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ def _build_mulaw_encode_table() -> np.ndarray:
6464

6565
# Fallback: Try audioop-lts (available for Python >= 3.13)
6666
try:
67-
import audioop_lts as audioop
67+
import audioop_lts
6868

6969
for i in range(65536):
7070
pcm_bytes = i.to_bytes(2, byteorder="little", signed=False)
71-
table[i] = audioop.lin2ulaw(pcm_bytes, 2)[0]
71+
table[i] = audioop_lts.lin2ulaw(pcm_bytes, 2)[0]
7272
return table
7373

7474
except ImportError:

plugins/twilio/vision_agents/plugins/twilio/call_registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import secrets
66
from dataclasses import dataclass, field
77
from datetime import datetime
8-
from typing import Any, Awaitable, Callable, Optional, TYPE_CHECKING, TypeVar
8+
from typing import Any, Callable, Coroutine, Optional, TYPE_CHECKING, TypeVar
99

1010
if TYPE_CHECKING:
1111
from .media_stream import TwilioMediaStream
@@ -119,7 +119,7 @@ def create(
119119
self,
120120
call_id: str,
121121
webhook_data: Optional["CallWebhookInput"] = None,
122-
prepare: Optional[Callable[[], Awaitable[Any]]] = None,
122+
prepare: Optional[Callable[[], Coroutine[Any, Any, Any]]] = None,
123123
) -> TwilioCall:
124124
"""
125125
Create and register a new TwilioCall.

uv.lock

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)