mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
chore(vite): silence Sass import deprecation warnings
This commit is contained in:
@@ -30,7 +30,9 @@ function mdiFontDownload() {
|
||||
);
|
||||
const mdiDest = resolve(configDir, "public/fonts");
|
||||
if (!existsSync(mdiSource)) {
|
||||
console.warn("[mdi-font] @mdi/font not found in node_modules, skipping download");
|
||||
console.warn(
|
||||
"[mdi-font] @mdi/font not found in node_modules, skipping download",
|
||||
);
|
||||
return;
|
||||
}
|
||||
mkdirSync(mdiDest, { recursive: true });
|
||||
@@ -75,7 +77,10 @@ export default defineConfig(({ command, mode }) => {
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {},
|
||||
scss: {
|
||||
api: "modern-compiler",
|
||||
silenceDeprecations: ["import", "global-builtin"],
|
||||
},
|
||||
},
|
||||
},
|
||||
build: {
|
||||
|
||||
@@ -81,10 +81,23 @@ def mock_knowledge_base():
|
||||
|
||||
@pytest.fixture
|
||||
def mock_embedding_provider():
|
||||
"""Create a mock EmbeddingProvider."""
|
||||
provider = MagicMock()
|
||||
provider.get_embeddings_batch = AsyncMock(return_value=[[0.1, 0.2, 0.3]])
|
||||
return provider
|
||||
"""Create a mock EmbeddingProvider that passes isinstance checks."""
|
||||
from astrbot.core.provider.provider import EmbeddingProvider
|
||||
|
||||
class FakeEmbeddingProvider(EmbeddingProvider):
|
||||
def __init__(self) -> None:
|
||||
pass # Skip normal __init__ that needs config dicts
|
||||
|
||||
async def get_embedding(self, text: str) -> list[float]:
|
||||
return [0.1, 0.2, 0.3]
|
||||
|
||||
async def get_embeddings(self, text: list[str]) -> list[list[float]]:
|
||||
return [[0.1, 0.2, 0.3] for _ in text]
|
||||
|
||||
def get_dim(self) -> int:
|
||||
return 3
|
||||
|
||||
return FakeEmbeddingProvider()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user