-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate tools to docsite (#235)
This migrates the 'tools' documentation to the new docsite.
- Loading branch information
Showing
9 changed files
with
310 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
title: "dgraph-dql" | ||
type: docs | ||
weight: 1 | ||
description: > | ||
A "dgraph-dql" tool executes a pre-defined DQL statement against a Dgraph | ||
database. | ||
--- | ||
|
||
## About | ||
|
||
A ` dgraph-dql` tool executes a pre-defined DQL statement against a Dgraph | ||
database. It's compatible with any of the following sources: | ||
- [dgraph](../sources/dgraph.md) | ||
|
||
To run a statement as a query, you need to set the config `isQuery=true`. For | ||
upserts or mutations, set `isQuery=false`. You can also configure timeout for a | ||
query. | ||
|
||
## Example | ||
|
||
{{< tabpane >}} | ||
{{< tab header="Query" lang="yaml" >}} | ||
|
||
tools: | ||
search_user: | ||
kind: dgraph-dql | ||
source: my-dgraph-source | ||
statement: | | ||
query all($role: string){ | ||
users(func: has(name)) @filter(eq(role, $role) AND ge(age, 30) AND le(age, 50)) { | ||
uid | ||
name | ||
role | ||
age | ||
} | ||
} | ||
isQuery: true | ||
timeout: 20s | ||
description: | | ||
Use this tool to retrieve the details of users who are admins and are between 30 and 50 years old. | ||
The query returns the user's name, email, role, and age. | ||
This can be helpful when you want to fetch admin users within a specific age range. | ||
Example: Fetch admins aged between 30 and 50: | ||
[ | ||
{ | ||
"name": "Alice", | ||
"role": "admin", | ||
"age": 35 | ||
}, | ||
{ | ||
"name": "Bob", | ||
"role": "admin", | ||
"age": 45 | ||
} | ||
] | ||
parameters: | ||
- name: $role | ||
type: string | ||
description: admin | ||
|
||
|
||
{{< /tab >}} | ||
{{< tab header="Mutation" lang="yaml" >}} | ||
|
||
tools: | ||
dgraph-manage-user-instance: | ||
kind: dgraph-dql | ||
source: my-dgraph-source | ||
isQuery: false | ||
statement: | | ||
{ | ||
set { | ||
_:user1 <name> $user1 . | ||
_:user1 <email> $email1 . | ||
_:user1 <role> "admin" . | ||
_:user1 <age> "35" . | ||
|
||
_:user2 <name> $user2 . | ||
_:user2 <email> $email2 . | ||
_:user2 <role> "admin" . | ||
_:user2 <age> "45" . | ||
} | ||
} | ||
description: | | ||
Use this tool to insert or update user data into the Dgraph database. | ||
The mutation adds or updates user details like name, email, role, and age. | ||
Example: Add users Alice and Bob as admins with specific ages. | ||
parameters: | ||
- name: user1 | ||
type: string | ||
description: Alice | ||
- name: email1 | ||
type: string | ||
description: alice@email.com | ||
- name: user2 | ||
type: string | ||
description: Bob | ||
- name: email2 | ||
type: string | ||
description: bob@email.com | ||
|
||
{{< /tab >}} | ||
{{< /tabpane >}} | ||
|
||
## Reference | ||
| **field** | **type** | **required** | **description** | | ||
|-------------|:------------------------------------------:|:------------:|----------------------------------------------------------------------------------------------| | ||
| kind | string | true | Must be "dgraph-dql". | | ||
| source | string | true | Name of the source the dql query should execute on. | | ||
| description | string | true | Description of the tool that is passed to the LLM. | | ||
| statement | string | true | dql statement to execute | | ||
| isQuery | boolean | false | To run statment as query set true otherwise false | | ||
| timeout | string | false | To set timout for query | | ||
| parameters | [parameters](_index#specifying-parameters) | false | List of [parameters](_index#specifying-parameters) that will be used with the dql statement. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
title: "neo4j-cypher" | ||
type: docs | ||
weight: 1 | ||
description: > | ||
A "neo4j-cypher" tool executes a pre-defined cypher statement against a Neo4j | ||
database. | ||
--- | ||
|
||
## About | ||
|
||
A `neo4j-cypher` tool executes a pre-defined Cypher statement against a Neo4j | ||
database. It's compatible with any of the following sources: | ||
- [neo4j](../sources/neo4j.md) | ||
|
||
The specified Cypher statement is executed as a [parameterized | ||
statement][neo4j-parameters], and specified parameters will be used according to | ||
their name: e.g. `$id`. | ||
|
||
[neo4j-parameters]: | ||
https://neo4j.com/docs/cypher-manual/current/syntax/parameters/ | ||
|
||
## Example | ||
|
||
```yaml | ||
tools: | ||
search_movies_by_actor: | ||
kind: neo4j-cypher | ||
source: my-neo4j-movies-instance | ||
statement: | | ||
MATCH (m:Movie)<-[:ACTED_IN]-(p:Person) | ||
WHERE p.name = $name AND m.year > $year | ||
RETURN m.title, m.year | ||
LIMIT 10 | ||
description: | | ||
Use this tool to get a list of movies for a specific actor and a given minium release year. | ||
Takes an full actor name, e.g. "Tom Hanks" and a year e.g 1993 and returns a list of movie titles and release years. | ||
Do NOT use this tool with a movie title. Do NOT guess an actor name, Do NOT guess a year. | ||
A actor name is a fully qualified name with first and last name separated by a space. | ||
For example, if given "Hanks, Tom" the actor name is "Tom Hanks". | ||
If the tool returns more than one option choose the most recent movies. | ||
Example: | ||
{{ | ||
"name": "Meg Ryan", | ||
"year": 1993 | ||
}} | ||
Example: | ||
{{ | ||
"name": "Clint Eastwood", | ||
"year": 2000 | ||
}} | ||
parameters: | ||
- name: name | ||
type: string | ||
description: Full actor name, "firstname lastname" | ||
- name: year | ||
type: integer | ||
description: 4 digit number starting in 1900 up to the current year | ||
``` | ||
## Reference | ||
| **field** | **type** | **required** | **description** | | ||
|-------------|:------------------------------------------:|:------------:|-------------------------------------------------------------------------------------------------| | ||
| kind | string | true | Must be "neo4j-cypher". | | ||
| source | string | true | Name of the source the Cypher query should execute on. | | ||
| description | string | true | Description of the tool that is passed to the LLM. | | ||
| statement | string | true | Cypher statement to execute | | ||
| parameters | [parameters](_index#specifying-parameters) | false | List of [parameters](_index#specifying-parameters) that will be used with the Cypher statement. | | ||
Oops, something went wrong.