73 lines
3.1 KiB
Gherkin
73 lines
3.1 KiB
Gherkin
Feature: Stream Router agent and tool coverage
|
|
As a developer
|
|
I want Behave coverage for SimpleToolAgent and SimpleLLMAgent
|
|
So that uncovered agent branches are exercised
|
|
|
|
Scenario: SimpleToolAgent returns content when tool code is missing
|
|
Given a SimpleToolAgent with a tool missing code
|
|
When I process "payload" through the SimpleToolAgent
|
|
Then the SimpleToolAgent result should be "payload"
|
|
|
|
Scenario: SimpleToolAgent returns empty string when tool execution fails
|
|
Given a SimpleToolAgent with invalid tool code
|
|
When I process "payload" through the SimpleToolAgent
|
|
Then the SimpleToolAgent result should be empty
|
|
|
|
Scenario: SimpleToolAgent process_message_sync runs tool code
|
|
Given a SimpleToolAgent with working tool code
|
|
When I call process_message_sync with "payload"
|
|
Then the SimpleToolAgent result should be "ok:payload"
|
|
|
|
Scenario: SimpleLLMAgent returns empty prompt for blank template
|
|
Given a SimpleLLMAgent for prompt rendering
|
|
When I render the template "<empty>" with context:
|
|
| key | value |
|
|
| name | Ada |
|
|
Then the rendered prompt should be "<empty>"
|
|
|
|
Scenario: SimpleLLMAgent returns raw template when environment is missing
|
|
Given a SimpleLLMAgent for prompt rendering
|
|
And the SimpleLLMAgent template environment is "none"
|
|
When I render the template "Hello" with context:
|
|
| key | value |
|
|
| name | Ada |
|
|
Then the rendered prompt should be "Hello"
|
|
|
|
Scenario: SimpleLLMAgent renders template when environment succeeds
|
|
Given a SimpleLLMAgent for prompt rendering
|
|
And the SimpleLLMAgent template environment is "working"
|
|
When I render the template "Hello {{ name }}" with context:
|
|
| key | value |
|
|
| name | Ada |
|
|
Then the rendered prompt should be "Hello Ada"
|
|
|
|
Scenario: SimpleLLMAgent falls back to template on render failure
|
|
Given a SimpleLLMAgent for prompt rendering
|
|
And the SimpleLLMAgent template environment is "failing"
|
|
When I render the template "Hello {{ name }}" with context:
|
|
| key | value |
|
|
| name | Ada |
|
|
Then the rendered prompt should be "Hello {{ name }}"
|
|
|
|
Scenario: SimpleLLMAgent resolves LLM with configured kwargs and caching
|
|
Given a SimpleLLMAgent with provider config
|
|
And a stub provider registry is installed
|
|
When I resolve the LLM twice
|
|
Then the registry should be called once with the configured kwargs
|
|
And the resolved LLM should be cached
|
|
|
|
Scenario: SimpleLLMAgent raises when LangChain messages are unavailable
|
|
Given a SimpleLLMAgent with provider config
|
|
And a stub provider registry is installed
|
|
And LangChain message classes are unavailable
|
|
When I process "ping" through the LLM agent
|
|
Then I should receive a stream routing error about missing messages
|
|
|
|
Scenario: SimpleLLMAgent process_message_sync returns LLM content
|
|
Given a SimpleLLMAgent with system prompt and provider config
|
|
And a stub provider registry is installed
|
|
And LangChain message stubs are installed
|
|
When I process 123 through the LLM agent via process_message_sync
|
|
Then the LLM should receive system and human messages
|
|
And the LLM agent result should be "llm-output"
|