-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathembedding-api-test.hurl
55 lines (49 loc) · 1.11 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
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_name": "BGESmall",
"document_fields": ["content"]
},
"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",
"content": "The cat is running outside."
},
{
"id": "2",
"content": "A cat rests peacefully on the sofa."
},
{
"id": "3",
"content": "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."
}
HTTP 200
[Asserts]
jsonpath "$.hits[0].id" == "2"