forked from lightspeed-core/lightspeed-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinline_rag.feature
More file actions
69 lines (62 loc) · 2.98 KB
/
Copy pathinline_rag.feature
File metadata and controls
69 lines (62 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Feature: Inline RAG (BYOK) support tests
Background:
Given The service is started locally
And The system is in default state
And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
And REST API service prefix is /v1
And The service uses the lightspeed-stack-inline-rag.yaml configuration
And The service is restarted
Scenario: Check if inline RAG source is registered
When I access REST API endpoint rags using HTTP GET method
Then The status code of the response is 200
And the body of the response has the following structure
"""
{
"rags": [
"e2e-test-docs"
]
}
"""
Scenario: Query with inline RAG returns relevant content
When I use "query" to ask question with authorization header
"""
{"query": "What is the title of the article from Paul?", "system_prompt": "You are an assistant. Write only lowercase letters"}
"""
Then The status code of the response is 200
And The response should contain following fragments
| Fragments in LLM response |
| great work |
And The response should contain non-empty rag_chunks
Scenario: Inline RAG query includes referenced documents
When I use "query" to ask question with authorization header
"""
{"query": "What does Paul Graham say about great work?"}
"""
Then The status code of the response is 200
And The response should contain non-empty referenced_documents
Scenario: Streaming query with inline RAG returns relevant content
When I use "streaming_query" to ask question with authorization header
"""
{"query": "What is the title of the article from Paul?", "system_prompt": "You are an assistant. Write only lowercase letters"}
"""
Then The status code of the response is 200
And I wait for the response to be completed
And The streamed response should contain following fragments
| Fragments in LLM response |
| great work |
Scenario: Responses API with inline RAG returns relevant content
When I use "responses" to ask question with authorization header
"""
{"input": "What is the title of the article from Paul?", "model": "{PROVIDER}/{MODEL}", "stream": false, "instructions": "You are an assistant. Write only lowercase letters"}
"""
Then The status code of the response is 200
And The response should contain following fragments
| Fragments in LLM response |
| great work |
Scenario: Streaming Responses API with inline RAG returns relevant content
When I use "responses" to ask question with authorization header
"""
{"input": "What is the title of the article from Paul?", "model": "{PROVIDER}/{MODEL}", "stream": true, "instructions": "You are an assistant. Write only lowercase letters"}
"""
Then The status code of the response is 200
And The body of the response contains great work