Skip to content

Commit

Permalink
Add default AI model setting
Browse files Browse the repository at this point in the history
  • Loading branch information
SKaplanOfficial committed May 26, 2024
1 parent b7e8a4e commit aa4042f
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 40 deletions.
27 changes: 18 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# Pins Changelog

## [Target Groups, Media Track Quick Pins, and Bug Fixes] - 2024-01-12
## [1.8.0 - ] - TBA

- Added support for new Raycast AI models.
- Added setting for configuring the default AI model.
- Added `{{createPin:pinName:pinTarget:pinGroup}}` directive for creating new pins.
- Added `{{deletePin:pinName}}` directive for deleting pins.
- Added `{{launchPin:pinName}}` directive for launching other pins.
- Added `{{launchGroup:groupName}}` directive for launching all pins in a group.

## [1.7.0 - Target Groups, Media Track Quick Pins, and Bug Fixes] - 2024-01-12

- Added ability to quick-add pins to a target group from the menu bar dropdown.
- Added ability to quick-pin tracks in Music, TV, and Spotify.
- Added support for pin tooltips in the menu bar dropdown. (Does not work in current version of Raycast.)
- Use gpt-3.5-turbo-instruct instead of text-davinci-003 for AI placeholder.
- Fixed bug where non-document-based applications that expose an Applescript API could yield an error.

## [Tooltips, Tag Filtering, and New Placeholders] - 2023-12-29
## [1.6.0 - Tooltips, Tag Filtering, and New Placeholders] - 2023-12-29

- Now using the placeholders-toolkit package.
- Added pin tags and tag filtering.
Expand All @@ -21,11 +30,11 @@
- Added link to the Placeholders Guide in the edit pin form header.
- Adjusted behavior of `{{selectedText}}` placeholder to avoid triggering alert sounds each time the menu is opened.

## [Bug fixes] - 2023-11-06
## [1.5.1 - Bug fixes] - 2023-11-06

- Fixed bug where pins with corrupted data from previous versions would cause themselves and others to disappear after editing. (Resolve SKaplanOfficial/Raycast-Pins4)

## [Bug fixes & Quality of Life Improvements] - 2023-11-01
## [1.5.0 - Bug fixes & Quality of Life Improvements] - 2023-11-01

- Added group statistics, viewable when editing a group.
- Added action to create a subgroup of the selected group
Expand All @@ -38,7 +47,7 @@
- Fixed bug where inputting web URLs in the target field would prevent the list of 'Open With' applications from properly updating and leaving only a "None" option.
- Fixed bug where empty groups would still get displayed in the menu bar dropdown.

## [Subgroups, Sorting, Settings, Bug Fixes, and More] - 2023-09-05
## [1.4.0 - Subgroups, Sorting, Settings, Bug Fixes, and More] - 2023-09-05

- Added ability to create subgroups
- Added ability to automatically sort pins using various criteria on a per-group basis
Expand All @@ -59,14 +68,14 @@
- Fixed bug where leaving pin name blank did not use the target as the pin name, despite saying it would
- Fixed bug where the `{{selectedText}}` placeholder caused an alert sound to play if no text was selected

## [Bug fixes] - 2023-06-19
## [1.3.1 - Bug fixes] - 2023-06-19

- Fixed bug where pins without a group would not be treated as valid pins in some cases
- Fixed bug where "Duplicate" action would overwrite the original pin
- Fixed bug where script placeholders resolving to empty strings would show an error when used as the target of a pin
- Changed "New Pin" to default to Favicon / File Icon instead of "None"

## [Pinned Terminal Commands, Placeholders, Pin Expirations, and More] - 2023-06-16
## [1.3.0 - Pinned Terminal Commands, Placeholders, Pin Expirations, and More] - 2023-06-16

- Added per-pin "Open With" setting to allow you to choose which application to open the pin in
- Added per-pin "Expiration Date" setting to automatically remove the pin after a given date & time
Expand All @@ -84,7 +93,7 @@
- Fixed bug where "Pin This Tab" would fail if the tab name contained commas
- Fixed bug where menu bar dropdown would not update after adding pins for the first time

## [Minor Improvements] - 2023-05-22
## [1.1.0 - Minor Improvements] - 2023-05-22

- Added "Preferred Browser" setting to allow you to choose which browser to open links in
- Added support for tilde expansion in paths
Expand All @@ -94,4 +103,4 @@
- Added "Duplicate Pin" action
- When adding a new pin, the icon dropdown will now show the favicon or file icon of the URL/path

## [Initial Version] - 2022-10-05
## [1.0.0 - Initial Version] - 2022-10-05
15 changes: 15 additions & 0 deletions DEVLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

## 1.8.0 Release, TBA

### 2024-05-25

- Added setting for configuring the default AI model.

### 2024-05-07

- Added support for additional models supported by Raycast AI.
- Added `{{deletePin:pinName}}` directive for deleting pins.
- Added `{{createPin:pinName:pinTarget:pinGroup}}` directive for creating new pins.

### 2024-04-24

- Added list item accessory for showing the number of pins "linked" to a pin.
- "Linked" pins are ones that will be launched when the pin is opened.

### 2024-04-23

- Added `{{launchPin:pinName}}` and `{{launchGroup:groupName}}` placeholder directives.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Stephen Kaplan
Copyright (c) 2023-2024 Stephen Kaplan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 7 additions & 3 deletions assets/placeholders_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
------------------------

Author: Stephen Kaplan _(HelloImSteven)_ <br />
Last Updated: 2024-01-12 <br />
Pins Version: 1.7.0
Last Updated: 2024-05-25 <br />
Pins Version: 1.8.0

------------------------

Expand All @@ -26,14 +26,15 @@ Placeholders allow pins to be more dynamic and context-aware. You can use placeh

| Placeholder | Replaced With |
| ----- | ----- |
| `{{AI:...}}` or <br /> `{{AI:...}}` or <br /> `{{askAI:...}}` | The response to a Raycast AI query. Requires Raycast Pro. You can specify the model and creativity using `{{AI model="..." creativity=[decimal]}}`. The default model is `gpt-3.5-turbo` and the default creativity is `1.0`. The model must be either `gpt-3.5-turbo` or `text-davinci-003`. Creativity must be between `0.0` and `1.0`. |
| `{{AI:...}}` or <br /> `{{AI:...}}` or <br /> `{{askAI:...}}` | The response to a Raycast AI query. Requires Raycast Pro. You can specify the model and creativity using `{{AI model="..." creativity=[decimal]}}`. The default model is `OpenAI_GPT3.5-turbo` and the default creativity is `1.0`. The model must be one listed [here](https://developers.raycast.com/api-reference/ai). Creativity must be between `0.0` and `1.0`. |
| `{{alert:...}}` | Displays an alert with the specified text. Specify an optional message and timeout using `{{alert timeout=[number] title="...":...}}`. The default timeout is 10 seconds. |
| `{{as:...}}` or <br /> `{{AS:..}}` | The return value of an AppleScript script. |
| `{{chooseApplication}}` | A quoted POSIX path of an application selected by the user in a file dialog. Use `{{chooseApplication multiple=true}}` to allow the user to select multiple applications. |
| `{{chooseFile}}` | A quoted POSIX path of a file selected by the user in a file dialog. Use `{{chooseFile multiple=true}}` to allow the user to select multiple files. |
| `{{chooseFolder}}` | A quoted POSIX path of a folder selected by the user in a file dialog. Use `{{chooseFolder multiple=true}}` to allow the user to select multiple folders. |
| `{{clipboardText}}` or <br /> `{{clipboard}}` | The current text content of the clipboard. Use `{{clipboardText offsets=[1, 2, 3, n]}}` or `{{clipboardText offsets=[1..n]}}` to get previous clipboard entries. |
| `{{copy:...}}` | Copies the specified text to the clipboard. |
| `{{createPin:[name]:[target]:[group]}}` | Creates a new pin with the specified name, target, and group. |
| `{{currentAppBundleID}}` or <br /> `{{currentAppID}}` or <br /> `{{currentApplicationBundleID}}` or <br /> `{{currentApplicationID}}` | The bundle ID of the frontmost application. |
| `{{currentAppName}}` or <br /> `{{currentApp}}` or <br /> `{{currentApplicationName}}` or <br /> `{{currentApplication}}` | The name of the frontmost application. |
| `{{currentAppPath}}` or <br /> `{{currentApplicationPath}}` | The POSIX path to the bundle of the frontmost application. |
Expand All @@ -43,6 +44,7 @@ Placeholders allow pins to be more dynamic and context-aware. You can use placeh
| `{{date}}` or <br /> `{{currentDate}}` | The current date. Use `{{date format="..."}}` to specify a custom date format. Defaults to `MMMM d, yyyy`. |
| `{{day}}` or <br /> `{{dayName}}` or <br /> `{{currentDay}}` or <br /> `{{currentDayName}}` | The current weekday, e.g. "Monday". Defaults to en-US locale. Use format `{{day locale="xx-XX"}}` to specify a different locale. |
| `{{delete [name]}}` | Deletes the persistent variable with the specified name. |
| `{{deletePin:[pinName or ID]}}` | Deletes the specified pin. |
| `{{dialog:...}}` | Displays a dialog with the specified text. Specify an optional title and timeout using `{{dialog timeout=[number] title="...":Message}}`. The default timeout is 30 seconds. You can accept input by providing `input=true` before the timeout, e.g. `{{dialog input=true timeout=5:Enter a number}}`. |
| `{{file:...}}` | The text content of a path at the specified path. The path can be absolute or relative to the user's home directory using `~/`. |
| `{{get [name]}}` | Gets the value of the persistent variable with the specified name. |
Expand All @@ -54,6 +56,8 @@ Placeholders allow pins to be more dynamic and context-aware. You can use placeh
| `{{input}}` | The text entered by the user in an input dialog. You can specify a prompt using `{{input prompt="..."}}`. |
| `{{js:...}}` or <br /> `{{JS:...}}` | The return value of sandboxed JavaScript code. See [JavaScript Placeholder Reference](#javascript-placeholder-reference) for more information. |
| `{{jxa:...}}` or <br /> `{{JXA:...}}` | The return value of a JXA script. |
| `{{launchGroup:[groupName]}}` | Launches all pins in the specified group. |
| `{{launchPin:[pinName]}}` | Launches the specified pin. |
| `{{paste:...}}` | Pastes the specified text into the frontmost application. |
| `{{pinNames}}` | The comma-separated list of names of all pins, sorted by date last used. Specify an amount of pins to randomly select using `{{pinNames amount=[number]}}`. |
| `{{pins}}` | The JSON representation of all pins. Specify an amount of pins to randomly select using `{{pins amount=[number]}}`. |
Expand Down
46 changes: 31 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 68 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://www.raycast.com/schemas/extension.json",
"name": "pins",
"title": "Pins",
"version": "1.6.0",
"version": "1.8.0",
"description": "Create pins for paths and URLs and display them in the menu bar",
"keywords": [
"pin",
Expand Down Expand Up @@ -234,6 +234,14 @@
"default": true,
"required": false
},
{
"name": "showLinkCount",
"type": "checkbox",
"label": "Show Link Count",
"description": "Whether to show the number of linked pins for each pin",
"default": true,
"required": false
},
{
"name": "showFrequency",
"type": "checkbox",
Expand Down Expand Up @@ -422,12 +430,67 @@
"description": "The browser to use when opening URLs.",
"default": "Safari",
"required": false
},
{
"name": "defaultAIModel",
"title": "Default AI Model",
"type": "dropdown",
"label": "Default AI Model",
"description": "The default AI model to use for the Ask AI directive. Requires access to Raycast AI.",
"default": "OpenAI_GPT3.5-turbo",
"required": false,
"data": [
{
"title": "OpenAI GPT-3.5 Turbo",
"value": "OpenAI_GPT3.5-turbo"
},
{
"title": "OpenAI GPT-4",
"value": "OpenAI_GPT4"
},
{
"title": "OpenAI GPT-4 Turbo",
"value": "OpenAI_GPT4-turbo"
},
{
"title": "OpenAI GPT-4o",
"value": "OpenAI_GPT4o"
},
{
"title": "Anthropic Claude Haiku",
"value": "Anthropic_Claude_Haiku"
},
{
"title": "Anthropic Claude Sonnet",
"value": "Anthropic_Claude_Sonnet"
},
{
"title": "Anthropic Claude Opus",
"value": "Anthropic_Claude_Opus"
},
{
"title": "Perplexity Llama3 Sonar (Small)",
"value": "Perplexity_Llama3_Sonar_Small"
},
{
"title": "Perplexity Llama3 Sonar (Large)",
"value": "Perplexity_Llama3_Sonar_Large"
},
{
"title": "Llama3 70B",
"value": "Llama3_70B"
},
{
"title": "MixtraL 8x7B",
"value": "MixtraL_8x7B"
}
]
}
],
"dependencies": {
"@iarna/toml": "^2.2.5",
"@raycast/api": "^1.64.4",
"@raycast/utils": "^1.10.1",
"@raycast/api": "^1.75.1",
"@raycast/utils": "^1.15.0",
"@types/papaparse": "^5.3.8",
"@types/xml-js": "^1.0.0",
"papaparse": "^5.4.1",
Expand All @@ -440,7 +503,7 @@
"@types/node": "18.18.4",
"@types/react": "18.2.27",
"eslint": "^8.51.0",
"prettier": "^3.0.3",
"prettier": "^3.2.4",
"typescript": "^5.2.2"
},
"scripts": {
Expand All @@ -450,4 +513,4 @@
"lint": "ray lint",
"publish": "ray publish"
}
}
}
1 change: 0 additions & 1 deletion src/components/menu-items/PinMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export default function PinMenuItem(props: {
icon={getPinIcon(pin)}
title={`Edit '${pin.name || (pin.url.length > 20 ? pin.url.substring(0, 19) + "..." : pin.url)}'`}
tooltip={pin.tooltip}
shortcut={pin.shortcut}
onAction={async () =>
launchCommand({ name: "view-pins", type: LaunchType.UserInitiated, context: { pinID: pin.id } })
}
Expand Down
Loading

0 comments on commit aa4042f

Please sign in to comment.