Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
emjay07 committed Aug 27, 2024
1 parent 128d7d9 commit f1230dc
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 20 deletions.
20 changes: 13 additions & 7 deletions docs/griptape-cloud/data-sources/index.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
# Data Sources

Use [Data Sources](https://cloud.griptape.ai/data-sources) to connect and ingest your own data for use with your AI code.
Use [Data Sources](https://cloud.griptape.ai/data-sources) to connect and ingest your own data for use with your AI applications via [Knowledge Bases](../knowledge-bases/index.md).

## Create a Data Source

You can [Create a Data Source](https://cloud.griptape.ai/data-sources/create) by specifying the required configuration for your chosen data source.
You can [Create a Data Source](https://cloud.griptape.ai/data-sources/create) by specifying the required configuration for your chosen Data Source.

If you do not see a data source coniguration you'd wish to use, you can submit a request via Discord or `[email protected]`.
If you do not see a data source configuration you'd wish to use, you can submit a request via [Discord](https://discord.gg/gnWRz88eym) or `[email protected]`.

## Refresh a Data Source

By default your Data Source will not refresh automatically. You can enable automatic refresh and specify a CRON expression when creating a Data Source.
### Automatic Refresh

For example, if you wish your Data Source to refresh every day at midnight you can use the following expression: `0 0 * * *`.
By default your Data Source will not refresh automatically. You can enable automatic refresh and specify a [CRON expression](https://crontab.guru/) when creating a Data Source. For example, if you wish your Data Source to refresh every day at midnight you can use the following expression: `0 0 * * *`.

If you wish to manually refresh a data source you can do so either via the `Refresh` button on the UI or by API using the `Data Source ID` on the `Config` tab. You will need a [Griptape Cloud API Key](https://cloud.griptape.ai/configuration/api-keys) to make API calls.
### Manual Refresh

If you wish to manually refresh a data source you can do so either via the `Refresh` button on the UI or by API using the `Data Source ID` on the `Config` tab and a [Griptape Cloud API Key](https://cloud.griptape.ai/configuration/api-keys).

The following shell commands will create a new data refresh job. You will need to specify your API key and data source id.

```shell
curl -H "Authorization: Bearer ${GT_CLOUD_API_KEY}" --json '{}' https://cloud.griptape.ai/api/data-connectors/${data_source_id}/data-jobs
export GT_CLOUD_API_KEY=<your API key here>
export DATA_SOURCE_ID=<your data source id here>
curl -H "Authorization: Bearer ${GT_CLOUD_API_KEY}" --json '{}' https://cloud.griptape.ai/api/data-connectors/${DATA_SOURCE_ID}/data-jobs
```
4 changes: 2 additions & 2 deletions docs/griptape-cloud/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Connect to your data with our [Data Sources](data-sources/index.md) and prepare them for retrieval with [Knowledge Bases](knowledge-bases/index.md).

## Host and Run Your Code
Have custom AI code? You can host your python code using [Structures](structures/index.md) whether it uses the Griptape Framework or not.
Have Griptape code? Have existing code with another LLM framework? You can host your python code using [Structures](structures/index.md) whether it uses the Griptape Framework or not.

## APIs
All of our features can be called via API. See the [API Reference](api/api-reference.md) for detailed information.
All of our features can be called via API with a [Griptape Cloud API Key](https://cloud.griptape.ai/configuration/api-keys). See the [API Reference](api/api-reference.md) for detailed information.
14 changes: 10 additions & 4 deletions docs/griptape-cloud/knowledge-bases/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,26 @@ You can try out both actions from the UI on the `Test` tab of your Knowledge Bas

### From the API

You can enact both `Query` and `Search` via the API by hitting their respective endpoints using a [Griptape Cloud API Key](https://cloud.griptape.ai/configuration/api-keys) and the Knowledge Base ID found on the `Config` tab of your Knowledge Base.
You can enact both `Query` and `Search` via the API by hitting their respective endpoints using a [Griptape Cloud API Key](https://cloud.griptape.ai/configuration/api-keys) and the Knowledge Base ID found on the `Config` tab of your Knowledge Base.

The following example commands will send the query string "test query string" and return the results from the Knowledge Base.

#### Query

```shell
curl -H "Authorization: Bearer ${GT_CLOUD_API_KEY}" --json '{"query": "test query string"}' https://cloud.griptape.ai/api/knowledge-bases/${knowledge-base-id}/query
export GT_CLOUD_API_KEY=<your API key here>
export KNOWLEDGE_BASE_ID=<your knowledge base id here>
curl -H "Authorization: Bearer ${GT_CLOUD_API_KEY}" --json '{"query": "test query string"}' https://cloud.griptape.ai/api/knowledge-bases/${KNOWLEDGE_BASE_ID}/query
```

#### Search

```shell
curl -H "Authorization: Bearer ${GT_CLOUD_API_KEY}" --json '{"query": "test query string"}' https://cloud.griptape.ai/api/knowledge-bases/${knowledge-base-id}/search
export GT_CLOUD_API_KEY=<your API key here>
export KNOWLEDGE_BASE_ID=<your knowledge base id here>
curl -H "Authorization: Bearer ${GT_CLOUD_API_KEY}" --json '{"query": "test query string"}' https://cloud.griptape.ai/api/knowledge-bases/${KNOWLEDGE_BASE_ID}/search
```

### Using the Griptape Framework

You can use [VectorStoreDrivers](../../griptape-framework/drivers/vector-store-drivers/#griptape-cloud-knowledge-base) in the Griptape Framework to run your code.
You can use [VectorStoreDrivers](../../griptape-framework/drivers/vector-store-drivers.md/#griptape-cloud-knowledge-base) to query your Knowledge Base with Griptape.
18 changes: 11 additions & 7 deletions docs/griptape-cloud/structures/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Structures

Use [Structures](https://cloud.griptape.ai/structures) to host any python code in the cloud in seconds.
Use [Structures](https://cloud.griptape.ai/structures) to host any python code in the cloud.

## Create a Structure

1. First [Connect Your GitHub Account](https://cloud.griptape.ai/account)
1. [Connect Your GitHub Account](https://cloud.griptape.ai/account) in your Griptape Cloud account
1. Install the [Griptape Cloud GitHub app](https://github.com/apps/griptape-cloud/installations/new/) to any account or organization you'd like to pull code in from
1. Be sure to allow the app access to `All Repositories` or select the specific repositories you need
- Be sure to allow the app access to `All Repositories` or select the specific repositories you need

You can then [create a Structure](https://cloud.griptape.ai/structures/create) by providing your GitHub repository information. Make sure that your repository has a [Structure Config YAML](structure-config.md).
You can now [create a Structure](https://cloud.griptape.ai/structures/create) by providing your GitHub repository information. Make sure that your repository has a [Structure Config YAML](structure-config.md).

### Quickstart With Samples and Templates

Expand All @@ -31,14 +31,18 @@ input_file.txt

### From the API

You can run your Structure via the API using CURL or any other code that can make HTTP requests. You will need a [Griptape Cloud API Key](https://cloud.griptape.ai/configuration/api-keys) and the `Structure Invocation URL` which is located on the `Config` tab of your Structure.
You can run your Structure via the API using CURL or any other code that can make HTTP requests. You will need a [Griptape Cloud API Key](https://cloud.griptape.ai/configuration/api-keys) and the `Structure Invocation URL` which is located on the `Config` tab of your Structure.

The example below will kick off a run with the args you pass as a json object.

```shell
export GT_CLOUD_API_KEY=<your API key here>
export INVOCATION_URL=<your structure invocation URL>
curl -H "Authorization: Bearer ${GT_CLOUD_API_KEY}" --json '{"args": ["arg1"], "env": {"var1":"value1"}}' ${INVOCATION_URL}
```

For more information on other Structure run APIs, check out the [StructureRuns API docs](api/api-reference/#/StructureRuns).
For more information on other Structure run APIs, check out the [StructureRuns API docs](../api/api-reference.md/#/StructureRuns).

### Using the Griptape Framework

You can use [StructureRunDrivers](../../griptape-framework/drivers/structure-run-drivers/#griptape-cloud) in the Griptape Framework to run your code.
You can use [StructureRunDrivers](../../griptape-framework/drivers/structure-run-drivers.md/#griptape-cloud) to run your Structure with Griptape.

0 comments on commit f1230dc

Please sign in to comment.