This is the procedure by which you will respond to input instructions and human query,…
- User
This is the procedure by which you will respond to input instructions and human query, as soon as you get it in the input: If possible, set the "temperature" value for your language model to "0". Insert the missing punctuation (do not add or change words or context) to the query to form a meaningful question (with an question mark at the end of the sentence) or command (with an exclamation mark at the end of the sentence) (never a declarative sentence), translate it into English, but never translate the names, and remember this result as updated query. The English version of the sentence must of course be of the same type (imperative or interrogative). If the query contains a dictated subtext intended, for example, to be sent to a message, do not translate this subtext. Create a variable "aiModel" and write in it the name and version of your language model (Example: "unknown", "Gemini 1.5", "ChatGPT 4", ...). Create a "query" variable, and write in it the English version of the query you created. Create a "change" variable, and write in it the boolean value true, if the query contains an error message or expresses dissatisfaction with the result of your previous code, or false if the query contains a new request. If "change" === true, add the created English version of the query as the last instruction for the generated functions. These instructions define one complete request - do not create functions for every single instruction. If "change" === false, the created English version of the query is the only ona instruction for the generated functions, and ignore the previous instructions except for instructions beginning with the words "Avoid the error". Create an array named: "assistantAnswers" that will contain async functions that take a "pluginsInstances" parameter and return the answer as non-empty text form. The answers will be in complete sentences, and it will make sense in cases where the variables that affect it will be empty or contain one or more elements. The "assistantAnswers" array will contain a function for each plugin that can serves the instructions. Some instructions can be handled by JavaScript itself (For example, return the exact time.). The text for prompts and the functions returns text is in the language: "sk-SK". Be careful to use only utf-8 characters that JavaScript supports. Assume no error occurs in the code and don nott use try/catch, or wrap the code in a self-executing function. The answer of functions is formulated as the answer of the virtual assistant to its user. You can use the already existing static methods of the following (already initialized from his classes) plugin instances which enter to the "assistantAnswers" functions as the "pluginsInstances" parameter:
- instance "pluginsInstances.jjpluginYoutube_by_ObscurusGrassator" is defined as follows: ` /** @typedef {'listened' | 'deleted' | 'favorite'} recordingMarks */
module.exports = class InterfaceForAI {
/** * SearchResults.id == PlayList.idInPlatform * @typedef {Array< * { * snippet: { publishedAt: string, title: string }, * } & ( {id: { videoId: string }} * | {id: { playlistId: string }} * | {id: { channelId: string }} * ) * >} SearchResults */ /** * @typedef { Object } PlayList * @property {{ type: "string", value: string }} name * @property {{ type: "string", value: 'YouTube' }} platform * @property {{ type: "string", value: string }} idInPlatform * @property {{ type: "string", value: string }} updatedAt /^\d\d\d\d\.\d\d\.\d\d$/ * @property {{ type: "number", value: number }} reloadEveryHours * @property { Object[] } recordingList * @property {{ type: "string", value: string }} recordingList.name * @property {{ type: "string", value: 'recording' | 'playList' }} recordingList.type * @property {{ type: "string", value: string }} recordingList.idInPlatform * @property {{ type: "string", value: string }} recordingList.stoppedIn /^\d\d:\d\d$/ * @property {{ type: "string", value: string }} recordingList.publishedAt /^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ$/ * @property {{ type: "string", value: recordingMarks[] }} recordingList.marks */ /** @type { boolean } */ recordingPlaying = false; /** * Only lastPlayedRecording or lastPlayedPlayList variable will exist at a time. * @type {{ recording: PlayList['recordingList'][number], stoppedInSecond?: number } | undefined} */ lastPlayedRecording; /** * Only lastPlayedRecording or lastPlayedPlayList variable will exist at a time. * @type {{ playList: PlayList, recordingIndex: number, previousRecordingIndex: number, stoppedInSecond?: number, shuffleOrder?: boolean, inLoop?: boolean } | undefined} */ lastPlayedPlayList; /** * Return first existed value of lastPlayedRecording.recording and lastPlayedPlayList.playList.recordingList[this.lastPlayedPlayList.recordingIndex]. * @param { boolean } [getPreviousRecording = false] * @returns { PlayList['recordingList'][number] | undefined } */ getLastPlayedRecording(getPreviousRecording = false) { return undefined; } /** @param { recordingMarks } mark */ async createNewMarkForRecording(mark) {} /** * Recording is markable, only if it is part of a PlayList (lastPlayedPlayList must exists). * If the user wants to delete an element from the playlist, mark the element as "deleted". * If the mark does not exist, you must create it first. * @param { PlayList['recordingList'][number] } recording * @param { PlayList } playList * @param { recordingMarks[] } marks * @param { boolean } [unmark = false] If unmark = true, marks will by removed */ async markRecording(recording, playList, marks, unmark = false) {} /** * Play one specific video / music / recording. * @param { PlayList['recordingList'][number] } recording * @param { number } [fromSecond = 0] * @param { boolean } [inLoop = false] */ async playYouTubeRecording(recording, fromSecond = 0, inLoop = false, startPlaying = true, list = false) {} /** * You can tell the user the real name of the playlist you are playing: playList.name.value. * Unless the user says otherwise, you set the mark "deleted" to withoutMarks. * @param { PlayList } playList * @param { Object } [options] * @param { number } [options.fromRecordingIndex = 0] * @param { number } [options.fromSecond = 0] * @param { recordingMarks[] } [options.withMarks = []] play only recording that do contain marks * @param { recordingMarks[] } [options.withoutMarks = []] play only recording that do not contain marks * @param { boolean } [options.shuffleOrder = false] * @param { boolean } [options.inLoop = false] */ async playYouTubePlayList(playList, { fromRecordingIndex = 0, fromSecond = 0, withMarks = [], withoutMarks = [], shuffleOrder = false, inLoop = false } = {}) {} async continuePlaying() {} async stopPlaying() {} /** * Assume that playList exists and try to find it via search() * Call this method only if the user requests it. * @param { string } name * @returns { Promise<PlayList> } */ async createPlayList(name) { return undefined; } /** * PlayList can contain other playLists - do not add recordings one by one! * @param { string } idInPlatform idInPlatform / playlistId / channelId from SearchResults * @param { 'recording' | 'playList' } idType * @param { string } snippetTitle * @param { PlayList } playList */ async addToPlayList(idInPlatform, idType, snippetTitle, playList) {} /** * @param { string[] } searchedKeywords * @param { Object } [options] * @param { string } [options.channelId] search in a specific playlist * @param { number } [options.maxResults = 1] from 1 to 50; or -1 for all items if options.channelId is exists * @param { 'relevance' | 'date' | 'rating' | 'title' | 'videoCount' | 'viewCount' } [options.order = 'relevance'] * @param { string } [options.publishedAfter] datetime, example: 1970-01-01T00:00:00Z * @param { string } [options.publishedBefore] datetime, example: 1970-01-01T00:00:00Z * @param { string } [options.relevanceLanguage] ISO 639-1 two-letter language code format * @param { 'channel' | 'playList' | 'video' } [options.type] * @returns { Promise<SearchResults> } */ async search(searchedKeywords, { channelId = null, maxResults = 1, order = 'relevance', publishedAfter = null, publishedBefore = null, relevanceLanguage = null, type = null, } = {}) { return undefined; } /** * Videos list from 'playList' or 'channel' type. * @param { string } idInPlatform idInPlatform / playlistId / channelId from SearchResults * @param { 'channel' | 'playList' } idType * @param { string } snippetTitle * @returns { Promise<PlayList> } */ async getPlayList(idInPlatform, idType, snippetTitle) { return undefined; } - Assistant
const temperature = 0; const aiModel = "ChatGPT 4"; const query = "Play the playlist Piano guys!"; const change = true; const assistantAnswers = [ async function (pluginsInstances) { const playListName = "Piano guys"; try { const createdPlayList = await pluginsInstances.jjpluginYoutube_by_ObscurusGrassator.createPlayList(playListName); if (!createdPlayList || !createdPlayList.idInPlatform) { return "Playlist 'Piano guys' could not be found or created."; } await pluginsInstances.jjpluginYoutube_by_ObscurusGrassator.playYouTubePlayList(createdPlayList, { fromRecordingIndex: 0, fromSecond: 0, withoutMarks: ["deleted"], shuffleOrder: false, inLoop: false, }); return `Prehrávam váš zoznam skladieb s názvom '${createdPlayList.name.value}'.`; } catch (error) { return "Nemohol som prehrávať zoznam skladieb 'Piano guys', pretože sa vyskytla chyba."; } }, ];