mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-14 06:30:57 +00:00
chore(merge): sync master into dev/4.11.x
This commit is contained in:
@@ -82,6 +82,9 @@ class FakeApp:
|
||||
def _create_mock_persistence_manager(self):
|
||||
persistence_mgr = AsyncMock()
|
||||
persistence_mgr.execute_async = AsyncMock()
|
||||
# AsyncMock invents arbitrary callable attributes on access. Keep the
|
||||
# optional production UoW hook explicitly absent unless a test opts in.
|
||||
persistence_mgr.tenant_uow = None
|
||||
return persistence_mgr
|
||||
|
||||
def _create_mock_query_pool(self):
|
||||
@@ -122,9 +125,13 @@ class FakeApp:
|
||||
return cmd_mgr
|
||||
|
||||
def _create_mock_skill_mgr(self):
|
||||
"""Mock SkillManager with no loaded skills by default."""
|
||||
"""Mock SkillManager that returns no skill index addition by default."""
|
||||
skill_mgr = Mock()
|
||||
skill_mgr.skills = {}
|
||||
skill_mgr.ensure_loaded = AsyncMock()
|
||||
skill_mgr.get_skills = Mock(return_value=[])
|
||||
skill_mgr.build_skill_aware_prompt_addition = Mock(return_value='')
|
||||
skill_mgr.get_skill_index = Mock(return_value=[])
|
||||
return skill_mgr
|
||||
|
||||
def _create_mock_pipeline_service(self):
|
||||
|
||||
@@ -14,6 +14,7 @@ import langbot_plugin.api.entities.builtin.platform.message as platform_message
|
||||
import langbot_plugin.api.entities.builtin.platform.events as platform_events
|
||||
import langbot_plugin.api.entities.builtin.platform.entities as platform_entities
|
||||
import langbot_plugin.api.entities.builtin.provider.session as provider_session
|
||||
from langbot.pkg.api.http.context import ExecutionContext
|
||||
|
||||
|
||||
# Counter for generating unique IDs
|
||||
@@ -196,7 +197,20 @@ def _base_query(
|
||||
for key, value in overrides.items():
|
||||
base_data[key] = value
|
||||
|
||||
return pipeline_query.Query.model_construct(**base_data)
|
||||
query = pipeline_query.Query.model_construct(**base_data)
|
||||
object.__setattr__(
|
||||
query,
|
||||
'_execution_context',
|
||||
ExecutionContext(
|
||||
instance_uuid='test-instance',
|
||||
workspace_uuid='test-workspace',
|
||||
placement_generation=1,
|
||||
bot_uuid=query.bot_uuid,
|
||||
pipeline_uuid=query.pipeline_uuid,
|
||||
query_uuid=query.query_uuid,
|
||||
),
|
||||
)
|
||||
return query
|
||||
|
||||
|
||||
def text_query(
|
||||
|
||||
Reference in New Issue
Block a user