No description
  • JavaScript 77.8%
  • Python 19.5%
  • CSS 2.5%
  • HTML 0.2%
Find a file
hackall360 27063cef25
Some checks failed
Main Branch Delivery / Build and Upload Artifacts (push) Has been cancelled
Main Branch Delivery / Report Build Status (push) Has been cancelled
Main Branch Delivery / Build Tests (core) (push) Has been cancelled
Main Branch Delivery / Build Tests (live models) (push) Has been cancelled
Main Branch Delivery / Build Tests (tts) (push) Has been cancelled
Main Branch Delivery / Build Tests (models export) (push) Has been cancelled
Main Branch Delivery / Build Tests (deep sweep) (push) Has been cancelled
Main Branch Delivery / Deploy to Pages (push) Has been cancelled
Main Branch Delivery / Report Tests Statuses (push) Has been cancelled
fix(openai): avoid JSON mode for OpenAI endpoint; use plain text to prevent 400; maintain streaming SSE without Accept header
2025-09-25 17:34:43 -07:00
.github feat(tts): adaptive first-chunk sizing and render throttle; fix(openai): remove seed from chat payloads; tests(ci): add TTS live + models export and split CI test branches 2025-09-25 14:32:55 -07:00
docs Add rate-limited backoff for PolliLib generation 2025-09-24 13:48:55 -07:00
Libs/pollilib fix(openai): avoid JSON mode for OpenAI endpoint; use plain text to prevent 400; maintain streaming SSE without Accept header 2025-09-25 17:34:43 -07:00
public Adaptive routing: use /seed for unity-family models; keep /openai for others. Add diagnostics logging and SW no-cache for app shell. Update tests accordingly. 2025-09-19 15:12:08 -07:00
src fix(openai): avoid JSON mode for OpenAI endpoint; use plain text to prevent 400; maintain streaming SSE without Accept header 2025-09-25 17:34:43 -07:00
tests tests(live): add openai streaming SSE report and multi-voice TTS paced checks; run deep sweep locally 2025-09-25 15:15:29 -07:00
tools Cache-busting + model routing fixes:\n- Always post chat to /openai with selected model; augment response metadata for alias matching\n- Remove residual token messages; show referrer\n- Add version.json (CI writes) + runtime check to reload on new deploy\n- Add no-cache meta tags\n- Update tests and CI 2025-09-19 11:30:12 -07:00
.gitignore Configure CI workflows and add PolliLib test 2025-09-16 11:22:46 -07:00
.gitmodules Replaced old PolliLib with new version 2025-09-19 10:38:46 -07:00
index.html Adaptive routing: use /seed for unity-family models; keep /openai for others. Add diagnostics logging and SW no-cache for app shell. Update tests accordingly. 2025-09-19 15:12:08 -07:00
index.js Inital Files 2025-09-16 06:59:22 -07:00
package-lock.json feat(markdown): add full Markdown rendering with highlight.js, preserve image links as inline images, and add tests for fenced code blocks 2025-09-21 08:31:43 -07:00
package.json fix(stream): drop Accept: text/event-stream for Pollinations /openai SSE to avoid 4xx/5xx; bump 1.0.8 2025-09-25 15:07:20 -07:00
README.md chore(structure): move core modules to src/lib, add Libs/pollilib import surface, and relocate docs/; keep full backward compatibility 2025-09-20 16:43:56 -07:00
vite.config.mjs Fix Pollinations token env resolution 2025-09-17 04:29:51 -07:00

chatdemo

Static browser demo for interacting with Pollinations using the bundled PolliLib client. The application is built with Vite so it can be deployed to a static host such as GitHub Pages. It features:

Main branch status

Build status Test status

  • Text chat powered by PolliLib's chat() helper.
  • Assistant-guided and manual (/image) Pollinations image generation.
  • Model selector populated from the Pollinations text model catalog.
  • Voice selector paired with an optional playback toggle for text-to-speech responses.
  • Browser voice capture (Web Speech API) with an automatic 0.5 second silence timeout.

Development

npm install
npm run dev

Building for static hosting

npm run build

The generated assets are written to dist/ and can be published as-is. When hosted on GitHub Pages make sure the contents of dist/ are deployed.

Configuring the Pollinations token

Pollinations models that require tiered access expect the token to be supplied as a request parameter. The demo can resolve the token at runtime (via URL parameters, meta tags, or injected globals) and also honours build-time environment variables when you want to bake the token into the bundle.

  • GitHub Pages / production Provide the POLLI_TOKEN secret in the repository (or Pages environment). You can surface the token to the client by setting window.__POLLINATIONS_TOKEN__, defining a <meta name="pollinations-token" content="..."> tag, adding a token=... query parameter to the published URL (e.g. https://example.github.io/chatdemo/?token=your-secret), or injecting POLLI_TOKEN/VITE_POLLI_TOKEN during the build so the token ships with the bundle. The token is removed from the visible URL after it is captured.
  • Local development Define POLLI_TOKEN/VITE_POLLI_TOKEN in your shell when running npm run dev, add a meta tag as above, or inject window.__POLLINATIONS_TOKEN__ before the application bootstraps. Build-time environment variables also work in development.
  • Optional runtime endpoint If you expose the token via a custom endpoint, configure its URL with POLLI_TOKEN_ENDPOINT/VITE_POLLI_TOKEN_ENDPOINT (environment variables), window.__POLLINATIONS_TOKEN_ENDPOINT__, or a <meta name="pollinations-token-endpoint" ...> tag. When present, the client will fetch the token from that endpoint.

If the token cannot be resolved the application continues without one, allowing you to browse public models while gated Pollinations models remain unavailable until a token is supplied.

All chat and image requests automatically include a random eight-digit seed parameter so they match Pollinations' expected request format.

Project structure

  • src/ — app entrypoints and styles; core helpers live under src/lib/.
  • Libs/pollilib/ — compatibility import surface for the bundled PolliLib client.
  • libs/PolliLib/ — vendored PolliLib submodule (JavaScript + Python sources).
  • public/ — static assets served at the web root (e.g. sw.js).
  • tools/ — local build/test utilities invoked by CI and npm scripts.
  • tests/ — self-contained integration tests (run via npm test).
  • reports/ — artifacts from tests and model checks.
  • docs/ — API docs and miscellaneous notes.