Skip to content

Conversation

@voodoohop
Copy link
Member

No description provided.

- Set default seed value to 42 for consistency
- Enhance prompt instructions for clarity
- Improve content extraction logic from text
- Ensure generation number is displayed and incremented
@voodoohop voodoohop linked an issue Jan 29, 2025 that may be closed by this pull request
@devloai
Copy link
Contributor

devloai bot commented Jan 29, 2025

Automatic code review is enabled for this repository. Reviewing this PR now.

@mentatbot
Copy link
Contributor

mentatbot bot commented Jan 29, 2025

I'm getting to work. See my steps and track my cost here.

  • Wake on any new activity.

I always see new activity while actively working. When paused, I'll only respond when tagged unless this box is checked.

@github-actions
Copy link
Contributor

🚀 PR Preview deployed!

Preview URL: https://pollinations.github.io/hive/pr-156/

1 similar comment
@github-actions
Copy link
Contributor

🚀 PR Preview deployed!

Preview URL: https://pollinations.github.io/hive/pr-156/

@github-actions
Copy link
Contributor

Testing .mentat

Testing ai-chat

Testing static HTML app: ai-chat

Testing graphics-editor

Testing static HTML app: graphics-editor

Testing llm-feedback

Testing static HTML app: llm-feedback

Testing millionaire-game

Testing static HTML app: millionaire-game

Testing placeholder-generator

Testing Node.js app: placeholder-generator

Installing dependencies



added 274 packages, and audited 275 packages in 10s

109 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

ℹ️ No tests found

Building



> placeholder-generator@0.0.0 build
> vite build

�[36mvite v5.4.14 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 32 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.45 kB�[22m�[1m�[22m�[2m │ gzip:  0.28 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-Xy5EDiQ3.css  �[39m�[1m�[2m  1.25 kB�[22m�[1m�[22m�[2m │ gzip:  0.61 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-BAcusHwb.js   �[39m�[1m�[2m144.97 kB�[22m�[1m�[22m�[2m │ gzip: 46.73 kB�[22m
�[32m✓ built in 838ms�[39m


Testing pollinations-image-show

Testing Node.js app: pollinations-image-show

Installing dependencies



added 315 packages, and audited 316 packages in 12s

119 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


ℹ️ No tests found

Building



> pollinations-image-show@0.0.0 build
> vite build

�[36mvite v6.0.11 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 969 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.46 kB�[22m�[1m�[22m�[2m │ gzip:   0.29 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-Ck1XBn8h.css  �[39m�[1m�[2m  0.56 kB�[22m�[1m�[22m�[2m │ gzip:   0.32 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-tb6_o98D.js   �[39m�[1m�[2m314.28 kB�[22m�[1m�[22m�[2m │ gzip: 104.66 kB�[22m
�[32m✓ built in 2.69s�[39m


Testing prompt-guessing-game

Testing Node.js app: prompt-guessing-game

Installing dependencies



added 61 packages, and audited 62 packages in 2s

7 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


ℹ️ No tests found

Building



> prompt-guessing-game@0.1.0 build
> vite build

�[36mvite v5.4.14 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 33 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.46 kB�[22m�[1m�[22m�[2m │ gzip:  0.29 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-Dcj2S7H_.css  �[39m�[1m�[2m  1.71 kB�[22m�[1m�[22m�[2m │ gzip:  0.76 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-DycsOj9-.js   �[39m�[1m�[2m146.36 kB�[22m�[1m�[22m�[2m │ gzip: 47.33 kB�[22m
�[32m✓ built in 838ms�[39m


Testing svg-feedback

Testing static HTML app: svg-feedback

❌ HTML tests failed for svg-feedback

Testing tarot-reader

Testing Node.js app: tarot-reader

Installing dependencies



added 324 packages, and audited 325 packages in 3s

155 packages are looking for funding
  run `npm fund` for details

1 moderate severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.


ℹ️ No tests found

Building



> tarot-reader@0.0.0 build
> vite build

�[36mvite v6.0.7 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 34 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.56 kB�[22m�[1m�[22m�[2m │ gzip:  0.33 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-tTF554dA.css  �[39m�[1m�[2m  2.48 kB�[22m�[1m�[22m�[2m │ gzip:  1.03 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-BxXiSpNq.js   �[39m�[1m�[2m149.43 kB�[22m�[1m�[22m�[2m │ gzip: 48.71 kB�[22m
�[32m✓ built in 914ms�[39m


Copy link
Contributor

@devloai devloai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed the Game of Life integration changes. There's one important bug fix needed in the text extraction logic - the order of extraction should be reversed to properly handle code blocks before tags. I've also suggested two improvements for better code organization and maintainability: using constants for default values and implementing a more structured approach for model-specific message handling. The changes look good overall and can be merged after addressing these comments, particularly the text extraction fix.

const match = text.match(/```([\s\S]*?)```/);
return match ? match[1] : text;

// Then check for content before </think>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order of extraction should be reversed. Currently, we check for </think> first and then code blocks, but if there's a code block before </think>, we'll miss it. We should check for code blocks first, then fall back to </think> extraction.

Here's how the function should be structured:

function extractDisplayContent(text) {
    // First try to extract content from code blocks
    const codeMatch = text.match(/```([\s\S]*?)```/);
    if (codeMatch) 
        return codeMatch[1];

    // Then check for content before </think>
    const thinkMatch = text.split('</think>');
    if (thinkMatch.length > 1) 
        text = thinkMatch[1].trim();

    // If neither pattern matches, return the original text
    return text;
}

elements.start.textContent = 'Generating...';

let seed = elements.seed.value && elements.seed.value !== '-1' ?
parseInt(elements.seed.value) :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default seed handling could be improved. Instead of hardcoding 42, consider defining it as a constant at the top of the script for better maintainability. Also, the condition could be simplified.

Add this at the top of the script with other constants:

const DEFAULT_SEED = 42;

Then simplify the seed assignment to:

let seed = elements.seed.value ? parseInt(elements.seed.value) : DEFAULT_SEED;

const messages = [
{
const model = getSelectedModel();
const messages = model === 'deepseek-r1' ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The model-specific message structure could be better organized using a configuration object. This would make it easier to add support for more models in the future.

Consider refactoring to use a model configuration object:

const modelConfig = {
    'deepseek-r1': {
        formatMessage: (instructions, state) => [{
            role: "user",
            content: instructions + "\n\n# Current State\n\n" + state
        }]
    },
    'default': {
        formatMessage: (instructions, state) => [{
            role: "system",
            content: instructions
        }, {
            role: "user",
            content: state
        }]
    }
};

// Then use it like this:
const messages = (modelConfig[model] || modelConfig.default)
    .formatMessage(formatInstructions, currentState);

Copy link
Contributor

@mentatbot mentatbot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look well-structured and focused on adding Conway's Game of Life functionality to the llm-feedback app. I have a few observations:

  1. The Game of Life preset is well-designed:

    • Clear rules explanation in the prompt
    • Good initial state visualization
    • Appropriate temperature setting (0.1) for deterministic behavior
  2. Good improvements to text handling:

    • Added support for content after tags
    • Maintained backwards compatibility with code block extraction
    • Fallback to original text if no patterns match
  3. Nice optimization of the seed handling:

    • Changed from random to fixed default (42)
    • Still maintains ability to set custom seeds

There is a test failure in the svg-feedback app, but this is unrelated to your changes as it's a missing styles.css file in that app. This should be addressed separately.

Overall, this looks like a good addition to the llm-feedback app. The changes are focused and well-implemented.

Copy link
Contributor

@mentatbot mentatbot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed the changes and agree with devloai[bot]'s assessment. The three issues identified (text extraction order, default seed constant, and model configuration structure) should be addressed before merging.

The rest of the changes look good, particularly:

  • The Game of Life preset is well-designed with clear rules and visualization
  • The UI changes are clean and maintain consistency with other presets
  • The temperature setting of 0.1 is appropriate for the deterministic nature of Game of Life

Once you've addressed the code organization and bug fix suggestions from devloai[bot], this will be ready to merge.

- Introduce `.state-block` class for styling state displays
- Add iteration labels above each state in the history
- Ensure each state is wrapped in code blocks for clarity
- Improve UI by grouping iteration labels with state blocks
@voodoohop voodoohop merged commit ef1de2e into main Jan 29, 2025
4 of 5 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 29, 2025
@github-actions
Copy link
Contributor

🚀 PR Preview deployed!

Preview URL: https://pollinations.github.io/hive/pr-156/

1 similar comment
@github-actions
Copy link
Contributor

🚀 PR Preview deployed!

Preview URL: https://pollinations.github.io/hive/pr-156/

@github-actions
Copy link
Contributor

Testing .mentat

Testing ai-chat

Testing static HTML app: ai-chat

Testing graphics-editor

Testing static HTML app: graphics-editor

Testing llm-feedback

Testing static HTML app: llm-feedback

Testing millionaire-game

Testing static HTML app: millionaire-game

Testing placeholder-generator

Testing Node.js app: placeholder-generator

Installing dependencies



added 274 packages, and audited 275 packages in 9s

109 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

ℹ️ No tests found

Building



> placeholder-generator@0.0.0 build
> vite build

�[36mvite v5.4.14 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 32 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.45 kB�[22m�[1m�[22m�[2m │ gzip:  0.28 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-Xy5EDiQ3.css  �[39m�[1m�[2m  1.25 kB�[22m�[1m�[22m�[2m │ gzip:  0.61 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-BAcusHwb.js   �[39m�[1m�[2m144.97 kB�[22m�[1m�[22m�[2m │ gzip: 46.73 kB�[22m
�[32m✓ built in 899ms�[39m


Testing pollinations-image-show

Testing Node.js app: pollinations-image-show

Installing dependencies



added 315 packages, and audited 316 packages in 11s

119 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


ℹ️ No tests found

Building



> pollinations-image-show@0.0.0 build
> vite build

�[36mvite v6.0.11 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 969 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.46 kB�[22m�[1m�[22m�[2m │ gzip:   0.29 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-Ck1XBn8h.css  �[39m�[1m�[2m  0.56 kB�[22m�[1m�[22m�[2m │ gzip:   0.32 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-tb6_o98D.js   �[39m�[1m�[2m314.28 kB�[22m�[1m�[22m�[2m │ gzip: 104.66 kB�[22m
�[32m✓ built in 2.69s�[39m


Testing prompt-guessing-game

Testing Node.js app: prompt-guessing-game

Installing dependencies



added 61 packages, and audited 62 packages in 2s

7 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


ℹ️ No tests found

Building



> prompt-guessing-game@0.1.0 build
> vite build

�[36mvite v5.4.14 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 33 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.46 kB�[22m�[1m�[22m�[2m │ gzip:  0.29 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-Dcj2S7H_.css  �[39m�[1m�[2m  1.71 kB�[22m�[1m�[22m�[2m │ gzip:  0.76 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-DycsOj9-.js   �[39m�[1m�[2m146.36 kB�[22m�[1m�[22m�[2m │ gzip: 47.33 kB�[22m
�[32m✓ built in 823ms�[39m


Testing svg-feedback

Testing static HTML app: svg-feedback

❌ HTML tests failed for svg-feedback

Testing tarot-reader

Testing Node.js app: tarot-reader

Installing dependencies



added 324 packages, and audited 325 packages in 3s

155 packages are looking for funding
  run `npm fund` for details

1 moderate severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.


ℹ️ No tests found

Building



> tarot-reader@0.0.0 build
> vite build

�[36mvite v6.0.7 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 34 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.56 kB�[22m�[1m�[22m�[2m │ gzip:  0.33 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-tTF554dA.css  �[39m�[1m�[2m  2.48 kB�[22m�[1m�[22m�[2m │ gzip:  1.03 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-BxXiSpNq.js   �[39m�[1m�[2m149.43 kB�[22m�[1m�[22m�[2m │ gzip: 48.71 kB�[22m
�[32m✓ built in 904ms�[39m


@github-actions
Copy link
Contributor

Testing .mentat

Testing ai-chat

Testing static HTML app: ai-chat

Testing graphics-editor

Testing static HTML app: graphics-editor

Testing llm-feedback

Testing static HTML app: llm-feedback

Testing millionaire-game

Testing static HTML app: millionaire-game

Testing placeholder-generator

Testing Node.js app: placeholder-generator

Installing dependencies



added 274 packages, and audited 275 packages in 8s

109 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

ℹ️ No tests found

Building



> placeholder-generator@0.0.0 build
> vite build

�[36mvite v5.4.14 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 32 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.45 kB�[22m�[1m�[22m�[2m │ gzip:  0.28 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-Xy5EDiQ3.css  �[39m�[1m�[2m  1.25 kB�[22m�[1m�[22m�[2m │ gzip:  0.61 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-BAcusHwb.js   �[39m�[1m�[2m144.97 kB�[22m�[1m�[22m�[2m │ gzip: 46.73 kB�[22m
�[32m✓ built in 801ms�[39m


Testing pollinations-image-show

Testing Node.js app: pollinations-image-show

Installing dependencies



added 315 packages, and audited 316 packages in 11s

119 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


ℹ️ No tests found

Building



> pollinations-image-show@0.0.0 build
> vite build

�[36mvite v6.0.11 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 969 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.46 kB�[22m�[1m�[22m�[2m │ gzip:   0.29 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-Ck1XBn8h.css  �[39m�[1m�[2m  0.56 kB�[22m�[1m�[22m�[2m │ gzip:   0.32 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-tb6_o98D.js   �[39m�[1m�[2m314.28 kB�[22m�[1m�[22m�[2m │ gzip: 104.66 kB�[22m
�[32m✓ built in 2.92s�[39m


Testing prompt-guessing-game

Testing Node.js app: prompt-guessing-game

Installing dependencies



added 61 packages, and audited 62 packages in 2s

7 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


ℹ️ No tests found

Building



> prompt-guessing-game@0.1.0 build
> vite build

�[36mvite v5.4.14 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 33 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.46 kB�[22m�[1m�[22m�[2m │ gzip:  0.29 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-Dcj2S7H_.css  �[39m�[1m�[2m  1.71 kB�[22m�[1m�[22m�[2m │ gzip:  0.76 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-DycsOj9-.js   �[39m�[1m�[2m146.36 kB�[22m�[1m�[22m�[2m │ gzip: 47.33 kB�[22m
�[32m✓ built in 799ms�[39m


Testing svg-feedback

Testing static HTML app: svg-feedback

❌ HTML tests failed for svg-feedback

Testing tarot-reader

Testing Node.js app: tarot-reader

Installing dependencies



added 324 packages, and audited 325 packages in 3s

155 packages are looking for funding
  run `npm fund` for details

1 moderate severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.


ℹ️ No tests found

Building



> tarot-reader@0.0.0 build
> vite build

�[36mvite v6.0.7 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 34 modules transformed.
rendering chunks...
computing gzip size...
�[2mdist/�[22m�[32mindex.html                 �[39m�[1m�[2m  0.56 kB�[22m�[1m�[22m�[2m │ gzip:  0.33 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[35mindex-tTF554dA.css  �[39m�[1m�[2m  2.48 kB�[22m�[1m�[22m�[2m │ gzip:  1.03 kB�[22m
�[2mdist/�[22m�[2massets/�[22m�[36mindex-BxXiSpNq.js   �[39m�[1m�[2m149.43 kB�[22m�[1m�[22m�[2m │ gzip: 48.71 kB�[22m
�[32m✓ built in 881ms�[39m


@github-actions
Copy link
Contributor

🚀 PR Preview deployed!

Preview URL: https://pollinations.github.io/hive/pr-156/

1 similar comment
@github-actions
Copy link
Contributor

🚀 PR Preview deployed!

Preview URL: https://pollinations.github.io/hive/pr-156/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

game of life llm-feedback

2 participants