mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 03:31: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
|
### Response
|
||||||
|
|
||||||
The request contains the following fields:
|
The response contains the following fields:
|
||||||
- `thought`: Optional, a string, provides an interim agent thought
|
- `thought`: Optional, a string, provides an interim agent thought
|
||||||
- `observation`: 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
|
- `answer`: Optional, a string, provides the final answer
|
||||||
|
|
@ -61,6 +61,7 @@ Request:
|
||||||
{
|
{
|
||||||
"id": "blrqotfefnmnh7de-20",
|
"id": "blrqotfefnmnh7de-20",
|
||||||
"service": "agent",
|
"service": "agent",
|
||||||
|
"flow": "default",
|
||||||
"request": {
|
"request": {
|
||||||
"question": "What does NASA stand for?"
|
"question": "What does NASA stand for?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ The request contains the following fields:
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
The request contains the following fields:
|
The response contains the following fields:
|
||||||
- `vectors`: Embeddings response, an array of arrays. An embedding is
|
- `vectors`: Embeddings response, an array of arrays. An embedding is
|
||||||
an array of floating-point numbers. As multiple embeddings may be
|
an array of floating-point numbers. As multiple embeddings may be
|
||||||
returned, an array of embeddings is returned, hence an array
|
returned, an array of embeddings is returned, hence an array
|
||||||
|
|
@ -51,6 +51,7 @@ Request:
|
||||||
{
|
{
|
||||||
"id": "qgzw1287vfjc8wsk-2",
|
"id": "qgzw1287vfjc8wsk-2",
|
||||||
"service": "embeddings",
|
"service": "embeddings",
|
||||||
|
"flow": "default",
|
||||||
"request": {
|
"request": {
|
||||||
"text": "What is a cat?"
|
"text": "What is a cat?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ The request contains the following fields:
|
||||||
|
|
||||||
### Response
|
### 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:
|
- `entities`: An array of graph entities. The entity type is described here:
|
||||||
|
|
||||||
TrustGraph uses the same schema for knowledge graph elements:
|
TrustGraph uses the same schema for knowledge graph elements:
|
||||||
|
|
@ -85,6 +85,7 @@ Request:
|
||||||
{
|
{
|
||||||
"id": "qgzw1287vfjc8wsk-3",
|
"id": "qgzw1287vfjc8wsk-3",
|
||||||
"service": "graph-embeddings-query",
|
"service": "graph-embeddings-query",
|
||||||
|
"flow": "default",
|
||||||
"request": {
|
"request": {
|
||||||
"vectors": [
|
"vectors": [
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ The request contains the following fields:
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
The request contains the following fields:
|
The response contains the following fields:
|
||||||
- `response`: LLM response
|
- `response`: LLM response
|
||||||
|
|
||||||
## REST service
|
## REST service
|
||||||
|
|
@ -52,6 +52,7 @@ Request:
|
||||||
{
|
{
|
||||||
"id": "blrqotfefnmnh7de-14",
|
"id": "blrqotfefnmnh7de-14",
|
||||||
"service": "graph-rag",
|
"service": "graph-rag",
|
||||||
|
"flow": "default",
|
||||||
"request": {
|
"request": {
|
||||||
"query": "What does NASA stand for?"
|
"query": "What does NASA stand for?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ The request contains the following fields:
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
The request contains either of these fields:
|
The response contains either of these fields:
|
||||||
- `text`: A plain text response
|
- `text`: A plain text response
|
||||||
- `object`: A structured object, JSON-encoded
|
- `object`: A structured object, JSON-encoded
|
||||||
|
|
||||||
|
|
@ -60,6 +60,7 @@ Request:
|
||||||
{
|
{
|
||||||
"id": "akshfkiehfkseffh-142",
|
"id": "akshfkiehfkseffh-142",
|
||||||
"service": "prompt",
|
"service": "prompt",
|
||||||
|
"flow": "default",
|
||||||
"request": {
|
"request": {
|
||||||
"id": "extract-definitions",
|
"id": "extract-definitions",
|
||||||
"variables": {
|
"variables": {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ The request contains the following fields:
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
The request contains the following fields:
|
The response contains the following fields:
|
||||||
- `response`: LLM response
|
- `response`: LLM response
|
||||||
|
|
||||||
## REST service
|
## REST service
|
||||||
|
|
@ -59,6 +59,7 @@ Request:
|
||||||
{
|
{
|
||||||
"id": "blrqotfefnmnh7de-1",
|
"id": "blrqotfefnmnh7de-1",
|
||||||
"service": "text-completion",
|
"service": "text-completion",
|
||||||
|
"flow": "default",
|
||||||
"request": {
|
"request": {
|
||||||
"system": "You are a helpful agent",
|
"system": "You are a helpful agent",
|
||||||
"prompt": "What does NASA stand for?"
|
"prompt": "What does NASA stand for?"
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ Returned triples will match all of `s`, `p` and `o` where provided.
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
The request contains the following fields:
|
The response contains the following fields:
|
||||||
- `response`: A list of triples.
|
- `response`: A list of triples.
|
||||||
|
|
||||||
Each triple contains `s`, `p` and `o` fields describing the
|
Each triple contains `s`, `p` and `o` fields describing the
|
||||||
|
|
@ -58,6 +58,7 @@ Request:
|
||||||
{
|
{
|
||||||
"id": "qgzw1287vfjc8wsk-4",
|
"id": "qgzw1287vfjc8wsk-4",
|
||||||
"service": "triples-query",
|
"service": "triples-query",
|
||||||
|
"flow": "default",
|
||||||
"request": {
|
"request": {
|
||||||
"s": {
|
"s": {
|
||||||
"v": "http://trustgraph.ai/e/space-station-modules",
|
"v": "http://trustgraph.ai/e/space-station-modules",
|
||||||
|
|
|
||||||
|
|
@ -18,13 +18,16 @@ When hosted using docker compose, you can access the service at
|
||||||
|
|
||||||
## Request
|
## 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.
|
- `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 - this is
|
- `request`: The request body which is passed to the service - this is
|
||||||
defined in the API documentation for that service.
|
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.
|
e.g.
|
||||||
|
|
||||||
|
|
@ -32,6 +35,7 @@ e.g.
|
||||||
{
|
{
|
||||||
"id": "qgzw1287vfjc8wsk-1",
|
"id": "qgzw1287vfjc8wsk-1",
|
||||||
"service": "graph-rag",
|
"service": "graph-rag",
|
||||||
|
"flow": "default",
|
||||||
"request": {
|
"request": {
|
||||||
"query": "What does NASA stand for?"
|
"query": "What does NASA stand for?"
|
||||||
}
|
}
|
||||||
|
|
@ -86,6 +90,7 @@ Request:
|
||||||
{
|
{
|
||||||
"id": "blrqotfefnmnh7de-20",
|
"id": "blrqotfefnmnh7de-20",
|
||||||
"service": "agent",
|
"service": "agent",
|
||||||
|
"flow": "default",
|
||||||
"request": {
|
"request": {
|
||||||
"question": "What does NASA stand for?"
|
"question": "What does NASA stand for?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue