9c71c8fa3b
- Implemented OllamaChatProvider to enable local Ollama model support. - Implemented MistralChatProvider to integrate with the Mistral API. - Added Behave BDD tests for both providers. - Updated dependencies: langchain-mistralai and ollama. - Updated provider exports to include the new providers. ISSUES CLOSED: #5257
71 lines
4.1 KiB
Gherkin
71 lines
4.1 KiB
Gherkin
Feature: Ollama chat provider coverage
|
|
As a maintainer integrating local model support
|
|
I want unit-level Behave scenarios for the Ollama chat provider
|
|
So that the local model adapter stays documented and regression tested
|
|
|
|
@unit @providers @ollama
|
|
Scenario: Ollama provider instantiates ChatOllama with provided credentials
|
|
Given I have sample provider domain inputs
|
|
When I create an Ollama chat provider with model "llama2" and base_url "http://localhost:11434"
|
|
And I request plan generation from the Ollama provider
|
|
Then the Ollama provider should construct ChatOllama with model "llama2" and base_url "http://localhost:11434"
|
|
And the Ollama provider metadata should report name "ollama" and model "llama2"
|
|
|
|
@unit @providers @ollama
|
|
Scenario: Ollama provider stubbed response reports metadata
|
|
Given I have sample provider domain inputs
|
|
And I create an Ollama chat provider with model "llama2" and base_url "http://localhost:11434"
|
|
When I request plan generation from the Ollama provider
|
|
Then the Ollama provider response should contain no generated changes
|
|
And the Ollama provider response should report the requested model without errors
|
|
|
|
@unit @providers @ollama
|
|
Scenario: Ollama provider rejects missing model name
|
|
Given I have sample provider domain inputs
|
|
When I attempt to create an Ollama chat provider without a model name
|
|
Then the Ollama provider creation should fail with error "Ollama model name is required"
|
|
|
|
@unit @providers @ollama
|
|
Scenario: Ollama provider uses default base URL
|
|
Given I have sample provider domain inputs
|
|
When I create an Ollama chat provider with model "llama2" and default base_url
|
|
And I request plan generation from the Ollama provider
|
|
Then the Ollama provider should construct ChatOllama with model "llama2" and base_url "http://localhost:11434"
|
|
|
|
@unit @providers @ollama
|
|
Scenario: Ollama provider forwards extra kwargs
|
|
Given I have sample provider domain inputs
|
|
And I set the Ollama provider extra kwargs "temperature=0.7,top_p=0.9"
|
|
When I create an Ollama chat provider with model "llama2" and base_url "http://localhost:11434"
|
|
And I request plan generation from the Ollama provider
|
|
Then the Ollama provider should construct ChatOllama with model "llama2" and base_url "http://localhost:11434"
|
|
And the Ollama provider should include kwargs "temperature=0.7,top_p=0.9" in the ChatOllama call
|
|
|
|
@unit @providers @ollama
|
|
Scenario: Ollama provider reports runtime errors
|
|
Given I have sample provider domain inputs
|
|
And I create an Ollama chat provider with model "llama2" and base_url "http://localhost:11434"
|
|
And the plan generation graph raises RuntimeError "connection refused"
|
|
When I request plan generation from the Ollama provider
|
|
Then the Ollama provider response should report error "connection refused"
|
|
And the Ollama provider response should contain no generated changes
|
|
|
|
@unit @providers @ollama
|
|
Scenario: Ollama provider streaming yields workflow events
|
|
Given I have sample provider domain inputs
|
|
And the plan generation graph returns a generated change for "app/stream.py"
|
|
And the plan generation graph emits streaming nodes "load_context,analyze_requirements,generate_plan,validate"
|
|
And I create an Ollama chat provider with model "llama2" and base_url "http://localhost:11434"
|
|
When I stream plan generation from the Ollama provider
|
|
Then the Ollama provider streaming events should include nodes "load_context,analyze_requirements,generate_plan,validate"
|
|
And the Ollama provider streaming result should finish with a response containing 1 generated change
|
|
|
|
@unit @providers @ollama
|
|
Scenario: Ollama provider surfaces plan generation errors
|
|
Given I have sample provider domain inputs
|
|
And the plan generation graph raises ValueError "model not found"
|
|
And I create an Ollama chat provider with model "llama2" and base_url "http://localhost:11434"
|
|
When I request plan generation from the Ollama provider
|
|
Then the Ollama provider response should report error "model not found"
|
|
And the Ollama provider response should contain no generated changes
|