mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-19 02:01:02 +02:00
More API doc hacking
This commit is contained in:
parent
779c62d328
commit
4b699159fe
7 changed files with 50 additions and 3 deletions
|
|
@ -66,4 +66,6 @@ Cons:
|
||||||
- [Agent](api-agent.md)
|
- [Agent](api-agent.md)
|
||||||
- [Embeddings](api-embeddings.md)
|
- [Embeddings](api-embeddings.md)
|
||||||
- [Text completion](api-text-completion.md)
|
- [Text completion](api-text-completion.md)
|
||||||
|
- [Graph embeddings](api-graph-embeddings.md)
|
||||||
|
- [Triples query](api-triples-query.md)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
|
||||||
|
{"id":"blrqotfefnmnh7de-20","service":"agent","request":{"question":"What does NASA stand for?"}}
|
||||||
|
|
||||||
|
|
||||||
|
{"id": "blrqotfefnmnh7de-20", "response": {"thought": "I need to query a knowledge base to find out what NASA stands for."}, "complete": fals}e
|
||||||
|
|
||||||
|
|
||||||
|
{"id": "blrqotfefnmnh7de-20", "response": {"observation": "Based on the provided text, NASA stands for National Aeronautics and Space Administration."}, "complete": false}
|
||||||
|
|
||||||
|
{"id": "blrqotfefnmnh7de-20", "response": {"thought": "I now know the final answer"}, "complete": false}
|
||||||
|
|
||||||
|
|
||||||
|
{"id": "blrqotfefnmnh7de-20", "response": {"answer": "National Aeronautics and Space Administration"}, "complete": true}
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
5
docs/apis/api-graph-embeddings.md
Normal file
5
docs/apis/api-graph-embeddings.md
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
|
||||||
|
{"id":"blrqotfefnmnh7de-1","service":"text-completion","request":{"system":"You are a helpful agent","prompt":"What does NASA stand for?"}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{"id": "blrqotfefnmnh7de-1", "response": {"response": "NASA stands for the National Aeronautics and Space Administration.\n"}, "complete": true}
|
||||||
|
|
||||||
7
docs/apis/api-triples-query.md
Normal file
7
docs/apis/api-triples-query.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{"id":"qgzw1287vfjc8wsk-4","service":"triples-query","request":{"s":{"v":"http://trustgraph.ai/e/space-station-modules","e":true},"p":{"v":"http://www.w3.org/2000/01/rdf-schema#label","e":true},"limit":1}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{"id": "qgzw1287vfjc8wsk-4", "response": {"response": [{"s": {"v": "http://trustgraph.ai/e/space-station-modules", "e": true}, "p": {"v": "http://www.w3.org/2000/01/rdf-schema#label", "e": true}, "o": {"v": "space station modules", "e": false}}]}, "complete": true}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -6,10 +6,11 @@ The websocket service is provided by the `api-gateway` service on port
|
||||||
|
|
||||||
## URL
|
## URL
|
||||||
|
|
||||||
Depending on how the service is hosted, the websocket is invoked on URL:
|
Depending on how the service is hosted, the websocket is invoked on this
|
||||||
|
URL on `api-gateway`:
|
||||||
|
|
||||||
```
|
```
|
||||||
ws://api-gateway:8088/api/v1/socket
|
/api/v1/socket
|
||||||
```
|
```
|
||||||
|
|
||||||
When hosted using docker compose, you can access the service at
|
When hosted using docker compose, you can access the service at
|
||||||
|
|
@ -22,7 +23,8 @@ A request message is a JSON message containing 3 fields:
|
||||||
- `id`: A unique ID which is used to correlate requests and responses.
|
- `id`: A unique ID which is used to correlate requests and responses.
|
||||||
You should make sure it is unique.
|
You should make sure it is unique.
|
||||||
- `service`: The name of the service to invoke.
|
- `service`: The name of the service to invoke.
|
||||||
- `request`: The request body which is passed to the service.
|
- `request`: The request body which is passed to the service - this is
|
||||||
|
defined in the API documentation for that service.
|
||||||
|
|
||||||
e.g.
|
e.g.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue