-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a21f56
commit 79c9ce3
Showing
10 changed files
with
283 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
title: "Other Projects" | ||
--- |
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
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,55 @@ | ||
--- | ||
title: filesystem | ||
--- | ||
|
||
# Description | ||
|
||
Add `read_file` and `write_file` tool containers. | ||
|
||
# Prompt Code | ||
|
||
``` | ||
--- | ||
model: claude-3-5-sonnet-20241022 | ||
tools: | ||
- name: read_file | ||
description: | | ||
read a file from disk | ||
Read the complete contents of a file from the file system. | ||
Handles various text encodings and provides detailed error messages | ||
if the file cannot be read. Use this tool when you need to examine | ||
the contents of a single file. Only works within allowed directories. | ||
parameters: | ||
type: object | ||
properties: | ||
path: | ||
type: string | ||
container: | ||
image: vonwig/bash_alpine | ||
entrypoint: cat | ||
command: | ||
- "{{path|safe}}" | ||
- name: write_file | ||
description: | | ||
Create a new file or completely overwrite an existing file with new content. | ||
Use with caution as it will overwrite existing files without warning. | ||
Handles text content with proper encoding. Only works within allowed directories. | ||
parameters: | ||
type: object | ||
properties: | ||
path: | ||
type: string | ||
content: | ||
type: string | ||
container: | ||
image: vonwig/bash_alpine | ||
command: | ||
- "-c" | ||
- "echo {{content|safe}} > {{path|safe}}" | ||
--- | ||
# prompt user | ||
read the file deps.edn and then write the string "blah.txt" into the file test.txt | ||
``` |
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,30 @@ | ||
--- | ||
title: hello world | ||
--- | ||
|
||
# Description | ||
|
||
Just echo a greeting by running a container! | ||
|
||
# Prompt Code | ||
|
||
```markdown | ||
--- | ||
name: hello-docker | ||
description: run the hello-docker | ||
model: claude-3-5-sonnet-20241022 | ||
tools: | ||
- name: hello-docker | ||
description: print a secret message | ||
container: | ||
image: busybox:latest | ||
command: | ||
- echo | ||
- "Hello, World!" | ||
--- | ||
|
||
# prompt | ||
|
||
Use hello world to print a secret message and then explain it to me | ||
``` | ||
|
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,66 @@ | ||
--- | ||
title: sqlite | ||
--- | ||
|
||
# Description | ||
|
||
Use sqlite containers to provide 3 tools: | ||
|
||
* `read-query` | ||
* `list-tables` | ||
* `describe-table` | ||
|
||
The sqlite database ( /mcp/test1.db ) is mounted using a Docker volume. | ||
|
||
Use these tools to ask Claude to explore the data using the tools above. | ||
|
||
Here's a fully worked | ||
[example](https://github.com/docker/labs-ai-tools-for-devs/blob/main/prompts/examples/mcp-sqlite.md?plain=1) | ||
for building insights from a user defined topic. | ||
|
||
# Prompt Code | ||
|
||
```markdown | ||
--- | ||
tools: | ||
- name: read-query | ||
description: Execute a SELECT query on the SQLite database | ||
parameters: | ||
type: object | ||
properties: | ||
query: | ||
type: string | ||
description: SELECT SQL query to execute | ||
container: &sqlite-container | ||
image: &sqlite-image vonwig/sqlite:latest | ||
command: | ||
- &db "/mcp/test1.db" | ||
- "{{query|safe}}" | ||
volumes: &mounts | ||
- "mcp-test:/mcp" | ||
- name: list-tables | ||
description: List all tables in the SQLite database | ||
container: | ||
image: *sqlite-image | ||
command: | ||
- *db | ||
- "SELECT name from sqlite_master WHERE type='table'" | ||
volumes: *mounts | ||
- name: describe-table | ||
description: Get the schema information for a specific table | ||
parameters: | ||
type: object | ||
properties: | ||
table_name: | ||
type: string | ||
description: Name of the table to describe | ||
container: | ||
image: *sqlite-image | ||
command: | ||
- *db | ||
- "PRAGMA table_info({{table_name}})" | ||
volumes: *mounts | ||
--- | ||
|
||
``` | ||
|
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 |
---|---|---|
@@ -1,49 +1,25 @@ | ||
--- | ||
title: Quick Start w/ VSCode | ||
title: Quick Start w/ Claude Desktop | ||
weight: 1 | ||
--- | ||
|
||
{{% steps %}} | ||
|
||
### Download `.vsix` extension | ||
### Install | ||
|
||
Download the `.vsix` extension from the [releases page](https://github.com/docker/labs-ai-tools-vscode/releases). | ||
[Configure Docker Desktop](../docs/claude-desktop) to use the `mcp/run` Docker container. | ||
|
||
### Install extension from `.vsix` file | ||
### Restart Claude Desktop | ||
|
||
```sh | ||
code --install-extension <path-to-vsix-file> | ||
``` | ||
Restarting desktop should be a one-time activity. However, Claude | ||
Desktop does not support the `tools/list_changed` notification so we | ||
currently have to restart desktop more less continuously. :) | ||
|
||
or use the VSCode command palette `Extensions: Install from VSIX...` | ||
### Try a prompt | ||
|
||
### Open a prompt | ||
With the extension installed, open a prompt in VSCode. Examples can be found in the [examples](https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/examples) directory. | ||
Write a prompt in Claude that will run one of the tools in a registered defintion. | ||
For example: | ||
|
||
### Configure OpenAI API Key, or use a different model. | ||
Default model is `gpt-4` provided by OpenAI. Use an the VSCode command palette `Docker AI: Set secret key` to set your API key. | ||
|
||
**Changing the model:** | ||
Use the following keys in the prompt front-matter to change the model: | ||
|
||
Anthropic: | ||
```yml | ||
--- | ||
url: https://api.anthropic.com | ||
model: claude-3-5-sonnet-20240620 | ||
--- | ||
``` | ||
|
||
|
||
Ollama: | ||
```yml | ||
--- | ||
model: llama3.2 | ||
url: https://docker.host.internal:11434/v1 | ||
--- | ||
``` | ||
|
||
### Run the prompt | ||
Use the VSCode command palette `Docker AI: Run this prompt` to run the prompt. | ||
> Use hello world to send a greeting and then respond to what comes back. | ||
{{% /steps %}} |
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,48 @@ | ||
--- | ||
title: Quick Start w/ VSCode | ||
weight: 1 | ||
--- | ||
|
||
{{% steps %}} | ||
|
||
### Download `.vsix` extension | ||
|
||
Download the `.vsix` extension from the [releases page](https://github.com/docker/labs-ai-tools-vscode/releases). | ||
|
||
### Install extension from `.vsix` file | ||
|
||
```sh | ||
code --install-extension <path-to-vsix-file> | ||
``` | ||
|
||
or use the VSCode command palette `Extensions: Install from VSIX...` | ||
|
||
### Open a prompt | ||
With the extension installed, open a prompt in VSCode. Examples can be found in the [examples](https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/examples) directory. | ||
|
||
### Configure OpenAI API Key, or use a different model. | ||
Default model is `gpt-4` provided by OpenAI. Use an the VSCode command palette `Docker AI: Set secret key` to set your API key. | ||
|
||
**Changing the model:** | ||
Use the following keys in the prompt front-matter to change the model: | ||
|
||
Anthropic: | ||
```yml | ||
--- | ||
model: claude-3-5-sonnet-20240620 | ||
--- | ||
``` | ||
|
||
|
||
Ollama: | ||
```yml | ||
--- | ||
model: llama3.2 | ||
url: https://docker.host.internal:11434/v1 | ||
--- | ||
``` | ||
|
||
### Run the prompt | ||
Use the VSCode command palette `Docker AI: Run this prompt` to run the prompt. | ||
|
||
{{% /steps %}} |