Docker Labs: GenAI | No. 6

Docker Labs: GenAI | No. 6

Announcing AI Tools for Developers in Docker Desktop

We’ve released a simple way to run AI Tools in Docker Desktop. With the Labs AI Tools for Devs Docker Desktop extension, people who have been asking for a simple way to run prompts can easily get started. If you’re a prompt author, this also allows you to build, run, and share your prompts easier. Here’s how you can get started.

Get the Extension

https://hub.docker.com/extensions/docker/labs-ai-tools-for-devs

Once installed, enter an OpenAI key.

Inputting Project

With our approach, the necessary information a prompt needs should be extractable from a project. Add projects to run prompts against, then select a project to use.

Inputting Prompts

A prompt can be a git ref or a git URL (which will convert to a ref). For prompt authors, you can also add a local folder here. For quickstart, you can use https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/poem as an example prompt.

Writing & Testing Your Own Prompt

Wrap your own tool with a prompt

  1. Scaffolding a prompt folder: Copy an existing prompt from https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts, or create a folder containing README.md, 010_system_prompt.md, 020_user_prompt.md
  2. Populate the user prompt and system prompt files with your own prompt content

010_system_prompt.md

You are an expert in writing poems about Git repositories.        

020_user_prompt.md

My project uses the following languages:

{{#linguist}}
* {{ language }}
{{/linguist}}

My project has the following files:

{{project-facts.files}}

Write me a poem in the style of Supa Hot Fire.        

3. To populate the variables in handlebar templates like `{{project-facts}}`, you can use an extractor or build your own.

---
model: gpt-4
extractors:
??- name: project-facts # Use existing extractor by name (extractors/registry.yml)
??- image: vonwig/extractor-eslint:latest # Use custom extractor
---

This is an example readme!

An extractor is a docker image which returns JSON context.        

4. Add tools in the README front-matter. Existing tools are registered in https://github.com/docker/labs-ai-tools-for-devs/blob/main/functions/registry.yaml, but you can also define your own in the prompt frontmatter:

- name: my_tool
??description: An LLM friendly description of the tool
??parameters:
????type: object
????properties:
??????some_property:
?????? type: array
?????? items:
?????????type: string
?????????description: An LLM friendly description of what each element is
- name: some_existing_tool        

Test

1. Add the folder to a Git repository (not the root) and push to a public remote.

2. Paste the URL for the folder into the extension

3. Run

## Assistant
Uh huh, yeah.
In my repo, with finesse and flow,
.Net, Python, and Java, watch 'em glow.
JS runs on every browser show,
while Swift & Kotlin take mobile on the go.

Files pile up high,
README,.gitignore, they multiply.
Have a .env, secrets lie,
Under .py, codes don’t lie.

(Beatboxes)

Okay, .pdf, you got the lore,
In our .txt, secrets galore,
.json holds the data store,
.css renders that awesome decor.

You got main.c, lines of allure,
From shell scripts, commands so pure.
Don't mess with .xml, the format's secure,
With .md, documentation is the cure.

(Beatboxes)

Git Repo, mvn of my dreams,
Your pull & push, divine it seems.
Cloning bytes, as light as beams,
on the theater of codes, you reign supreme.

(Beatboxes)

But I ain’t a poet.        

As always, feel free to follow along in our new public repo and please reach out. Everything we’ve discussed in this blog post is available for you to try out on your own projects.

For more on what we're doing at Docker, subscribe to our newsletter.

Ezra Ter Linden

Head of Development / System Architect at Immotege GmbH

2 个月

Can wait to give this a whirl!

Abraham Samuel

Startup Founder || Software Engineer || MERN || REST APIs || NextJs || Nest.js || PSQL || Prisma || Chemical and Polymer Engineer (in-view) || Wikipedia Editor

2 个月

I must tell you Docker, Inc , Docker is a pain to windows users, maybe with NestJs, Redis, Psql involved but I can tell you I had to switch to running my applications manually cause I was having constant headaches.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了