MCPcopy
hub / github.com/langroid/langroid / test_agent

Function test_agent

tests/main/test_agent.py:16–30  ·  view source on GitHub ↗

Test whether the combined configs work as expected.

(test_settings: lr.utils.configuration.Settings)

Source from the content-addressed store, hash-verified

14
15
16def test_agent(test_settings: lr.utils.configuration.Settings):
17 """
18 Test whether the combined configs work as expected.
19 """
20 lr.utils.configuration.set_global(test_settings)
21 agent_config = CustomAgentConfig()
22 agent = lr.Agent(agent_config)
23 response = agent.llm_response(
24 "what is the capital of France?"
25 ) # direct LLM question
26 assert "Paris" in response.content
27
28 with lr.language_models.base.StreamingIfAllowed(agent.llm, False):
29 response = agent.llm_response("what is the capital of France?")
30 assert "Paris" in response.content
31
32
33@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 2

llm_responseMethod · 0.95
CustomAgentConfigClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…