-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.http
104 lines (91 loc) · 2.12 KB
/
api.http
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
###----------------------------------------------------------------------------------------------------------------
# haystack stuff
# haystack health check
curl -X 'GET' \
'http://localhost:8000/health' \
-H 'accept: application/json'
###
# use haystack to get all/some documents using filters on document's metadata
curl -X 'POST' \
'http://localhost:8000/documents/get_by_filters' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"filters": {
"name": "seasons.txt"
}
}'
###
# Ask a question using haystack
curl -X 'POST' \
'http://localhost:8000/query' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"query": "Which day marks the return to work?",
"params": {},
"debug": false
}'
###----------------------------------------------------------------------------------------------------------------
# Weaviate stuff
# get info about current Weaviate instance
GET http://localhost:8080/v1/meta
###
# check weaviate nodes' health
curl http://localhost:8080/v1/nodes
###
# get all objects in Weaviate
GET http://localhost:8080/v1/objects
###
# get Weaviate schema
GET http://localhost:8080/v1/schema
###
# create a Document
POST http://localhost:8080/v1/objects
Content-Type: application/json
{
"class": "Document",
"properties": {
"name": "hello.txt",
"content_type": "text",
"content": "Hello world!"
}
}
###
# delete a Document
DELETE http://localhost:8080/v1/objects/Document/010750a4-aaf0-4ab9-9191-e4fe189cdce0
###
# get the content and vector representation of all Documents
POST http://localhost:8080/v1/graphql
X-Request-Type: GraphQL
Content-Type: application/json
query {
Get {
Document {
content
_additional {
vector
}
}
}
}
###
# get the content near a specified search term
POST http://localhost:8080/v1/graphql
X-Request-Type: GraphQL
Content-Type: application/json
query {
Get {
Document(
nearText: {
concepts: ["a banana has more calories than it is long"]
}
) {
content
_additional {
id
distance
}
}
}
}