mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-16 14:57:15 +00:00
feat(runner): unify plugin execution across agents and event processors
This commit is contained in:
@@ -13,7 +13,7 @@ from langbot_plugin.api.entities.builtin.resource import tool as resource_tool
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_fake_requester_counts_messages_and_tools(runtime_provider):
|
||||
"""Fake requester should support token-free AgentRunner context budgeting."""
|
||||
"""Fake requester should support token-free Runner context budgeting."""
|
||||
runtime_model = requester.RuntimeLLMModel(
|
||||
model_entity=persistence_model.LLMModel(
|
||||
uuid='fake-count-model',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Unit tests for LiteLLMRequester message/tool conversion.
|
||||
|
||||
This includes provider_specific_fields round-trip coverage for GitHub issue
|
||||
#1899 and token counting preflight behavior for AgentRunner context budgeting.
|
||||
#1899 and token counting preflight behavior for Runner context budgeting.
|
||||
"""
|
||||
|
||||
from types import SimpleNamespace
|
||||
@@ -73,7 +73,9 @@ async def test_count_tokens_uses_litellm_counter_with_request_messages_and_tools
|
||||
func=lambda **kwargs: None,
|
||||
)
|
||||
|
||||
with patch('langbot.pkg.provider.modelmgr.requesters.litellmchat.litellm.token_counter', return_value=42) as counter:
|
||||
with patch(
|
||||
'langbot.pkg.provider.modelmgr.requesters.litellmchat.litellm.token_counter', return_value=42
|
||||
) as counter:
|
||||
tokens = await req.count_tokens(
|
||||
model=model,
|
||||
messages=[
|
||||
|
||||
Reference in New Issue
Block a user