-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathembedding-api-test.hurl
56 lines (50 loc) · 1.13 KB
/
embedding-api-test.hurl
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
GET {{base_url}}/
HTTP 200
GET {{base_url}}/health
HTTP 200
GET http://www.randomnumberapi.com/api/v1.0/randomuuid
HTTP 200
[Captures]
collection_id: jsonpath "$[0]"
POST {{base_url}}/v1/collections/create
Authorization: Bearer my-master-api-key
{
"id": "{{collection_id}}",
"embeddings": {
"model": "BGESmall",
"document_fields": ["text"]
},
"read_api_key": "my-read-api-key",
"write_api_key": "my-write-api-key"
}
HTTP 201
POST {{base_url}}/v1/collections/{{collection_id}}/insert
Authorization: Bearer my-write-api-key
[
{
"id": "1",
"text": "The cat is sleeping on the table."
},
{
"id": "2",
"text": "A cat rests peacefully on the sofa."
},
{
"id": "3",
"text": "The dog is barking loudly in the yard."
}
]
HTTP 200
POST {{base_url}}/v1/collections/{{collection_id}}/search?api-key=my-read-api-key
Authorization: Bearer my-read-api-key
[Options]
retry: 10
retry-interval: 500ms
{
"mode": "vector",
"term": "The feline is napping comfortably indoors.",
"similarity": 0.6
}
HTTP 200
[Asserts]
jsonpath "$.hits[0].id" == "2"