async def test_rag_with_different_provider_models(self, mock_providers, mock_search_results):
        """Test RAG with different provider models."""
        class RAGProcessor:
            def __init__(self, providers):
                self.providers = providers
                self.prompt_builder = MagicMock()
                self.prompt_builder.build_prompt = AsyncMock(
                    return_value=[
                        {"role": "system", "content": "System prompt with context"},
                        {"role": "user", "content": "What did Aristotle say about ethics?"}
                    ]
                )

            async def generate(self, query, search_results, model=None, **kwargs):
                # Build the prompt
                messages = await self.prompt_builder.build_prompt(
                    query=query,
                    search_results=search_results,
                    **kwargs
                )

                # Generate a response with the specified model
                response = await self.providers.llm.aget_completion(
                    messages=messages,
                    model=model
                )
                return response["choices"][0]["message"]["content"]

        # Create the processor
        processor = RAGProcessor(mock_providers)

        # Generate responses with different models
        query = "What did Aristotle say about ethics?"
        models = ["gpt-4", "claude-3-opus", "gemini-pro"]

        for model in models:
            await processor.generate(
                query=query,
                search_results=mock_search_results,
                model=model
            )

            # Verify the LLM was called with the correct model
            call_kwargs = mock_providers.llm.aget_completion.call_args[1]
            assert call_kwargs["model"] == model

            # Reset the mock for the next iteration
            mock_providers.llm.aget_completion.reset_mock()
Test RAG with different provider models.
py/tests/unit/retrieval/test_rag_processing.py