mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-09 12:40:59 +00:00
chore(merge): sync master into dev/4.11.x
This commit is contained in:
@@ -5,7 +5,12 @@ from __future__ import annotations
|
||||
from unittest.mock import AsyncMock
|
||||
import pytest
|
||||
|
||||
from langbot.pkg.vector.vdb import SearchType, VectorDatabase
|
||||
from langbot.pkg.vector.vdb import (
|
||||
SearchType,
|
||||
VectorDatabase,
|
||||
remember_bounded_mapping,
|
||||
remember_bounded_set,
|
||||
)
|
||||
|
||||
|
||||
class TestSearchType:
|
||||
@@ -29,6 +34,18 @@ class TestSearchType:
|
||||
assert SearchType('hybrid') == SearchType.HYBRID
|
||||
|
||||
|
||||
def test_runtime_cache_helpers_bound_mapping_and_set():
|
||||
mapping = {}
|
||||
values = set()
|
||||
|
||||
for index in range(100):
|
||||
remember_bounded_mapping(mapping, str(index), object(), 8)
|
||||
remember_bounded_set(values, str(index), 8)
|
||||
|
||||
assert len(mapping) == 8
|
||||
assert len(values) == 8
|
||||
|
||||
|
||||
class TestVectorDatabaseAbstractMethods:
|
||||
"""Tests for VectorDatabase abstract methods."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user