chore: import upstream snapshot with attribution
CF: Deploy Dev Docs / deploy (push) Has been cancelled
Sync Labels / build (push) Has been cancelled
tests / unit tests (macos-latest) (push) Has been cancelled
tests / unit tests (windows-latest) (push) Has been cancelled
tests / unit tests (ubuntu-latest) (push) Has been cancelled
CF: Deploy Dev Docs / deploy (push) Has been cancelled
Sync Labels / build (push) Has been cancelled
tests / unit tests (macos-latest) (push) Has been cancelled
tests / unit tests (windows-latest) (push) Has been cancelled
tests / unit tests (ubuntu-latest) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Dgraph"
|
||||
weight: 1
|
||||
---
|
||||
@@ -0,0 +1,80 @@
|
||||
---
|
||||
title: "Dgraph Source"
|
||||
linkTitle: "Source"
|
||||
type: docs
|
||||
weight: 1
|
||||
description: >
|
||||
Dgraph is fully open-source, built-for-scale graph database for Gen AI workloads
|
||||
no_list: true
|
||||
---
|
||||
|
||||
{{< notice note >}}
|
||||
**⚠️ Best Effort Maintenance**
|
||||
|
||||
This integration is maintained on a best-effort basis by the project
|
||||
team/community. While we strive to address issues and provide workarounds when
|
||||
resources are available, there are no guaranteed response times or code fixes.
|
||||
|
||||
The automated integration tests for this module are currently non-functional or
|
||||
failing.
|
||||
{{< /notice >}}
|
||||
|
||||
## About
|
||||
|
||||
[Dgraph][dgraph-docs] is an open-source graph database. It is designed for
|
||||
real-time workloads, horizontal scalability, and data flexibility. Implemented
|
||||
as a distributed system, Dgraph processes queries in parallel to deliver the
|
||||
fastest result.
|
||||
|
||||
This source can connect to either a self-managed Dgraph cluster or one hosted on
|
||||
Dgraph Cloud. If you're new to Dgraph, the fastest way to get started is to
|
||||
[sign up for Dgraph Cloud][dgraph-login].
|
||||
|
||||
[dgraph-docs]: https://dgraph.io/docs
|
||||
[dgraph-login]: https://cloud.dgraph.io/login
|
||||
|
||||
|
||||
|
||||
## Available Tools
|
||||
|
||||
{{< list-tools >}}
|
||||
|
||||
## Requirements
|
||||
|
||||
### Database User
|
||||
|
||||
When **connecting to a hosted Dgraph database**, this source uses the API key
|
||||
for access. If you are using a dedicated environment, you will additionally need
|
||||
the namespace and user credentials for that namespace.
|
||||
|
||||
For **connecting to a local or self-hosted Dgraph database**, use the namespace
|
||||
and user credentials for that namespace.
|
||||
|
||||
## Example
|
||||
|
||||
```yaml
|
||||
kind: source
|
||||
name: my-dgraph-source
|
||||
type: dgraph
|
||||
dgraphUrl: https://xxxx.cloud.dgraph.io
|
||||
user: ${USER_NAME}
|
||||
password: ${PASSWORD}
|
||||
apiKey: ${API_KEY}
|
||||
namespace : 0
|
||||
```
|
||||
|
||||
{{< notice tip >}}
|
||||
Use environment variable replacement with the format ${ENV_NAME}
|
||||
instead of hardcoding your secrets into the configuration file.
|
||||
{{< /notice >}}
|
||||
|
||||
## Reference
|
||||
|
||||
| **Field** | **Type** | **Required** | **Description** |
|
||||
|-------------|:--------:|:------------:|--------------------------------------------------------------------------------------------------|
|
||||
| type | string | true | Must be "dgraph". |
|
||||
| dgraphUrl | string | true | Connection URI (e.g. "<https://xxx.cloud.dgraph.io>", "<https://localhost:8080>"). |
|
||||
| user | string | false | Name of the Dgraph user to connect as (e.g., "groot"). |
|
||||
| password | string | false | Password of the Dgraph user (e.g., "password"). |
|
||||
| apiKey | string | false | API key to connect to a Dgraph Cloud instance. |
|
||||
| namespace | uint64 | false | Dgraph namespace (not required for Dgraph Cloud Shared Clusters). |
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Tools"
|
||||
weight: 2
|
||||
---
|
||||
@@ -0,0 +1,135 @@
|
||||
---
|
||||
title: "dgraph-dql"
|
||||
type: docs
|
||||
weight: 1
|
||||
description: >
|
||||
A "dgraph-dql" tool executes a pre-defined DQL statement against a Dgraph
|
||||
database.
|
||||
---
|
||||
|
||||
{{< notice note >}}
|
||||
**⚠️ Best Effort Maintenance**
|
||||
|
||||
This integration is maintained on a best-effort basis by the project
|
||||
team/community. While we strive to address issues and provide workarounds when
|
||||
resources are available, there are no guaranteed response times or code fixes.
|
||||
|
||||
The automated integration tests for this module are currently non-functional or
|
||||
failing.
|
||||
{{< /notice >}}
|
||||
|
||||
## About
|
||||
|
||||
A `dgraph-dql` tool executes a pre-defined DQL statement against a Dgraph
|
||||
database.
|
||||
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.
|
||||
|
||||
> **Note:** This tool uses parameterized queries to prevent SQL injections.
|
||||
> Query parameters can be used as substitutes for arbitrary expressions.
|
||||
> Parameters cannot be used as substitutes for identifiers, column names, table
|
||||
> names, or other parts of the query.
|
||||
|
||||
|
||||
## Compatible Sources
|
||||
|
||||
{{< compatible-sources >}}
|
||||
|
||||
## Example
|
||||
|
||||
{{< tabpane persist="header" >}}
|
||||
{{< tab header="Query" lang="yaml" >}}
|
||||
|
||||
kind: tool
|
||||
name: search_user
|
||||
type: 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
|
||||
email
|
||||
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" >}}
|
||||
|
||||
kind: tool
|
||||
name: dgraph-manage-user-instance
|
||||
type: 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** |
|
||||
|-------------|:---------------------------------------:|:------------:|-------------------------------------------------------------------------------------------|
|
||||
| type | 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 statement as query set true otherwise false |
|
||||
| timeout | string | false | To set timeout for query |
|
||||
| parameters | [parameters](../../../documentation/configuration/tools/_index.md#specifying-parameters) | false | List of [parameters](../../../documentation/configuration/tools/_index.md#specifying-parameters) that will be used with the dql statement. |
|
||||
Reference in New Issue
Block a user