mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 11:41:02 +02:00
Update some API basics for the 0.23/1.0 API change
This commit is contained in:
parent
b1a546e4d2
commit
7cb36f1998
8 changed files with 20 additions and 8 deletions
|
|
@ -18,7 +18,7 @@ The request contains the following fields:
|
|||
|
||||
### Response
|
||||
|
||||
The request contains the following fields:
|
||||
The response contains the following fields:
|
||||
- `thought`: Optional, a string, provides an interim agent thought
|
||||
- `observation`: Optional, a string, provides an interim agent thought
|
||||
- `answer`: Optional, a string, provides the final answer
|
||||
|
|
@ -61,6 +61,7 @@ Request:
|
|||
{
|
||||
"id": "blrqotfefnmnh7de-20",
|
||||
"service": "agent",
|
||||
"flow": "default",
|
||||
"request": {
|
||||
"question": "What does NASA stand for?"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ The request contains the following fields:
|
|||
|
||||
### Response
|
||||
|
||||
The request contains the following fields:
|
||||
The response contains the following fields:
|
||||
- `vectors`: Embeddings response, an array of arrays. An embedding is
|
||||
an array of floating-point numbers. As multiple embeddings may be
|
||||
returned, an array of embeddings is returned, hence an array
|
||||
|
|
@ -51,6 +51,7 @@ Request:
|
|||
{
|
||||
"id": "qgzw1287vfjc8wsk-2",
|
||||
"service": "embeddings",
|
||||
"flow": "default",
|
||||
"request": {
|
||||
"text": "What is a cat?"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ The request contains the following fields:
|
|||
|
||||
### Response
|
||||
|
||||
The request contains the following fields:
|
||||
The response contains the following fields:
|
||||
- `entities`: An array of graph entities. The entity type is described here:
|
||||
|
||||
TrustGraph uses the same schema for knowledge graph elements:
|
||||
|
|
@ -85,6 +85,7 @@ Request:
|
|||
{
|
||||
"id": "qgzw1287vfjc8wsk-3",
|
||||
"service": "graph-embeddings-query",
|
||||
"flow": "default",
|
||||
"request": {
|
||||
"vectors": [
|
||||
[
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ The request contains the following fields:
|
|||
|
||||
### Response
|
||||
|
||||
The request contains the following fields:
|
||||
The response contains the following fields:
|
||||
- `response`: LLM response
|
||||
|
||||
## REST service
|
||||
|
|
@ -52,6 +52,7 @@ Request:
|
|||
{
|
||||
"id": "blrqotfefnmnh7de-14",
|
||||
"service": "graph-rag",
|
||||
"flow": "default",
|
||||
"request": {
|
||||
"query": "What does NASA stand for?"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ The request contains the following fields:
|
|||
|
||||
### Response
|
||||
|
||||
The request contains either of these fields:
|
||||
The response contains either of these fields:
|
||||
- `text`: A plain text response
|
||||
- `object`: A structured object, JSON-encoded
|
||||
|
||||
|
|
@ -60,6 +60,7 @@ Request:
|
|||
{
|
||||
"id": "akshfkiehfkseffh-142",
|
||||
"service": "prompt",
|
||||
"flow": "default",
|
||||
"request": {
|
||||
"id": "extract-definitions",
|
||||
"variables": {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ The request contains the following fields:
|
|||
|
||||
### Response
|
||||
|
||||
The request contains the following fields:
|
||||
The response contains the following fields:
|
||||
- `response`: LLM response
|
||||
|
||||
## REST service
|
||||
|
|
@ -59,6 +59,7 @@ Request:
|
|||
{
|
||||
"id": "blrqotfefnmnh7de-1",
|
||||
"service": "text-completion",
|
||||
"flow": "default",
|
||||
"request": {
|
||||
"system": "You are a helpful agent",
|
||||
"prompt": "What does NASA stand for?"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ Returned triples will match all of `s`, `p` and `o` where provided.
|
|||
|
||||
### Response
|
||||
|
||||
The request contains the following fields:
|
||||
The response contains the following fields:
|
||||
- `response`: A list of triples.
|
||||
|
||||
Each triple contains `s`, `p` and `o` fields describing the
|
||||
|
|
@ -58,6 +58,7 @@ Request:
|
|||
{
|
||||
"id": "qgzw1287vfjc8wsk-4",
|
||||
"service": "triples-query",
|
||||
"flow": "default",
|
||||
"request": {
|
||||
"s": {
|
||||
"v": "http://trustgraph.ai/e/space-station-modules",
|
||||
|
|
|
|||
|
|
@ -18,13 +18,16 @@ When hosted using docker compose, you can access the service at
|
|||
|
||||
## Request
|
||||
|
||||
A request message is a JSON message containing 3 fields:
|
||||
A request message is a JSON message containing 3/4 fields:
|
||||
|
||||
- `id`: A unique ID which is used to correlate requests and responses.
|
||||
You should make sure it is unique.
|
||||
- `service`: The name of the service to invoke.
|
||||
- `request`: The request body which is passed to the service - this is
|
||||
defined in the API documentation for that service.
|
||||
- `flow`: Some APIs are supported by processors launched within a flow,
|
||||
are are dependent on a flow running. For such APIs, the flow identifier
|
||||
needs to be provided.
|
||||
|
||||
e.g.
|
||||
|
||||
|
|
@ -32,6 +35,7 @@ e.g.
|
|||
{
|
||||
"id": "qgzw1287vfjc8wsk-1",
|
||||
"service": "graph-rag",
|
||||
"flow": "default",
|
||||
"request": {
|
||||
"query": "What does NASA stand for?"
|
||||
}
|
||||
|
|
@ -86,6 +90,7 @@ Request:
|
|||
{
|
||||
"id": "blrqotfefnmnh7de-20",
|
||||
"service": "agent",
|
||||
"flow": "default",
|
||||
"request": {
|
||||
"question": "What does NASA stand for?"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue