Skip to main content

Scripts

Scripts combine AI steps to perform tasks. They are the core of Telosnex, allowing you to automate workflows and interact with AI the way developers do, without writing code.

Scripts Screen

Screenshot showing how to access Scripts Screen from Go button

The Scripts Screen can be accessed from the Go Button on the Companion.

Scripts Screen: A list of Scripts, sorted alphabetically.

Scripts are listed alphabetically. Press to open a Script.

Menu for an individual Script
Press the 3 dots to open a menu for quick access to:

  • Sync: Switch between local and cloud storage. Both are private.
  • Delete: Delete the chat. This cannot be undone. Devices with a synced copy keep it.

Script Library

Script Library button

The Script Library has Scripts built by Telosnex, and other users, that you can download and personalize.

You can reach the Script Library by:

  1. Pressing the Library icon at the top of the Scripts Screen.
  2. Companion > Magic Wand then pressing Library.

Chat and Search Scripts

You should download Chat and Search scripts to get started. Those are used to interact with the AI and search the web.

They come in two sizes, small, like Chat S/Search S, and large, like Chat L/Search L. The small versions are more cost-effective, and the large versions provide more power.

Editing Scripts

After downloading a script, you are taken to a screen where you can see the script's details, and edit it. This is the same screen you see when creating a new script.

Scripts are Yours

Scripts aren't overwritten by changes in the Library. Once you download it, it is yours, so you can customize it.

You can always download the latest version of a Script from the library.

Script Screen

The Script Screen is where you edit and test Scripts. It has three tabs: Info, Code, and Test.

Info

Script Screen Info tab

The Info Tab shows high-level details about your script, such as the name, icon, and description. The description is used when Telosnex's Auto script is selected: the prompt is sent with the script descriptions, and the AI chooses the best script to run.

Test

Script Screen Test tab

The Test tab is where you can run your script to see how it performs. You can enter a prompt and run the script to see the AI's responses. This is useful for testing and debugging your scripts.

Code

Script Screen Code tab

The Code tab is a visual canvas for "coding" Scripts: the code is just prompts. The canvas lets you conntect and arrange them, and combine them with other tools.

The visual canvas lets you effortlessly arrange different components called Script Steps. The 5 step types are:

  1. Dialogue
  2. AI Chat
  3. Search
  4. Retrieve
  5. AI Art
Scripts don't need a Prompt Step

A Dialogue step with the prompt is included when running a script.

1. Dialogue

Script Dialogue step

Dialogue is pre-written text prompts or instructions. It's a versatile step that can be used to set the tone, provide context, or guide the AI assistant's responses. You assign a role to each dialogue step.

Hide dialogue

Hide dialogue steps by pressing the eye icon on a step. This keeps output clean and easy to read: usualy dialogue is just instructions for AI.


You can always tap Show Code from the magic wand to see them. Telosnex is committed to transparency and control.

Roles

Script Roles dropdown menu.

The Dialogue step supports three roles: System, User, and Assistant. Each role serves a distinct purpose:

  • Assistant: This role is for the AI itself. It is useful for priming the AI to generate responses in a specific way. For example, you could write "Here is my answer in 2 short sentences:" to prime the AI to generate a concise response.

  • System: This role allows you to set the overall behavior or personality of the AI assistant for the entire conversation. For example, early ChatGPT used "You are a helpful assistant" as a System message to prime the AI to be supportive and informative.

  • User: The User role represents you, the human participant in the conversation. It is a useful place to give instructions and examples to the AI.

  • Function: An advanced role that you most likely won't use. It represents the result of a function call. Functions calls / tools are an advanced AI feature that Telosnex calls "Structure" on AI Chat. The AI responds with structured data, and the Function role is intended to represent the result of applying that structured data. For example, the structured data might be a search query. The Function role would then represent the search results.

By strategically using these roles, you can create rich, contextual dialogues that mimic real-world conversations. The System message primes the assistant's behavior, the User provides inputs, and the Assistant generates relevant responses.

2. AI Chat

Script AI Chat step
  • Words: Maximum output length. The AI is not aware of the word limit, but it is guaranteed to stop at or before the specified word count. It is useful for limiting costs, or avoiding wasting time on long responses.
  • Temperature: Adjusts the randomness (0 = deterministic, 1 = maximum randomness). Higher temperatures make the responses more surprising and creative, lower temperatures make them more sensible and predictable.
  • Top P: Controls the model's vocabulary diversity. LLMs generate answers token by token: you can think of a token as a word. 1.0 means the LLM will consider every possible token when picking. Lower values, like 0.5, mean the LLM will only consider the top 50% of tokens. This can make the AI more focused and coherent, and also more bland and general.
  • Variable Name: Name the output to reference later in the script using templates.
  • Structure: Ask the AI to generate text in a specific structured format, using a JSON template.
How do Top P and Temperature work together?

The Top P setting determines how many words the AI has to choose from when writing. Temperature controls how random the AI is when choosing from those words.

Script Search step

Perform web searches to retrieve information. - Queries: Text to use as search queries. Each query should be on a separate line. You'll likely want to use the Structure feature to format the search results. See an example in Cookbooks > Search & Retrieval - RAG - Searches: Number of searches to perform. - Results: Number of results to retrieve.

4. Retrieve

Script Retrieve step

Incorporate documents/files into the workflow. An AI on your device scans web pages found from a Search step, and any attached files, and then selects the best matches based on the queries you provide. - Queries: Specify queries or filters - Words: Maximum length of retrieved text

5. AI Art

Script Art step

Generate images using AI models. - Prompt: Text description to generate the image

AI Art Settings

The AI Art step has many more settings: they vary per provider. To set them, press the magic wand icon at the bottom of the screen, then tap the icon with sliders next to the Art provider.

Prompting Techniques

Priming the Context

You can creatively combining roles to set up specific contexts that prime the AI to respond in a particular way. Here's an example workflow:

  1. Dialogue - User: {{prompt}} (note: you don't need to add this step, the prompt is automatically added as the first step when the script is run)
  2. Dialogue - User: Please provide a concise response.
  3. AI Chat: AI provides a concise initial response to acknowledge the request
  4. Dialogue - Assistant: That was my initial answer. To approach this properly, I will first outline the key points, then provide a draft response, and finally deliver a polished answer.
  5. AI Chat: generates an outline, draft response, and final polished answer

In this example, by starting with the User role stating the prompt and requesting conciseness, then transitioning to the Assistant role, we've primed the AI to:

  1. Respond concisely to the initial prompt.
  2. Then, regard that answer as insufficiently detailed. ("That was my initial answer.")
  3. Generate an outline as its first step. ("To approach this properly, I will first outline the key points.")
  4. Draft an initial response based on that outline. ("...then provide a draft response...")
  5. Iteratively refine that draft into a final, high-quality response. ("...and finally deliver a polished answer.")

The strategic use of roles allows you to create customized contexts that guide the AI's behavior and outputs in a particular direction aligned with your goals. AI is more likely to deliver high-quality results when provided with clear, structured instructions and expectations that match how a "real" conversation would unfold.

Templates

Telosnex' templates, powered by Jinja, unlocks Scripts' potential. By naming outputs as variables, you can reference them in subsequent steps.

For example, generate an outline as one variable, then a draft writing sample as another. Feed that draft into a new step to generate a final polished version, all automated within one script.

This iterative approach leverages AI's strengths at each stage, resulting in higher-quality outputs than simply one-shot generation.

Built-in variables include:

  • prompt: The initial prompt provided when the script is run.
  • datetime: The current date and time.

Add variables by setting a "Variable Name" for an AI Chat step.

To reference a variable in later steps, wrap it in {{}} For example, if you name a step "draft", you can reference it in subsequent steps as {{draft}}.

Example: AI Art

AI art providers sometimes rewrite prompts before generation to ensure higher quality. Here's how you can use templating to achieve this:

  1. Dialogue - User: Please rewrite that prompt for an AI art generator. Be extremely verbose and reiterate only a few core concepts, and be verbose for each concept, that way it re-enforces what we want the art generator to latch on to. Think of it like a really cool art history major you know helping write art prompts.
  2. AI Chat, with Variable Name newprompt: AI provides a rewritten prompt.
  3. AI Art, with Prompt {{newprompt}}: AI generates an image based on the new prompt.
info

The (cookbooks/art) page has a detailed example of how to create a script for AI Art.