File size: 666 Bytes
a34068e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pytest
from fastapi.testclient import TestClient

from app.main import app


@pytest.fixture
def client():
    return TestClient(app)


@pytest.fixture
def sample_text():
    return (
        "Retrieval-Augmented Generation (RAG) is a technique that combines "
        "information retrieval with text generation. It was introduced by "
        "Facebook AI Research in 2020. RAG systems first retrieve relevant "
        "documents from a knowledge base, then use a language model to generate "
        "answers based on those documents. This approach reduces hallucinations "
        "and provides more factual responses compared to pure generation."
    )