💾 Archived View for gem.sdf.org › s.kaplan › projects › promptlab › promptlab.gmi captured on 2023-09-08 at 16:23:38. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

  ######   ##    ##
 ##    ##  ##   ##
 ##        ##  ##
  ######   #####
       ##  ##  ##
 ##    ##  ##   ##
  ######   ##    ##

PromptLab

Logo

PromptLab is a Raycast extension for creating and sharing powerful, contextually-aware AI commands using placeholders, action scripts, and more.

PromptLab allows you to create custom AI commands with prompts that utilize contextual placeholders such as {{selectedText}}, {{todayEvents}}, or {{currentApplication}} to vastly expand the capabilities of Raycast AI. PromptLab can also extract information from selected files, if you choose, so that it can tell you about the subjects in an image, summarize a PDF, and more.

PromptLab also supports "action scripts" -- AppleScripts which run with the AI's response as input, as well as experimental autonomous agent features that allow the AI to run commands on your behalf. These capabilities, paired with PromptLab's extensive customization options, open a whole new world of possibilities for enhancing your workflows with AI.

Raycast Store Page

My Other Extensions

View on GitHub

Support Development

Feature Overview

Numerous Contextual Placeholders

Analyze Content of Selected Files

Top-Level Commands

Create Your Own Commands

You can create custom PromptLab commands, accessed via the "My PromptLab Commands" command, to execute your own prompts acting on the contents of selected files. A variety of useful defaults are provided, and you can find more in the PromptLab Command Store.

Placeholders

When creating custom commands, you can use placeholders in your prompts that will be substituted with relevant information whenever you run the command. These placeholders range from simple information, like the current date, to complex data retrieval operations such as getting the content of the most recent email or running a sequence of prompts in rapid succession and amalgamating the results. Placeholders are a powerful way to add context to your PromptLab prompts.

A few examples of placeholders are:

Action Scripts

When configuring a PromptLab command, you can provide AppleScript code to execute once the AI finishes its response. You can access the response text via the response variable in AppleScript. Several convenient handlers for working with the response text are also provided, as listed below. Action Scripts can be used to build complex workflows using AI as a content provider, navigator, or decision-maker.

Provided Variables:

Provided Handlers:

Custom Configuration Fields

When creating a command, you can use the Unlock Setup Fields action to enable custom configuration fields that must be set before the command can be run. You'll then be able to use actions to add text fields, boolean (true/false) fields, and/or number fields, providing instructions as you see fit. In your prompt, use the {{config:fieldName}} placeholder, camel-cased, to insert the field's current value. When you share the command to the store and others install it, they'll be prompted to fill out the custom fields before they can run the command. This is a great way to make your commands more flexible and reusable.

Chats

Using the "PromptLab Chat" command, you can chat with AI while making use of features like placeholders and selected file contents. Chat are preserved for later reference or continuation, and you can customize each chat's name, icon, color, and other settings. Chats can have "Context Data" associated with them, ensuring that the LLM stays aware of the files, websites, and other information relevant to your conversation. Within a chat's settings, you can view various statistics highlighting how you've interacted with the AI, and you can export the chat's contents (including the statistics) to JSON for portability.

Autonomous Agent Features

When using PromptLab Chat, or any command that uses a chat view, you can choose to enable autonomous agent features by checking the "Allow AI To Run Commands" checkbox. This will allow the AI to run PromptLab commands on your behalf, supplying input as needed, in order to answer your queries. For example, if you ask the AI "What's the latest news?", it might run the "Recent Headlines From 68k News" command to fulfil your request, then return the results to you. This feature is disabled by default, and can be enabled or disabled at any time.

Custom Model Endpoints

When you first run PromptLab, you'll have the option to configure a custom model API endpoint. If you have access to Raycast AI, you can just leave everything as-is, unless you have a particular need for a different model. You can, of course, adjust the configuration via the Raycast preferences at any time.

To use any arbitrary endpoint, put the endpoint URL in the Model Endpoint preference field and provide your API Key alongside the corresponding Authorization Type. Then, specify the Input Schema in JSON notation, using {prompt} to indicate where PromptLab should input its prompt. Alternatively, you can specify {basePrompt} and {input} separately, for example if you want to provide content for the user and system roles separately when using the OpenAI API. Next, specify the Output Key of the output text within the returned JSON object. If the model endpoint returns a string, rather than a JSON object, leave this field empty. Finally, specify the Output Timing of the model endpoint. If the model endpoint returns the output immediately, select Synchronous. If the model endpoint returns the output asynchronously, select Asynchronous.

OpenAI API Example:

Model Endpoint: https://api.openai.com/v1/chat/completions
Authorization Type: Bearer Token
API Key: Your API key
Input Schema: { "model": "gpt-4", "messages": [{"role": "user", "content": "{prompt}"}], "stream": true }
Output Key Path: choices[0].delta.content
Output Timing: Asynchronous

Anthropic API Example:

Model Endpoint: https://api.anthropic.com/v1/complete
Authorization Type: X-API-Key
API Key: Your API Key
Input Schema: { "prompt": "\n\nHuman: {prompt}\n\nAssistant: ", "model": "claude-instant-v1-100k", "max_tokens_to_sample": 300, "stop_sequences": ["\n\nHuman:"] , "stream": true }
Output Key Path: completion
Output Timing: Asynchronous

Troubleshooting

If you encounter any issues with the extension, you can try the following steps to resolve them:

Output Examples

JPG Text Summarization

MP3 Audio Summarization

Performance Summary

Keynote From File

Useful Resources

Placeholders Guide

PromptLab 1.0.0 Release Image

PromptLab 1.1.0 Release Image

Best Practices for Prompt Engineering with OpenAI API

Brex's Prompt Engineering Guide

Techniques to Improve Reliability

[root]