Skip to content

Modify prompt to generate shorter responses #70

@solonovamax

Description

@solonovamax

Would it be possible to modify the prompt to instruct it to generate shorter responses?

I've noticed that altbot tends to generate rather long text, even exceeding the maximum character length of my instance.
From others I've heard that it's best to generate shorter alt text that accurately summarizes the contents of an image when there is a lot of stuff going on in it.

For example, in this post it gave the following suggested alt text:

The image shows a snippet of code written in a programming language, likely Kotlin, with a dark background and yellow text. The code defines a sealed interface named ItemProperty with four data classes: Text, Number, Measure, and Enum. Each data class is annotated with [@]Serializable and includes a val data property, with Number and Measure also having a BigDecimal type. The Measure class includes a unit property and a TODO comment about units of measurement. The Enum class has a TODO comment about a better serializer. The code is structured with proper indentation and uses the sealed keyword to indicate a hierarchy of classes.

The image displays a block of SQL code on a dark background, with the text highlighted in various colors for readability. The code is structured into multiple sections, each defining a different table within a database schema. The tables include:

  1. ITEM_TEXT_PROPERTY: This table has columns for item, name, and value, with item being a foreign key referencing the ITEM table. The name and value columns are TEXT and NOT NULL, respectively. The primary key is defined on the name and item columns.
  2. ITEM_NUMBER_PROPERTY: Similar to ITEM_TEXT_PROPERTY, this table includes item, name, and value columns, with value being NUMERIC and NOT NULL. The primary key is on name and item.
  3. ITEM_MEASURE_PROPERTY: This table introduces a new column unit for storing units of measurement. It also includes item, name, amount, and unit columns, with amount being NUMERIC and NOT NULL. The primary key is on name and item.
  4. ITEM_PROPERTY_ENUM_TYPE: This table defines an enumeration type with id and name columns, where id is a generated identity and name is TEXT and NOT NULL.
  5. ITEM_PROPERTY_ENUM_VALUE: This table includes id, type, and value columns, with id being a generated identity and type referencing ITEM_PROPERTY_ENUM_TYPE. The value column references ITEM_PROPERTY_ENUM_VALUE and includes a check constraint to ensure the value exists in the referenced table.
  6. ITEM_ENUM_PROPERTY: This table combines the previous tables, with item, name, type, and value columns. The type column references ITEM_PROPERTY_ENUM_TYPE, and the value column references ITEM_PROPERTY_ENUM_VALUE. The primary key is on name and item, and a check constraint ensures the value exists in the referenced table.

The code is well-organized, with comments indicating a temporary solution for representing values in different units. The use of ON UPDATE CASCADE and ON DELETE CASCADE ensures that related records are updated or deleted when the referenced records change or are deleted.

the first one is fine I guess, however the second one is almost certainly way too much detail.

The current (english) prompt is (newlines added to aid with reading):

Generate an alt-text description, which is a description for people who can't see the image.
Be sure to talk about the actual contents of it, do not interpret anything.
Start with a general description, then focus on details.
Do it in two steps and show those steps as one text:

perhaps adding something like

If the image is complex or has many different elements, please try to summarize it in around 5 sentences.

could be added on.

Something like this may need to go through a bit of trial and error, but I think that a change to try to get it to generate text that fits into the 5-10 sentences range would be good. (assuming that it uses ~15 words/sentence (it used 16.67 words/sentence in the above text, though this probably isn't representative), 10 sentences is ~750 characters. the top part fits that with only 6 sentences, but the bottom part is 18 sentences)

also perhaps some instructions to get it to avoid using markdown structure like:

  • inline code
  • bold/italics
  • etc.

would be beneficial, as those cannot be included in alt text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions