PromptLab Introduction
PromptLab is a Raycast extension designed to enhance your workflows with powerful, contextually-aware AI commands. By utilizing placeholders, action scripts, and more, PromptLab allows you to create and share custom commands that can greatly expand the capabilities of Raycast AI. Whether it's extracting information from selected files, summarizing PDFs, or running autonomous agents, PromptLab opens up a new world of possibilities.
PromptLab Features
Custom AI Commands
One of the core features of PromptLab is the ability to create custom AI commands. These commands can be crafted using powerful placeholders such as {{selectedText}}
, {{todayEvents}}
, or {{currentApplication}}
, allowing for a high degree of contextual awareness. This means that your commands can act on the contents of selected files, providing a tailored experience based on your current activities.
Action Scripts
PromptLab also supports "action scripts," which are AppleScripts that run with the AI's response as input. This feature enables you to build complex workflows by using AI as a content provider, navigator, or decision-maker. For instance, you can use action scripts to automate tasks based on the AI's output, creating a seamless integration of intelligence and productivity.
Autonomous Agent Features
The extension includes experimental autonomous agent features that allow the AI to run commands on your behalf. This means that the AI can perform actions such as fetching the latest news or executing a sequence of tasks, all without direct input from you. This feature can be enabled or disabled at any time, giving you full control over how the AI interacts with your workflows.
Advanced Customization
PromptLab offers extensive customization options, including the ability to create custom placeholders using JSON, import/export commands, and save commands as quicklinks with optional input parameters. These features allow you to tailor PromptLab to your specific needs and share your custom commands with others.
Integration with External APIs
PromptLab can obtain data from external APIs, websites, and applications, further enhancing its capabilities. This means you can integrate a wide range of services into your AI commands, allowing for a more powerful and versatile toolset.
PromptLab Top-Level Commands
New PromptLab Command
Create a custom PromptLab command accessible via 'My PromptLab Commands'. This feature allows you to easily add and manage your custom commands.
My PromptLab Commands
Search and run custom PromptLab commands that you've installed or created. This section is your personal command hub, where you can access all your tailored AI commands.
Manage Models
View, edit, add, and delete custom models. This feature gives you control over the AI models you use with PromptLab, allowing for further customization.
PromptLab Command Store
Explore and search commands uploaded to the store by other PromptLab users. Discover new commands and share your own creations with the community.
PromptLab Chat
Start a back-and-forth conversation with AI, with selected files provided as context. The chat feature allows for a more interactive experience with the AI, enabling you to leverage its capabilities in a conversational format.
PromptLab Menu Item
Displays a menu of PromptLab commands in your menu bar for quick access. This feature ensures that your custom commands are always just a click away.
Import PromptLab Commands
Add custom commands from a JSON string. This feature allows for easy sharing and installation of commands from various sources.
PromptLab Placeholders
Placeholders are a key component of PromptLab commands, allowing you to insert relevant information into your prompts. Here are a few examples:
{{clipboardText}}
: The text content of your clipboard.{{selectedFiles}}
: The paths of the files you have selected.{{imageText}}
: Text extracted from the image(s) you have selected.{{lastNote}}
: The HTML of the most recently modified note in the Notes app.{{date format="d MMMM, yyyy"}}
: The current date, optionally specifying a format.
These placeholders can be used to add context to your commands, making them more powerful and adaptable to different situations.
PromptLab Action Scripts
Action scripts in PromptLab allow you to execute AppleScript code once the AI finishes its response. This can be used to automate tasks or integrate with other applications. The following variables and handlers are provided to work with the response text:
Provided Variables
input
: The selected files or text input provided to the command.prompt
: The prompt component of the command that was run.response
: The full response received from the AI.
Provided Handlers
split(theText, theDelimiter)
: Splits text around the specified delimiter.trim(theText)
: Removes leading and trailing spaces from text.replaceAll(theText, textToReplace, theReplacement)
: Replaces all occurrences of a string within the given text.rselect(theArray, numItems)
: Randomly selects the specified number of items from a list.
PromptLab Custom Configuration Fields
When creating a command, you can enable custom configuration fields that must be set before the command can be run. This allows for greater flexibility and reusability of your commands, as others can fill out these fields when they install your shared commands.
PromptLab Chats and Autonomous Agent Features
Chats
The "PromptLab Chat" command enables you to have a conversation with AI, leveraging features like placeholders and selected file contents. Chats are preserved for later reference and can be customized with names, icons, and colors. They can also have "Context Data" associated with them, ensuring the AI stays aware of relevant files and information.
Autonomous Agent Features
When using PromptLab Chat or any command with a chat view, you can enable autonomous agent features. This allows the AI to run commands on your behalf, supplying input as needed to fulfill your queries. For example, asking the AI for the latest news might trigger it to run a command that fetches recent headlines.
PromptLab Custom Model Endpoints
PromptLab allows you to configure a custom model API endpoint, giving you the flexibility to use different AI models according to your needs. You can specify the endpoint URL, API key, input schema, and output key to integrate with various AI services.
Troubleshooting
If you encounter issues with PromptLab, you can try updating to the latest version, adjusting command configurations, or referencing the PromptLab Wiki for solutions. For further assistance, you can create a new issue on GitHub with detailed information about the problem.