Pollinations - Text (#3985) * [wip] Pollinations for text * Implement generate API request * Determine Pollinations model tools via models list * Add Pollinations option to /model command * Add Pollinations support to caption * Update link to pollinations site * Fix type errors in openai.js * Fix API connection test to use AbortController for request cancellation * Remove hard coded list of pollinations vision models * Remove openai-audio from captioning models

420d568cd3ee6095bd4235e6f2c78789b38fb791

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
13 files changed, +174 -51Ignore whitespace
public/img/pollinations.svg+1 -0
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" viewBox="83.349 83.3488 333.396 333.395" width="333.396px" height="333.395px"><path d="M 246.799 88.148 C 237.605 99.343 230.641 107.833 225.288 114.438 C 219.934 121.04 216.192 125.76 213.443 129.413 C 210.694 133.068 208.937 135.657 207.555 138.004 C 206.173 140.351 205.166 142.451 203.918 145.134 C 203.529 145.968 203.154 146.767 202.809 147.499 C 202.464 148.229 202.148 148.895 201.878 149.459 C 201.608 150.023 201.384 150.483 201.222 150.812 C 201.06 151.139 200.96 151.332 200.939 151.353 C 200.919 151.375 200.764 151.356 200.506 151.3 C 200.246 151.244 199.879 151.153 199.436 151.037 C 198.991 150.917 198.469 150.773 197.892 150.603 C 197.317 150.436 196.689 150.247 196.036 150.046 C 193.038 149.119 190.766 148.419 188.573 147.896 C 186.381 147.37 184.269 147.017 181.59 146.781 C 178.913 146.546 175.671 146.422 171.216 146.362 C 166.763 146.297 161.1 146.294 153.58 146.292 L 146.676 146.288 L 139.771 146.285 L 132.866 146.285 L 125.963 146.282 L 125.963 161.225 L 125.963 176.168 L 125.963 191.11 L 125.963 206.054 L 124.505 206.222 L 123.043 206.394 L 121.58 206.565 L 120.123 206.739 C 118.48 206.931 116.775 207.193 115.008 207.526 C 113.241 207.858 111.416 208.259 109.537 208.733 C 107.656 209.205 105.722 209.74 103.738 210.348 C 101.755 210.954 99.725 211.627 97.647 212.364 C 96.339 212.83 94.795 213.413 93.208 214.032 C 91.621 214.654 90 215.308 88.538 215.915 C 87.078 216.521 85.78 217.079 84.849 217.507 C 83.916 217.933 83.349 218.228 83.349 218.304 C 83.349 218.42 83.547 218.985 83.877 219.854 C 84.21 220.722 84.681 221.891 85.224 223.212 C 85.766 224.536 86.385 226.012 87.016 227.493 C 87.65 228.973 88.298 230.46 88.895 231.803 C 92.249 239.318 96.203 246.526 100.658 253.31 C 105.109 260.093 110.057 266.454 115.394 272.272 C 120.73 278.09 126.455 283.367 132.461 287.984 C 138.465 292.602 144.751 296.561 151.21 299.743 C 154.416 301.323 157.57 302.733 160.7 303.984 C 163.828 305.234 166.929 306.324 170.027 307.259 C 173.121 308.195 176.211 308.975 179.318 309.607 C 182.422 310.239 185.543 310.723 188.7 311.066 C 191.033 311.319 193.65 311.47 196.411 311.526 C 199.175 311.58 202.086 311.54 205.006 311.41 C 207.923 311.28 210.852 311.059 213.651 310.756 C 216.452 310.453 219.124 310.065 221.53 309.602 C 222.605 309.396 223.636 309.202 224.579 309.032 C 225.521 308.86 226.377 308.712 227.1 308.591 C 227.825 308.472 228.417 308.38 228.834 308.325 C 229.253 308.271 229.495 308.252 229.52 308.277 C 229.639 308.401 229.468 308.844 229.097 309.479 C 228.727 310.113 228.16 310.942 227.484 311.844 C 226.807 312.746 226.024 313.719 225.224 314.643 C 224.423 315.568 223.606 316.443 222.867 317.146 C 221.275 318.657 219.615 319.961 217.836 321.079 C 216.055 322.197 214.155 323.128 212.083 323.891 C 210.01 324.654 207.767 325.248 205.3 325.694 C 202.832 326.139 200.141 326.437 197.175 326.604 C 193.395 326.816 189.994 327.211 186.887 327.829 C 183.779 328.444 180.965 329.279 178.358 330.369 C 175.752 331.46 173.355 332.803 171.08 334.439 C 168.806 336.074 166.656 338 164.545 340.251 C 163.003 341.894 161.632 343.591 160.417 345.379 C 159.202 347.155 158.141 349.036 157.218 351.03 C 156.299 353.03 155.514 355.155 154.851 357.438 C 154.187 359.726 153.647 362.172 153.207 364.827 C 153.04 365.842 152.913 366.599 152.77 367.206 C 152.629 367.806 152.477 368.253 152.26 368.612 C 152.039 368.982 151.76 369.267 151.359 369.577 C 150.959 369.876 150.447 370.191 149.76 370.613 C 146.959 372.322 144.585 374.482 142.688 376.955 C 140.791 379.425 139.371 382.199 138.474 385.12 C 137.578 388.043 137.204 391.112 137.403 394.171 C 137.604 397.235 138.377 400.285 139.767 403.172 C 140.861 405.439 142.364 407.507 144.142 409.321 C 145.922 411.128 147.979 412.675 150.17 413.873 C 152.363 415.081 154.697 415.943 157.03 416.386 C 159.365 416.839 161.698 416.875 163.895 416.418 C 164.949 416.196 166.066 415.865 167.196 415.439 C 168.328 415.022 169.477 414.508 170.59 413.938 C 171.704 413.364 172.786 412.725 173.788 412.048 C 174.788 411.367 175.707 410.655 176.498 409.921 C 178.133 408.414 179.505 406.573 180.589 404.517 C 181.676 402.458 182.476 400.186 182.966 397.809 C 183.455 395.427 183.639 392.941 183.488 390.468 C 183.336 387.983 182.855 385.516 182.015 383.162 C 181.582 381.95 180.935 380.688 180.125 379.438 C 179.315 378.191 178.341 376.955 177.262 375.785 C 176.185 374.625 174.998 373.524 173.755 372.556 C 172.515 371.586 171.22 370.754 169.926 370.097 C 168.776 369.515 167.913 369.078 167.286 368.673 C 166.659 368.268 166.268 367.888 166.061 367.416 C 165.854 366.955 165.831 366.396 165.939 365.633 C 166.049 364.866 166.289 363.903 166.61 362.606 C 167.239 360.073 168.181 357.677 169.396 355.447 C 170.611 353.217 172.097 351.164 173.814 349.33 C 175.528 347.5 177.474 345.885 179.607 344.542 C 181.739 343.195 184.058 342.114 186.521 341.341 C 186.953 341.205 187.6 341.061 188.405 340.918 C 189.209 340.774 190.17 340.632 191.23 340.497 C 192.288 340.361 193.447 340.231 194.643 340.119 C 195.841 340.003 197.079 339.906 198.295 339.827 C 201.179 339.647 203.718 339.414 206.01 339.104 C 208.301 338.796 210.345 338.408 212.239 337.919 C 214.133 337.43 215.877 336.839 217.568 336.12 C 219.258 335.404 220.895 334.56 222.575 333.563 C 224.387 332.489 226.003 331.431 227.5 330.319 C 228.997 329.208 230.375 328.042 231.706 326.75 C 233.036 325.458 234.32 324.041 235.631 322.425 C 236.941 320.811 238.279 318.999 239.716 316.919 L 240.575 315.675 L 241.434 314.431 L 242.295 313.186 L 243.154 311.942 L 243.154 326.201 L 243.154 340.461 L 243.154 354.718 L 243.154 368.982 L 242.045 369.749 L 240.935 370.52 L 239.826 371.287 L 238.717 372.06 C 237.028 373.232 235.59 374.381 234.363 375.574 C 233.136 376.776 232.119 378.012 231.271 379.369 C 230.425 380.723 229.744 382.188 229.194 383.828 C 228.644 385.475 228.221 387.29 227.883 389.357 C 227.479 391.83 227.522 394.366 227.954 396.838 C 228.384 399.312 229.204 401.725 230.354 403.963 C 231.502 406.2 232.982 408.267 234.729 410.037 C 236.476 411.812 238.496 413.299 240.725 414.378 C 242.961 415.451 245.261 416.147 247.564 416.456 C 249.866 416.765 252.172 416.695 254.42 416.259 C 256.67 415.821 258.86 415.016 260.936 413.85 C 263.011 412.685 264.971 411.168 266.752 409.303 C 267.88 408.125 268.805 407.004 269.558 405.869 C 270.312 404.73 270.893 403.56 271.335 402.289 C 271.779 401.005 272.081 399.612 272.276 398.009 C 272.469 396.41 272.555 394.602 272.563 392.497 C 272.57 390.978 272.569 389.795 272.536 388.827 C 272.504 387.847 272.44 387.086 272.323 386.397 C 272.208 385.705 272.038 385.089 271.792 384.412 C 271.547 383.734 271.226 382.997 270.806 382.07 C 270.242 380.813 269.59 379.645 268.853 378.552 C 268.115 377.458 267.292 376.441 266.385 375.504 C 265.476 374.575 264.482 373.72 263.404 372.943 C 262.327 372.17 261.164 371.474 259.918 370.858 L 258.956 370.387 L 257.997 369.912 L 257.034 369.443 L 256.073 368.964 L 256.069 361.769 L 256.067 354.564 L 256.064 347.36 L 256.061 340.163 C 256.059 336.205 256.072 332.439 256.094 329.025 C 256.116 325.612 256.15 322.547 256.192 319.988 C 256.233 317.43 256.282 315.375 256.339 313.979 C 256.395 312.583 256.457 311.846 256.52 311.925 C 256.586 312.001 256.737 312.211 256.957 312.525 C 257.177 312.839 257.463 313.255 257.799 313.747 C 258.134 314.24 258.514 314.803 258.923 315.413 C 259.33 316.023 259.767 316.677 260.21 317.345 C 261.259 318.93 262.251 320.334 263.231 321.608 C 264.21 322.884 265.181 324.03 266.189 325.097 C 267.199 326.165 268.243 327.152 269.376 328.113 C 270.508 329.075 271.726 330.008 273.076 330.964 C 275.237 332.493 277.247 333.763 279.249 334.822 C 281.25 335.88 283.244 336.729 285.372 337.409 C 287.499 338.088 289.763 338.603 292.306 338.994 C 294.847 339.391 297.667 339.661 300.908 339.859 C 302.102 339.933 303.315 340.021 304.482 340.117 C 305.649 340.212 306.771 340.317 307.787 340.422 C 308.804 340.531 309.713 340.637 310.456 340.741 C 311.2 340.842 311.775 340.944 312.123 341.031 C 314.804 341.716 317.399 342.888 319.797 344.43 C 322.195 345.971 324.398 347.874 326.3 350.033 C 328.2 352.182 329.795 354.583 330.987 357.111 C 332.176 359.636 332.954 362.288 333.219 364.942 L 333.311 365.851 L 333.4 366.755 L 333.487 367.664 L 333.577 368.57 L 332.828 368.973 L 332.08 369.369 L 331.331 369.766 L 330.58 370.171 C 328.268 371.397 326.239 372.85 324.51 374.503 C 322.782 376.157 321.349 378.012 320.228 380.046 C 319.108 382.076 318.298 384.294 317.809 386.655 C 317.321 389.026 317.161 391.537 317.332 394.194 C 317.514 396.986 318.125 399.626 319.11 402.047 C 320.093 404.473 321.455 406.682 323.135 408.609 C 324.812 410.535 326.813 412.191 329.079 413.492 C 331.346 414.804 333.877 415.771 336.617 416.34 C 340.253 417.085 343.896 416.704 347.28 415.477 C 350.658 414.247 353.773 412.16 356.353 409.511 C 358.941 406.853 360.988 403.623 362.234 400.105 C 363.484 396.582 363.929 392.762 363.303 388.924 C 362.986 386.999 362.469 385.132 361.769 383.362 C 361.063 381.582 360.179 379.902 359.126 378.334 C 358.078 376.779 356.865 375.337 355.511 374.047 C 354.153 372.762 352.659 371.629 351.044 370.681 C 350.548 370.39 350.073 370.101 349.631 369.823 C 349.186 369.544 348.781 369.287 348.427 369.052 C 348.074 368.816 347.784 368.608 347.563 368.445 C 347.35 368.279 347.213 368.156 347.174 368.089 C 347.136 368.028 347.076 367.839 347.002 367.559 C 346.926 367.279 346.841 366.906 346.738 366.472 C 346.641 366.033 346.533 365.524 346.426 364.982 C 346.319 364.434 346.202 363.845 346.093 363.251 C 345.827 361.805 345.469 360.28 345.026 358.734 C 344.585 357.193 344.07 355.622 343.499 354.103 C 342.926 352.579 342.301 351.092 341.649 349.713 C 340.989 348.331 340.301 347.057 339.606 345.941 C 338.365 343.951 336.881 342.049 335.214 340.264 C 333.55 338.488 331.694 336.833 329.706 335.343 C 327.721 333.854 325.599 332.529 323.396 331.407 C 321.193 330.286 318.908 329.368 316.592 328.692 C 315.968 328.51 315.181 328.325 314.274 328.149 C 313.368 327.97 312.343 327.796 311.24 327.635 C 310.135 327.472 308.952 327.322 307.73 327.188 C 306.509 327.055 305.25 326.938 303.992 326.845 C 302.835 326.758 301.629 326.652 300.44 326.533 C 299.251 326.415 298.077 326.285 296.986 326.151 C 295.893 326.015 294.886 325.877 294.026 325.743 C 293.163 325.608 292.45 325.478 291.951 325.359 C 290.551 325.028 289.144 324.58 287.755 324.032 C 286.368 323.482 284.996 322.832 283.67 322.094 C 282.343 321.357 281.061 320.531 279.845 319.631 C 278.63 318.731 277.484 317.757 276.431 316.723 C 275.528 315.836 274.654 314.903 273.863 313.989 C 273.069 313.075 272.358 312.184 271.778 311.386 C 271.197 310.585 270.749 309.877 270.482 309.33 C 270.215 308.783 270.132 308.398 270.279 308.242 C 270.319 308.199 270.599 308.205 271.069 308.254 C 271.539 308.302 272.201 308.388 273.006 308.512 C 273.81 308.633 274.756 308.789 275.797 308.972 C 276.837 309.155 277.971 309.361 279.151 309.589 C 281.082 309.962 282.663 310.252 284.125 310.478 C 285.586 310.702 286.929 310.864 288.385 310.98 C 289.843 311.095 291.412 311.165 293.33 311.207 C 295.246 311.249 297.507 311.264 300.348 311.27 C 303.731 311.276 306.472 311.257 308.843 311.18 C 311.214 311.103 313.217 310.969 315.118 310.744 C 317.024 310.519 318.828 310.203 320.809 309.766 C 322.789 309.328 324.942 308.768 327.542 308.055 C 332.681 306.644 337.629 304.941 342.407 302.934 C 347.183 300.926 351.786 298.616 356.237 295.996 C 360.679 293.374 364.967 290.442 369.116 287.188 C 373.258 283.937 377.262 280.363 381.138 276.462 C 384.43 273.143 387.487 269.801 390.337 266.384 C 393.193 262.965 395.853 259.47 398.333 255.848 C 400.816 252.227 403.137 248.477 405.327 244.549 C 407.513 240.621 409.562 236.514 411.525 232.177 C 412.561 229.876 413.445 227.881 414.159 226.174 C 414.883 224.465 415.448 223.047 415.864 221.895 C 416.273 220.745 416.543 219.863 416.662 219.23 C 416.79 218.598 416.766 218.215 416.617 218.065 C 416.403 217.855 415.469 217.39 414.106 216.784 C 412.749 216.177 410.956 215.431 409.029 214.662 C 407.111 213.893 405.047 213.1 403.143 212.404 C 401.237 211.7 399.492 211.096 398.191 210.7 C 396.677 210.239 395.049 209.785 393.395 209.353 C 391.728 208.922 390.04 208.513 388.387 208.145 C 386.734 207.78 385.125 207.449 383.627 207.179 C 382.127 206.908 380.746 206.695 379.552 206.553 L 378.67 206.449 L 377.799 206.345 L 376.92 206.242 L 376.049 206.139 L 376.049 191.175 L 376.049 176.209 L 376.049 161.245 L 376.049 146.282 L 369.208 146.288 L 362.377 146.294 L 355.542 146.3 L 348.71 146.305 C 341.359 146.316 335.755 146.325 331.3 146.393 C 326.842 146.461 323.533 146.582 320.775 146.808 C 318.016 147.032 315.807 147.359 313.553 147.835 C 311.298 148.315 308.996 148.944 306.05 149.775 C 305.408 149.956 304.791 150.123 304.223 150.27 C 303.656 150.416 303.14 150.545 302.701 150.646 C 302.263 150.75 301.902 150.821 301.644 150.865 C 301.384 150.909 301.232 150.919 301.208 150.892 C 301.185 150.865 301.079 150.664 300.909 150.329 C 300.739 149.991 300.505 149.516 300.222 148.939 C 299.941 148.362 299.611 147.679 299.251 146.929 C 298.889 146.183 298.499 145.366 298.094 144.516 C 296.849 141.904 295.91 139.934 294.85 138.024 C 293.792 136.115 292.615 134.263 290.896 131.882 C 289.177 129.5 286.916 126.595 283.689 122.568 C 280.463 118.545 276.269 113.409 270.689 106.572 C 266.798 101.8 263.658 97.966 261.13 94.892 C 258.6 91.819 256.681 89.508 255.231 87.798 C 253.782 86.083 252.8 84.967 252.148 84.281 C 251.494 83.597 251.168 83.34 251.03 83.349 C 250.988 83.351 250.839 83.488 250.602 83.734 C 250.365 83.978 250.045 84.33 249.661 84.765 C 249.277 85.2 248.832 85.719 248.346 86.291 C 247.861 86.861 247.338 87.491 246.799 88.148 M 266.415 121.571 C 270.276 126.312 273.576 130.479 276.367 134.164 C 279.161 137.852 281.446 141.053 283.281 143.861 C 285.116 146.665 286.5 149.073 287.489 151.167 C 288.478 153.261 289.071 155.042 289.325 156.6 C 289.391 157.001 289.427 157.324 289.406 157.608 C 289.387 157.891 289.312 158.132 289.156 158.371 C 288.999 158.614 288.764 158.85 288.422 159.121 C 288.081 159.394 287.635 159.704 287.057 160.086 C 286.13 160.701 284.911 161.698 283.538 162.934 C 282.166 164.169 280.642 165.642 279.106 167.213 C 277.57 168.782 276.02 170.446 274.598 172.064 C 273.176 173.682 271.881 175.253 270.852 176.635 C 269.742 178.128 268.593 179.804 267.454 181.582 C 266.313 183.359 265.182 185.239 264.108 187.135 C 263.031 189.033 262.014 190.945 261.098 192.793 C 260.183 194.64 259.372 196.421 258.712 198.054 C 257.763 200.401 256.843 203.065 255.996 205.859 C 255.15 208.65 254.379 211.569 253.725 214.423 C 253.07 217.278 252.534 220.067 252.159 222.599 C 251.786 225.133 251.572 227.407 251.565 229.235 C 251.559 231.007 251.505 232.294 251.409 233.097 C 251.313 233.901 251.172 234.221 250.988 234.059 C 250.805 233.896 250.578 233.251 250.308 232.123 C 250.039 230.997 249.728 229.388 249.375 227.297 C 248.928 224.65 248.419 221.945 247.871 219.288 C 247.324 216.629 246.741 214.02 246.144 211.567 C 245.548 209.108 244.941 206.809 244.349 204.765 C 243.755 202.725 243.176 200.941 242.636 199.525 C 242.096 198.111 241.387 196.463 240.57 194.704 C 239.751 192.947 238.827 191.079 237.856 189.225 C 236.887 187.368 235.876 185.527 234.884 183.818 C 233.891 182.112 232.922 180.542 232.034 179.229 C 231.241 178.051 230.127 176.6 228.825 175.023 C 227.525 173.446 226.04 171.74 224.505 170.059 C 222.969 168.38 221.388 166.72 219.895 165.239 C 218.402 163.755 216.997 162.448 215.818 161.464 C 215.336 161.059 214.877 160.657 214.458 160.269 C 214.038 159.881 213.662 159.514 213.344 159.185 C 213.026 158.855 212.769 158.564 212.591 158.328 C 212.412 158.094 212.315 157.918 212.315 157.821 C 212.315 157.515 212.586 156.721 213.037 155.637 C 213.488 154.55 214.117 153.171 214.832 151.693 C 215.545 150.216 216.346 148.636 217.135 147.152 C 217.926 145.667 218.707 144.278 219.388 143.171 C 220.106 142.009 220.79 140.942 221.523 139.864 C 222.255 138.785 223.035 137.697 223.945 136.49 C 224.854 135.283 225.892 133.959 227.139 132.41 C 228.388 130.863 229.845 129.087 231.591 126.978 C 232.242 126.195 233.071 125.195 234.012 124.055 C 234.953 122.912 236.008 121.635 237.109 120.301 C 238.209 118.966 239.355 117.572 240.481 116.204 C 241.608 114.835 242.714 113.49 243.733 112.249 L 245.587 109.989 L 247.441 107.734 L 249.294 105.474 L 251.148 103.218 L 251.468 103.562 L 251.787 103.908 L 252.107 104.253 L 252.425 104.6 C 252.602 104.789 253.127 105.411 253.925 106.367 C 254.724 107.321 255.795 108.617 257.063 110.156 C 258.33 111.693 259.793 113.476 261.378 115.41 C 262.962 117.344 264.666 119.429 266.415 121.571 M 183.998 160.363 C 185.176 160.625 186.407 160.937 187.616 161.281 C 188.827 161.622 190.016 161.992 191.109 162.365 C 192.203 162.735 193.201 163.112 194.031 163.464 C 194.862 163.817 195.522 164.145 195.942 164.429 C 196.089 164.529 196.193 164.698 196.252 164.982 C 196.308 165.272 196.318 165.679 196.28 166.259 C 196.241 166.839 196.151 167.592 196.008 168.57 C 195.864 169.545 195.668 170.747 195.412 172.22 C 195.151 173.746 194.94 175.096 194.774 176.424 C 194.605 177.758 194.481 179.068 194.391 180.521 C 194.301 181.972 194.241 183.564 194.208 185.453 C 194.172 187.342 194.161 189.528 194.161 192.172 C 194.164 195.029 194.175 197.291 194.21 199.182 C 194.244 201.077 194.306 202.596 194.408 203.967 C 194.511 205.335 194.654 206.558 194.858 207.853 C 195.061 209.146 195.321 210.509 195.658 212.173 C 195.862 213.183 196.089 214.264 196.321 215.352 C 196.555 216.44 196.797 217.535 197.032 218.574 C 197.265 219.613 197.493 220.596 197.7 221.462 C 197.905 222.326 198.091 223.072 198.243 223.638 C 198.394 224.202 198.535 224.745 198.659 225.244 C 198.782 225.742 198.892 226.196 198.979 226.582 C 199.065 226.966 199.132 227.283 199.171 227.509 C 199.212 227.735 199.225 227.868 199.206 227.889 C 199.187 227.907 199.005 227.826 198.692 227.662 C 198.379 227.498 197.934 227.251 197.392 226.94 C 196.848 226.63 196.208 226.256 195.501 225.836 C 194.794 225.418 194.021 224.953 193.218 224.462 C 191.127 223.191 189.283 222.093 187.58 221.118 C 185.876 220.143 184.316 219.291 182.796 218.508 C 181.276 217.728 179.798 217.016 178.258 216.323 C 176.721 215.629 175.121 214.956 173.362 214.247 C 170.717 213.183 168.056 212.21 165.422 211.339 C 162.788 210.463 160.182 209.691 157.644 209.029 C 155.104 208.371 152.636 207.82 150.279 207.395 C 147.925 206.969 145.681 206.665 143.592 206.499 L 142.411 206.402 L 141.228 206.307 L 140.044 206.211 L 138.86 206.118 L 138.86 194.393 L 138.86 182.673 L 138.86 170.946 L 138.86 159.226 L 143.872 159.226 L 148.881 159.228 L 153.894 159.231 L 158.904 159.235 C 163.288 159.238 166.776 159.245 169.604 159.275 C 172.433 159.304 174.608 159.354 176.374 159.432 C 178.138 159.514 179.492 159.621 180.68 159.775 C 181.87 159.924 182.895 160.118 183.998 160.363 M 364.273 182.135 C 364.273 185.703 364.256 188.927 364.232 191.757 C 364.21 194.592 364.168 197.034 364.123 199.037 C 364.073 201.036 364.017 202.602 363.951 203.678 C 363.884 204.753 363.806 205.345 363.72 205.401 C 363.647 205.446 363.37 205.516 362.943 205.606 C 362.51 205.689 361.917 205.788 361.219 205.895 C 360.52 206.004 359.703 206.12 358.815 206.24 C 357.924 206.356 356.965 206.475 355.976 206.593 C 353.857 206.84 351.706 207.169 349.519 207.584 C 347.333 207.998 345.11 208.5 342.841 209.089 C 340.568 209.674 338.248 210.35 335.881 211.113 C 333.508 211.88 331.079 212.734 328.586 213.682 C 326.553 214.453 324.965 215.067 323.583 215.633 C 322.202 216.201 321.032 216.721 319.838 217.313 C 318.643 217.904 317.43 218.565 315.96 219.411 C 314.488 220.256 312.763 221.287 310.551 222.616 C 309.679 223.141 308.838 223.631 308.064 224.069 C 307.29 224.507 306.584 224.894 305.98 225.209 C 305.376 225.524 304.876 225.767 304.515 225.919 C 304.155 226.073 303.935 226.136 303.892 226.09 C 303.846 226.043 303.838 225.853 303.86 225.549 C 303.882 225.248 303.933 224.832 304.011 224.332 C 304.09 223.832 304.193 223.251 304.319 222.615 C 304.443 221.979 304.59 221.291 304.752 220.58 C 305.47 217.443 306.014 215.037 306.432 212.994 C 306.85 210.95 307.141 209.27 307.353 207.569 C 307.562 205.873 307.692 204.161 307.789 202.063 C 307.885 199.964 307.946 197.477 308.022 194.23 C 308.085 191.376 308.129 189.088 308.139 187.161 C 308.15 185.237 308.129 183.672 308.067 182.266 C 308.006 180.861 307.902 179.617 307.75 178.328 C 307.598 177.043 307.396 175.711 307.135 174.134 C 306.71 171.557 306.387 169.65 306.2 168.219 C 306.013 166.785 305.963 165.825 306.087 165.14 C 306.209 164.453 306.505 164.042 307.009 163.705 C 307.512 163.372 308.223 163.115 309.179 162.732 C 311.103 161.968 312.767 161.372 314.532 160.905 C 316.301 160.441 318.17 160.105 320.508 159.868 C 322.849 159.628 325.656 159.482 329.301 159.394 C 332.944 159.308 337.422 159.278 343.102 159.267 L 348.391 159.254 L 353.686 159.245 L 358.977 159.235 L 364.273 159.226 L 364.273 164.952 L 364.273 170.68 L 364.273 176.408 L 364.273 182.135 M 294.672 175.255 C 295.22 178.215 295.627 180.998 295.891 183.706 C 296.156 186.417 296.277 189.05 296.257 191.703 C 296.236 194.356 296.071 197.028 295.763 199.821 C 295.454 202.614 295.003 205.519 294.406 208.644 C 293.797 211.84 293.112 214.843 292.333 217.708 C 291.556 220.571 290.684 223.295 289.702 225.927 C 288.719 228.56 287.624 231.1 286.4 233.599 C 285.175 236.098 283.82 238.555 282.318 241.02 C 281.712 242.01 280.648 243.522 279.328 245.293 C 278.009 247.063 276.436 249.097 274.815 251.131 C 273.192 253.166 271.522 255.203 270.01 256.985 C 268.497 258.766 267.144 260.289 266.154 261.3 L 265.432 262.034 L 264.711 262.769 L 263.989 263.505 L 263.268 264.24 L 263.324 259.533 L 263.381 254.828 L 263.438 250.12 L 263.494 245.413 C 263.544 241.302 263.592 238.027 263.653 235.351 C 263.714 232.674 263.788 230.597 263.886 228.883 C 263.984 227.17 264.11 225.82 264.274 224.597 C 264.438 223.375 264.644 222.28 264.901 221.077 C 265.759 217.074 266.758 213.304 267.919 209.718 C 269.078 206.136 270.399 202.738 271.899 199.486 C 273.402 196.236 275.083 193.128 276.966 190.122 C 278.847 187.116 280.93 184.215 283.231 181.372 C 284.057 180.355 285.031 179.27 286.048 178.218 C 287.064 177.162 288.122 176.139 289.116 175.244 C 290.109 174.346 291.038 173.58 291.794 173.034 C 292.549 172.49 293.134 172.169 293.439 172.169 C 293.53 172.169 293.633 172.257 293.74 172.41 C 293.849 172.568 293.962 172.795 294.074 173.075 C 294.185 173.355 294.296 173.687 294.397 174.058 C 294.5 174.427 294.593 174.834 294.672 175.255 M 214.395 177.903 C 216.932 180.555 219.226 183.303 221.306 186.208 C 223.386 189.113 225.254 192.18 226.941 195.469 C 228.628 198.754 230.134 202.263 231.491 206.056 C 232.848 209.852 234.059 213.927 235.152 218.351 C 235.497 219.75 235.762 220.875 235.967 222.052 C 236.173 223.23 236.32 224.462 236.431 226.076 C 236.542 227.689 236.617 229.684 236.678 232.391 C 236.739 235.098 236.787 238.515 236.843 242.97 C 236.897 247.165 236.932 250.429 236.945 252.96 C 236.956 255.491 236.943 257.287 236.9 258.545 C 236.857 259.805 236.783 260.525 236.67 260.902 C 236.559 261.279 236.409 261.312 236.215 261.199 C 235.931 261.033 235.183 260.258 234.159 259.102 C 233.133 257.946 231.83 256.409 230.435 254.715 C 229.04 253.02 227.55 251.167 226.157 249.385 C 224.763 247.601 223.46 245.887 222.435 244.464 C 221.492 243.154 220.43 241.461 219.336 239.557 C 218.241 237.652 217.115 235.538 216.04 233.384 C 214.966 231.23 213.945 229.037 213.062 226.975 C 212.18 224.913 211.436 222.985 210.915 221.36 C 210.715 220.733 210.491 219.974 210.254 219.14 C 210.019 218.305 209.774 217.396 209.534 216.468 C 209.293 215.536 209.057 214.589 208.838 213.677 C 208.62 212.764 208.422 211.887 208.257 211.105 C 207.734 208.612 207.373 204.972 207.161 200.908 C 206.951 196.847 206.892 192.364 206.97 188.194 C 207.047 184.025 207.261 180.165 207.598 177.346 C 207.937 174.531 208.397 172.757 208.967 172.757 C 209.037 172.757 209.24 172.9 209.55 173.163 C 209.861 173.425 210.276 173.8 210.768 174.267 C 211.26 174.734 211.827 175.29 212.443 175.906 C 213.057 176.521 213.719 177.198 214.395 177.903 M 362.287 222.616 C 362.039 224.822 361.696 226.999 361.25 229.168 C 360.802 231.336 360.258 233.494 359.605 235.661 C 358.949 237.827 358.193 240.002 357.321 242.202 C 356.451 244.402 355.468 246.626 354.373 248.894 C 353.42 250.857 352.54 252.568 351.651 254.143 C 350.761 255.716 349.869 257.152 348.886 258.564 C 347.908 259.976 346.841 261.366 345.604 262.846 C 344.366 264.324 342.963 265.895 341.318 267.67 C 339.751 269.361 338.317 270.826 336.939 272.137 C 335.552 273.447 334.221 274.599 332.854 275.666 C 331.483 276.729 330.076 277.706 328.545 278.66 C 327.016 279.613 325.361 280.546 323.495 281.524 C 321.16 282.75 318.988 283.737 316.707 284.525 C 314.424 285.314 312.031 285.904 309.247 286.342 C 306.462 286.78 303.287 287.064 299.44 287.237 C 295.592 287.414 291.074 287.479 285.605 287.479 L 281.702 287.479 L 277.799 287.479 L 273.896 287.479 L 269.992 287.479 L 270.084 287.147 L 270.176 286.818 L 270.267 286.486 L 270.359 286.155 C 270.515 285.585 271.039 284.472 271.797 283.034 C 272.555 281.597 273.55 279.834 274.654 277.964 C 275.759 276.092 276.971 274.114 278.164 272.243 C 279.357 270.373 280.53 268.61 281.557 267.176 C 286.49 260.272 291.976 254.005 297.894 248.447 C 303.812 242.89 310.161 238.045 316.821 233.98 C 323.478 229.92 330.443 226.642 337.598 224.224 C 344.751 221.805 352.094 220.246 359.505 219.621 C 359.812 219.595 360.119 219.566 360.408 219.538 C 360.702 219.512 360.977 219.484 361.223 219.458 C 361.467 219.431 361.682 219.408 361.848 219.385 C 362.019 219.365 362.146 219.345 362.209 219.333 C 362.27 219.318 362.323 219.401 362.356 219.562 C 362.393 219.721 362.413 219.958 362.42 220.256 C 362.429 220.554 362.42 220.912 362.398 221.311 C 362.377 221.709 362.343 222.151 362.287 222.616 M 127.615 226.441 C 128.292 230.02 129.18 233.67 130.242 237.294 C 131.303 240.92 132.536 244.52 133.907 247.993 C 135.276 251.468 136.779 254.816 138.38 257.942 C 139.98 261.066 141.674 263.97 143.424 266.55 C 144.672 268.387 146.181 270.359 147.856 272.368 C 149.529 274.375 151.367 276.418 153.273 278.395 C 155.18 280.373 157.152 282.285 159.098 284.03 C 161.042 285.778 162.959 287.36 164.749 288.675 C 165.572 289.278 166.345 289.86 167.036 290.395 C 167.727 290.928 168.34 291.415 168.84 291.828 C 169.34 292.244 169.73 292.585 169.977 292.83 C 170.226 293.076 170.333 293.222 170.27 293.245 C 170.079 293.318 169.361 293.128 168.296 292.752 C 167.229 292.375 165.819 291.812 164.242 291.142 C 162.667 290.473 160.928 289.694 159.204 288.884 C 157.485 288.076 155.783 287.236 154.28 286.444 C 148.912 283.61 143.725 280.241 138.787 276.403 C 133.85 272.565 129.161 268.258 124.779 263.552 C 120.398 258.843 116.327 253.735 112.627 248.29 C 108.926 242.846 105.598 237.068 102.705 231.024 C 102.347 230.274 102.01 229.555 101.708 228.897 C 101.405 228.236 101.138 227.636 100.919 227.125 C 100.7 226.615 100.527 226.195 100.416 225.896 C 100.305 225.595 100.254 225.419 100.28 225.393 C 100.305 225.366 100.453 225.299 100.693 225.199 C 100.936 225.098 101.274 224.965 101.685 224.809 C 102.093 224.653 102.577 224.475 103.105 224.282 C 103.634 224.09 104.209 223.883 104.806 223.672 C 106.009 223.25 107.545 222.805 109.237 222.376 C 110.928 221.944 112.775 221.528 114.594 221.164 C 116.416 220.798 118.211 220.485 119.804 220.256 C 121.393 220.028 122.779 219.888 123.781 219.869 L 124.429 219.858 L 125.074 219.846 L 125.721 219.835 L 126.365 219.822 L 126.679 221.477 L 126.992 223.132 L 127.305 224.785 L 127.615 226.441 M 150.401 221.008 C 154.24 221.696 158.178 222.712 162.136 224.018 C 166.097 225.324 170.077 226.921 174.005 228.775 C 177.933 230.628 181.809 232.737 185.555 235.067 C 189.3 237.396 192.918 239.945 196.335 242.681 C 197.475 243.592 198.972 244.936 200.637 246.513 C 202.302 248.09 204.136 249.904 205.952 251.762 C 207.767 253.618 209.561 255.52 211.151 257.272 C 212.738 259.023 214.118 260.626 215.102 261.887 C 216.675 263.902 218.309 266.157 219.896 268.474 C 221.483 270.789 223.022 273.167 224.404 275.429 C 225.787 277.689 227.013 279.833 227.971 281.68 C 228.931 283.527 229.625 285.078 229.943 286.155 L 230.04 286.486 L 230.138 286.818 L 230.234 287.147 L 230.332 287.479 L 226.503 287.477 L 222.673 287.477 L 218.844 287.476 L 215.015 287.475 C 209.688 287.474 205.347 287.414 201.67 287.244 C 197.995 287.073 194.981 286.791 192.311 286.34 C 189.64 285.89 187.313 285.277 185.006 284.44 C 182.7 283.607 180.415 282.551 177.83 281.222 C 174.857 279.694 171.933 277.808 169.117 275.629 C 166.299 273.452 163.592 270.984 161.055 268.292 C 158.521 265.6 156.16 262.686 154.036 259.619 C 151.913 256.549 150.026 253.325 148.439 250.014 C 147.262 247.55 146.142 244.939 145.129 242.32 C 144.116 239.702 143.208 237.077 142.447 234.583 C 141.685 232.09 141.071 229.729 140.647 227.639 C 140.221 225.549 139.987 223.73 139.984 222.322 C 139.984 221.708 139.984 221.246 140.018 220.897 C 140.049 220.548 140.113 220.311 140.234 220.152 C 140.354 219.994 140.534 219.91 140.801 219.868 C 141.068 219.825 141.421 219.822 141.887 219.822 C 142.149 219.822 142.585 219.855 143.15 219.915 C 143.714 219.974 144.405 220.063 145.175 220.169 C 145.948 220.277 146.798 220.405 147.684 220.547 C 148.573 220.689 149.493 220.845 150.401 221.008 M 386.42 221.248 C 387.353 221.423 388.673 221.736 390.135 222.113 C 391.591 222.492 393.193 222.935 394.695 223.376 C 396.202 223.819 397.608 224.256 398.663 224.619 C 399.736 224.982 400.461 225.272 400.609 225.415 C 400.68 225.485 400.53 225.956 400.194 226.725 C 399.861 227.493 399.357 228.559 398.729 229.813 C 398.108 231.071 397.359 232.516 396.542 234.047 C 395.729 235.578 394.837 237.194 393.935 238.788 C 391.085 243.831 387.831 248.73 384.286 253.39 C 380.74 258.048 376.892 262.47 372.836 266.561 C 368.783 270.648 364.517 274.407 360.141 277.739 C 355.761 281.071 351.268 283.979 346.75 286.368 C 345.452 287.056 344.007 287.771 342.554 288.454 C 341.116 289.135 339.666 289.782 338.358 290.338 C 337.05 290.892 335.883 291.352 335 291.658 C 334.116 291.965 333.516 292.119 333.34 292.056 C 333.27 292.032 333.351 291.899 333.557 291.677 C 333.766 291.455 334.099 291.147 334.531 290.774 C 334.964 290.402 335.5 289.964 336.102 289.485 C 336.708 289.004 337.386 288.483 338.112 287.941 C 341.136 285.688 343.974 283.293 346.63 280.752 C 349.291 278.211 351.77 275.522 354.078 272.675 C 356.388 269.829 358.521 266.827 360.496 263.659 C 362.468 260.491 364.28 257.157 365.927 253.651 C 367.035 251.305 368.003 249.097 368.864 246.948 C 369.735 244.801 370.491 242.715 371.167 240.614 C 371.845 238.512 372.436 236.399 372.969 234.196 C 373.503 231.992 373.983 229.7 374.42 227.243 L 374.728 225.536 L 375.036 223.826 L 375.34 222.118 L 375.649 220.411 L 376.434 220.411 L 377.215 220.411 L 378.007 220.411 L 378.79 220.412 C 379.221 220.412 379.759 220.435 380.363 220.477 C 380.966 220.519 381.638 220.582 382.324 220.657 C 383.019 220.733 383.73 220.823 384.425 220.923 C 385.125 221.022 385.801 221.133 386.42 221.248 M 166.406 383.113 C 167.419 383.787 168.276 384.729 168.956 385.829 C 169.636 386.933 170.14 388.194 170.444 389.526 C 170.75 390.856 170.855 392.249 170.74 393.607 C 170.623 394.962 170.287 396.289 169.705 397.491 C 169.275 398.374 168.776 399.155 168.21 399.84 C 167.643 400.526 167.009 401.111 166.308 401.589 C 165.608 402.076 164.842 402.456 164.012 402.74 C 163.182 403.017 162.286 403.196 161.331 403.266 C 160.319 403.339 159.365 403.306 158.461 403.149 C 157.561 402.989 156.714 402.722 155.918 402.326 C 155.12 401.943 154.38 401.436 153.684 400.806 C 152.989 400.182 152.347 399.439 151.749 398.569 C 150.993 397.473 150.484 396.193 150.213 394.844 C 149.94 393.491 149.901 392.061 150.082 390.669 C 150.263 389.281 150.665 387.932 151.269 386.723 C 151.88 385.518 152.69 384.454 153.693 383.652 C 154.574 382.95 155.573 382.409 156.637 382.032 C 157.704 381.652 158.834 381.438 159.969 381.389 C 161.104 381.338 162.25 381.458 163.342 381.743 C 164.433 382.032 165.476 382.487 166.406 383.113 M 345.257 382.546 C 345.746 382.799 346.29 383.216 346.852 383.725 C 347.405 384.236 347.969 384.833 348.486 385.466 C 349.005 386.089 349.475 386.74 349.844 387.357 C 350.214 387.97 350.484 388.541 350.592 389.004 C 350.641 389.209 350.681 389.489 350.711 389.834 C 350.741 390.167 350.758 390.564 350.768 390.987 C 350.78 391.407 350.775 391.861 350.764 392.314 C 350.753 392.762 350.73 393.223 350.694 393.657 C 350.519 395.874 349.727 397.797 348.544 399.335 C 347.358 400.876 345.774 402.039 344.023 402.733 C 342.273 403.416 340.349 403.642 338.478 403.309 C 336.608 402.974 334.783 402.084 333.238 400.552 C 332.63 399.949 332.127 399.371 331.714 398.778 C 331.303 398.185 330.981 397.582 330.739 396.925 C 330.496 396.269 330.327 395.558 330.219 394.757 C 330.11 393.949 330.063 393.055 330.063 392.027 C 330.063 391.002 330.137 390.074 330.287 389.23 C 330.437 388.384 330.669 387.62 330.99 386.92 C 331.313 386.21 331.724 385.565 332.24 384.952 C 332.751 384.338 333.368 383.766 334.095 383.201 C 334.781 382.662 335.614 382.248 336.528 381.942 C 337.445 381.642 338.436 381.46 339.45 381.399 C 340.465 381.338 341.495 381.406 342.484 381.595 C 343.476 381.782 344.419 382.102 345.257 382.546 M 256.549 383.921 C 257.04 384.288 257.567 384.871 258.086 385.576 C 258.603 386.279 259.108 387.117 259.552 387.97 C 259.996 388.827 260.38 389.704 260.654 390.521 C 260.927 391.338 261.089 392.084 261.091 392.668 C 261.093 393.424 260.884 394.317 260.52 395.267 C 260.156 396.208 259.636 397.208 259.024 398.158 C 258.412 399.112 257.705 400.024 256.963 400.796 C 256.221 401.575 255.444 402.216 254.691 402.622 C 253.829 403.093 252.859 403.383 251.845 403.496 C 250.833 403.619 249.778 403.563 248.745 403.359 C 247.713 403.153 246.705 402.789 245.785 402.286 C 244.865 401.776 244.035 401.126 243.361 400.348 C 242.582 399.455 241.949 398.455 241.467 397.409 C 240.988 396.359 240.659 395.258 240.488 394.145 C 240.317 393.027 240.304 391.897 240.457 390.794 C 240.607 389.696 240.924 388.62 241.412 387.617 C 241.927 386.563 242.454 385.689 243.041 384.979 C 243.624 384.273 244.264 383.725 245.007 383.317 C 245.748 382.912 246.591 382.65 247.577 382.499 C 248.565 382.347 249.696 382.312 251.015 382.365 C 251.715 382.396 252.322 382.44 252.859 382.506 C 253.397 382.575 253.866 382.662 254.293 382.784 C 254.72 382.906 255.104 383.052 255.472 383.239 C 255.839 383.435 256.189 383.652 256.549 383.921" fill-rule="evenodd" id="object-1" transform="matrix(1, 0, 0, 1, 1.4210854715202004e-14, 0)" style="stroke-opacity: 0;"></path></svg>
1 \ No newline at end of file
public/index.html+21 -5
@@ -974,7 +974,7 @@
974974 </div>
975975 </div>
976976 </div>
977977 <div class="range-block" data-source="openai,openrouter,mistralai,custom,cohere,groq,nanogpt,xai,pollinations">
978978 <div class="range-block-title justifyLeft" data-i18n="Seed">
979979 Seed
980980 </div>
@@ -1977,7 +1977,7 @@
19771977 </b>
19781978 </div>
19791979 </div>
19801980 <div class="range-block" data-source="openai,cohere,mistralai,custom,claude,openrouter,groq,deepseek,makersuite,ai21,xai,pollinations">
19811981 <label for="openai_function_calling" class="checkbox_label flexWrap widthFreeExpand">
19821982 <input id="openai_function_calling" type="checkbox" />
19831983 <span data-i18n="Enable function calling">Enable function calling</span>
@@ -1987,7 +1987,7 @@
19871987 <span data-i18n="enable_functions_desc_3">Can be utilized by various extensions to provide additional functionality.</span>
19881988 </div>
19891989 </div>
19901990 <div class="range-block" data-source="openai,openrouter,mistralai,makersuite,claude,custom,01ai,xai,pollinations">
19911991 <label for="openai_image_inlining" class="checkbox_label flexWrap widthFreeExpand">
19921992 <input id="openai_image_inlining" type="checkbox" />
19931993 <span data-i18n="Send inline images">Send inline images</span>
@@ -1999,7 +1999,7 @@
19991999 <code><i class="fa-solid fa-wand-magic-sparkles"></i></code>
20002000 <span data-i18n="image_inlining_hint_3">menu to attach an image file to the chat.</span>
20012001 </div>
20022002 <div class="flex-container flexFlowColumn wide100p textAlignCenter marginTop10" data-source="openai,custom,xai,pollinations">
20032003 <div class="flex-container oneline-dropdown">
20042004 <label for="openai_inline_image_quality" data-i18n="Inline Image Quality">
20052005 Inline Image Quality
@@ -2057,7 +2057,7 @@
20572057 </span>
20582058 </div>
20592059 </div>
20602060 <div class="flex-container flexFlowColumn wide100p textAlignCenter marginTop10" data-source="openai,custom,claude,xai,makersuite,openrouter,pollinations">
20612061 <div class="flex-container oneline-dropdown" title="Constrains effort on reasoning for reasoning models.&#10;Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response." data-i18n="[title]Constrains effort on reasoning for reasoning models.">
20622062 <label for="openai_reasoning_effort">
20632063 <span data-i18n="Reasoning Effort">Reasoning Effort</span>
@@ -2770,6 +2770,7 @@
27702770 <option value="nanogpt">NanoGPT</option>
27712771 <option value="openrouter">OpenRouter</option>
27722772 <option value="perplexity">Perplexity</option>
2773+ <option value="pollinations">Pollinations</option>
27732774 <option value="scale">Scale</option>
27742775 <option value="windowai">Window AI</option>
27752776 <option value="xai">xAI (Grok)</option>
@@ -3480,6 +3481,21 @@
34803481 <option value="grok-beta">grok-beta</option>
34813482 </select>
34823483 </div>
3484+ <div id="pollinations_form" data-source="pollinations">
3485+ <h4 data-i18n="Pollinations Model">Pollinations Model</h4>
3486+ <select id="model_pollinations_select">
3487+ <!-- Populated by JavaScript -->
3488+ </select>
3489+ <div class="info-block hint">
3490+ <a href="https://pollinations.ai/" target="_blank" rel="noopener noreferrer" data-i18n="Provided free of charge by Pollinations.AI">
3491+ Provided free of charge by Pollinations.AI
3492+ </a>
3493+ <br>
3494+ <span data-i18n="Avoid sending sensitive information. Provider's outputs may include ads.">
3495+ Avoid sending sensitive information. Provider's outputs may include ads.
3496+ </span>
3497+ </div>
3498+ </div>
34833499 <div id="prompt_post_porcessing_form" data-source="custom,openrouter">
34843500 <h4 data-i18n="Prompt Post-Processing">Prompt Post-Processing</h4>
34853501 <select id="custom_prompt_post_processing" class="text_pole" title="Applies additional processing to the prompt before sending it to the API." data-i18n="[title]Applies additional processing to the prompt before sending it to the API.">
public/script.js+1 -1
@@ -4811,7 +4811,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
48114811 name2: name2,
48124812 charDescription: description,
48134813 charPersonality: personality,
48144814 Scenarioscenario: scenario,
48154815 worldInfoBefore: worldInfoBefore,
48164816 worldInfoAfter: worldInfoAfter,
48174817 extensionPrompts: extension_prompts,
public/scripts/PromptManager.js+8 -8
@@ -86,15 +86,15 @@ class Prompt {
8686 * @param {string} param0.identifier - The unique identifier of the prompt.
8787 * @param {string} param0.role - The role associated with the prompt.
8888 * @param {string} param0.content - The content of the prompt.
8989 * @param {string} [param0.name] - The name of the prompt.
9090 * @param {boolean} [param0.system_prompt] - Indicates if the prompt is a system prompt.
9191 * @param {string} [param0.position] - The position of the prompt in the prompt list.
9292 * @param {number} [param0.injection_position] - The insert position of the prompt.
9393 * @param {number} [param0.injection_depth] - The depth of the prompt in the chat.
9494 * @param {boolean} [param0.forbid_overrides] - Indicates if the prompt should not be overridden.
9595 * @param {boolean} [param0.extension] - Prompt is added by an extension.
9696 */
9797 constructor({ identifier, role, content, name, system_prompt, position, injection_depth, injection_position, forbid_overrides, extension } = {}) {
9898 this.identifier = identifier;
9999 this.role = role;
100100 this.content = content;
public/scripts/RossAscends-mods.js+1 -0
@@ -410,6 +410,7 @@ function RA_autoconnect(PrevApi) {
410410 || (secret_state[SECRET_KEYS.NANOGPT] && oai_settings.chat_completion_source == chat_completion_sources.NANOGPT)
411411 || (secret_state[SECRET_KEYS.DEEPSEEK] && oai_settings.chat_completion_source == chat_completion_sources.DEEPSEEK)
412412 || (secret_state[SECRET_KEYS.XAI] && oai_settings.chat_completion_source == chat_completion_sources.XAI)
413+ || (oai_settings.chat_completion_source === chat_completion_sources.POLLINATIONS)
413414 || (isValidUrl(oai_settings.custom_url) && oai_settings.chat_completion_source == chat_completion_sources.CUSTOM)
414415 ) {
415416 $('#api_button_openai').trigger('click');
public/scripts/extensions/caption/index.js+1 -1
@@ -448,7 +448,7 @@ jQuery(async function () {
448448 }
449449
450450 // Custom API doesn't need additional checks
451451 if (api === 'custom' || api === 'pollinations') {
452452 return true;
453453 }
454454 }
public/scripts/extensions/caption/settings.html+13 -0
@@ -30,6 +30,7 @@
3030 <option value="openai">OpenAI</option>
3131 <option value="openrouter">OpenRouter</option>
3232 <option value="ooba" data-i18n="Text Generation WebUI (oobabooga)">Text Generation WebUI (oobabooga)</option>
33+ <option value="pollinations">Pollinations</option>
3334 <option value="vllm">vLLM</option>
3435 <option value="xai">xAI (Grok)</option>
3536 </select>
@@ -151,6 +152,18 @@
151152 <option data-type="custom" value="custom_current" data-i18n="currently_selected">[Currently selected]</option>
152153 <option data-type="xai" value="grok-2-vision-1212">grok-2-vision-1212</option>
153154 <option data-type="xai" value="grok-vision-beta">grok-vision-beta</option>
155+ <option data-type="pollinations" value="openai">openai</option>
156+ <option data-type="pollinations" value="openai-fast">openai-fast</option>
157+ <option data-type="pollinations" value="openai-large">openai-large</option>
158+ <option data-type="pollinations" value="openai-roblox">openai-roblox</option>
159+ <option data-type="pollinations" value="mistral">mistral</option>
160+ <option data-type="pollinations" value="unity">unity</option>
161+ <option data-type="pollinations" value="mirexa">mirexa</option>
162+ <option data-type="pollinations" value="searchgpt">searchgpt</option>
163+ <option data-type="pollinations" value="evil">evil</option>
164+ <option data-type="pollinations" value="phi">phi</option>
165+ <option data-type="pollinations" value="sur">sur</option>
166+ <option data-type="pollinations" value="bidara">bidara</option>
154167 </select>
155168 </div>
156169 <div data-type="ollama">
public/scripts/openai.js+93 -33
@@ -185,6 +185,7 @@ export const chat_completion_sources = {
185185 NANOGPT: 'nanogpt',
186186 DEEPSEEK: 'deepseek',
187187 XAI: 'xai',
188+ POLLINATIONS: 'pollinations',
188189};
189190
190191const character_names_behavior = {
@@ -268,6 +269,7 @@ export const settingsToUpdate = {
268269 deepseek_model: ['#model_deepseek_select', 'deepseek_model', false],
269270 zerooneai_model: ['#model_01ai_select', 'zerooneai_model', false],
270271 xai_model: ['#model_xai_select', 'xai_model', false],
272+ pollinations_model: ['#model_pollinations_select', 'pollinations_model', false],
271273 custom_model: ['#custom_model_id', 'custom_model', false],
272274 custom_url: ['#custom_api_url_text', 'custom_url', false],
273275 custom_include_body: ['#custom_include_body', 'custom_include_body', false],
@@ -357,6 +359,7 @@ const default_settings = {
357359 zerooneai_model: 'yi-large',
358360 deepseek_model: 'deepseek-chat',
359361 xai_model: 'grok-3-beta',
362+ pollinations_model: 'openai',
360363 custom_model: '',
361364 custom_url: '',
362365 custom_include_body: '',
@@ -438,6 +441,7 @@ const oai_settings = {
438441 zerooneai_model: 'yi-large',
439442 deepseek_model: 'deepseek-chat',
440443 xai_model: 'grok-3-beta',
444+ pollinations_model: 'openai',
441445 custom_model: '',
442446 custom_url: '',
443447 custom_include_body: '',
@@ -1181,7 +1185,7 @@ async function populateChatCompletion(prompts, chatCompletion, { bias, quietProm
11811185 * Combines system prompts with prompt manager prompts
11821186 *
11831187 * @param {Object} options - An object with optional settings.
11841188 * @param {string} options.Scenarioscenario - The scenario or context of the dialogue.
11851189 * @param {string} options.charPersonality - Description of the character's personality.
11861190 * @param {string} options.name2 - The second name to be used in the messages.
11871191 * @param {string} options.worldInfoBefore - The world info to be added before the main conversation.
@@ -1195,8 +1199,8 @@ async function populateChatCompletion(prompts, chatCompletion, { bias, quietProm
11951199 * @param {string} options.personaDescription
11961200 * @returns {Promise<Object>} prompts - The prepared and merged system and user-defined prompts.
11971201 */
11981202async function preparePromptsForChatCompletion({ Scenarioscenario, charPersonality, name2, worldInfoBefore, worldInfoAfter, charDescription, quietPrompt, bias, extensionPrompts, systemPromptOverride, jailbreakPromptOverride, personaDescription }) {
11991203 const scenarioText = Scenarioscenario && oai_settings.scenario_format ? substituteParams(oai_settings.scenario_format) : '';
12001204 const charPersonalityText = charPersonality && oai_settings.personality_format ? substituteParams(oai_settings.personality_format) : '';
12011205 const groupNudge = substituteParams(oai_settings.group_nudge_prompt);
12021206 const impersonationPrompt = oai_settings.impersonation_prompt ? substituteParams(oai_settings.impersonation_prompt) : '';
@@ -1352,7 +1356,7 @@ async function preparePromptsForChatCompletion({ Scenario, charPersonality, name
13521356 * @param {string} content.name2 - The second name to be used in the messages.
13531357 * @param {string} content.charDescription - Description of the character.
13541358 * @param {string} content.charPersonality - Description of the character's personality.
13551359 * @param {string} content.Scenarioscenario - The scenario or context of the dialogue.
13561360 * @param {string} content.worldInfoBefore - The world info to be added before the main conversation.
13571361 * @param {string} content.worldInfoAfter - The world info to be added after the main conversation.
13581362 * @param {string} content.bias - The bias to be added in the conversation.
@@ -1373,7 +1377,7 @@ export async function prepareOpenAIMessages({
13731377 name2,
13741378 charDescription,
13751379 charPersonality,
13761380 Scenarioscenario,
13771381 worldInfoBefore,
13781382 worldInfoAfter,
13791383 bias,
@@ -1400,21 +1404,18 @@ export async function prepareOpenAIMessages({
14001404 try {
14011405 // Merge markers and ordered user prompts with system prompts
14021406 const prompts = await preparePromptsForChatCompletion({
14031407 Scenarioscenario,
14041408 charPersonality,
14051409 name2,
14061410 worldInfoBefore,
14071411 worldInfoAfter,
14081412 charDescription,
14091413 quietPrompt,
1410- quietImage,
14111414 bias,
14121415 extensionPrompts,
14131416 systemPromptOverride,
14141417 jailbreakPromptOverride,
14151418 personaDescription,
1416- messages,
1417- messageExamples,
14181419 });
14191420
14201421 // Fill the chat completion with as much context as the budget allows
@@ -1660,6 +1661,8 @@ export function getChatCompletionModel(source = null) {
16601661 return oai_settings.deepseek_model;
16611662 case chat_completion_sources.XAI:
16621663 return oai_settings.xai_model;
1664+ case chat_completion_sources.POLLINATIONS:
1665+ return oai_settings.pollinations_model;
16631666 default:
16641667 console.error(`Unknown chat completion source: ${activeSource}`);
16651668 return '';
@@ -1842,6 +1845,24 @@ function saveModelList(data) {
18421845
18431846 $('#model_deepseek_select').val(oai_settings.deepseek_model).trigger('change');
18441847 }
1848+
1849+ if (oai_settings.chat_completion_source === chat_completion_sources.POLLINATIONS) {
1850+ $('#model_pollinations_select').empty();
1851+ model_list.forEach((model) => {
1852+ $('#model_pollinations_select').append(
1853+ $('<option>', {
1854+ value: model.id,
1855+ text: model.id,
1856+ }));
1857+ });
1858+
1859+ const selectedModel = model_list.find(model => model.id === oai_settings.pollinations_model);
1860+ if (model_list.length > 0 && (!selectedModel || !oai_settings.pollinations_model)) {
1861+ oai_settings.pollinations_model = model_list[0].id;
1862+ }
1863+
1864+ $('#model_pollinations_select').val(oai_settings.pollinations_model).trigger('change');
1865+ }
18451866}
18461867
18471868function appendOpenRouterOptions(model_list, groupModels = false, sort = false) {
@@ -1954,6 +1975,7 @@ function getReasoningEffort() {
19541975 chat_completion_sources.CUSTOM,
19551976 chat_completion_sources.XAI,
19561977 chat_completion_sources.OPENROUTER,
1978+ chat_completion_sources.POLLINATIONS,
19571979 ];
19581980
19591981 if (!reasoningEffortSources.includes(oai_settings.chat_completion_source)) {
@@ -2009,6 +2031,7 @@ async function sendOpenAIRequest(type, messages, signal) {
20092031 const isNano = oai_settings.chat_completion_source == chat_completion_sources.NANOGPT;
20102032 const isDeepSeek = oai_settings.chat_completion_source == chat_completion_sources.DEEPSEEK;
20112033 const isXAI = oai_settings.chat_completion_source == chat_completion_sources.XAI;
2034+ const isPollinations = oai_settings.chat_completion_source == chat_completion_sources.POLLINATIONS;
20122035 const isTextCompletion = isOAI && textCompletionModels.includes(oai_settings.openai_model);
20132036 const isQuiet = type === 'quiet';
20142037 const isImpersonate = type === 'impersonate';
@@ -2211,7 +2234,15 @@ async function sendOpenAIRequest(type, messages, signal) {
22112234 }
22122235 }
22132236
2214- if ((isOAI || isOpenRouter || isMistral || isCustom || isCohere || isNano || isXAI) && oai_settings.seed >= 0) {
2237+ if (isPollinations) {
2238+ delete generate_data.temperature;
2239+ delete generate_data.top_p;
2240+ delete generate_data.frequency_penalty;
2241+ delete generate_data.presence_penalty;
2242+ delete generate_data.max_tokens;
2243+ }
2244+
2245+ if ((isOAI || isOpenRouter || isMistral || isCustom || isCohere || isNano || isXAI || isPollinations) && oai_settings.seed >= 0) {
22152246 generate_data['seed'] = oai_settings.seed;
22162247 }
22172248
@@ -2407,13 +2438,14 @@ function parseOpenAIChatLogprobs(logprobs) {
24072438 return null;
24082439 }
24092440
24102441 /** @type {(x: { token: string, logprob: number }) => [string, number]} */
24112442 const toTuple = (x) => [x.token, x.logprob];
24122443
24132444 return content.map(({ token, logprob, top_logprobs }) => {
24142445 // Add the chosen token to top_logprobs if it's not already there, then
24152446 // convert to a list of [token, logprob] pairs
24162447 const chosenTopToken = top_logprobs.some((top) => token === top.token);
2448+ /** @type {import('./logprobs.js').Candidate[]} */
24172449 const topLogprobs = chosenTopToken
24182450 ? top_logprobs.map(toTuple)
24192451 : [...top_logprobs.map(toTuple), [token, logprob]];
@@ -2438,6 +2470,7 @@ function parseOpenAITextLogprobs(logprobs) {
24382470 return tokens.map((token, i) => {
24392471 // Add the chosen token to top_logprobs if it's not already there, then
24402472 // convert to a list of [token, logprob] pairs
2473+ /** @type {any[]} */
24412474 const topLogprobs = top_logprobs[i] ? Object.entries(top_logprobs[i]) : [];
24422475 const chosenTopToken = topLogprobs.some(([topToken]) => token === topToken);
24432476 if (!chosenTopToken) {
@@ -3262,7 +3295,7 @@ function loadOpenAISettings(data, settings) {
32623295 openai_setting_names = arr_holder;
32633296
32643297 oai_settings.preset_settings_openai = settings.preset_settings_openai;
32653298 $(`#settings_preset_openai option[value=${openai_setting_names[oai_settings.preset_settings_openai]}]`).attrprop('selected', true);
32663299
32673300 oai_settings.temp_openai = settings.temp_openai ?? default_settings.temp_openai;
32683301 oai_settings.freq_pen_openai = settings.freq_pen_openai ?? default_settings.freq_pen_openai;
@@ -3300,6 +3333,7 @@ function loadOpenAISettings(data, settings) {
33003333 oai_settings.deepseek_model = settings.deepseek_model ?? default_settings.deepseek_model;
33013334 oai_settings.zerooneai_model = settings.zerooneai_model ?? default_settings.zerooneai_model;
33023335 oai_settings.xai_model = settings.xai_model ?? default_settings.xai_model;
3336+ oai_settings.pollinations_model = settings.pollinations_model ?? default_settings.pollinations_model;
33033337 oai_settings.custom_model = settings.custom_model ?? default_settings.custom_model;
33043338 oai_settings.custom_url = settings.custom_url ?? default_settings.custom_url;
33053339 oai_settings.custom_include_body = settings.custom_include_body ?? default_settings.custom_include_body;
@@ -3363,30 +3397,32 @@ function loadOpenAISettings(data, settings) {
33633397 $(`#openai_inline_image_quality option[value="${oai_settings.inline_image_quality}"]`).prop('selected', true);
33643398
33653399 $('#model_openai_select').val(oai_settings.openai_model);
33663400 $(`#model_openai_select option[value="${oai_settings.openai_model}"`).attrprop('selected', true);
33673401 $('#model_claude_select').val(oai_settings.claude_model);
33683402 $(`#model_claude_select option[value="${oai_settings.claude_model}"`).attrprop('selected', true);
33693403 $('#model_windowai_select').val(oai_settings.windowai_model);
33703404 $(`#model_windowai_select option[value="${oai_settings.windowai_model}"`).attrprop('selected', true);
33713405 $('#model_google_select').val(oai_settings.google_model);
33723406 $(`#model_google_select option[value="${oai_settings.google_model}"`).attrprop('selected', true);
33733407 $('#model_ai21_select').val(oai_settings.ai21_model);
33743408 $(`#model_ai21_select option[value="${oai_settings.ai21_model}"`).attrprop('selected', true);
33753409 $('#model_mistralai_select').val(oai_settings.mistralai_model);
33763410 $(`#model_mistralai_select option[value="${oai_settings.mistralai_model}"`).attrprop('selected', true);
33773411 $('#model_cohere_select').val(oai_settings.cohere_model);
33783412 $(`#model_cohere_select option[value="${oai_settings.cohere_model}"`).attrprop('selected', true);
33793413 $('#model_perplexity_select').val(oai_settings.perplexity_model);
33803414 $(`#model_perplexity_select option[value="${oai_settings.perplexity_model}"`).attrprop('selected', true);
33813415 $('#model_groq_select').val(oai_settings.groq_model);
33823416 $(`#model_groq_select option[value="${oai_settings.groq_model}"`).attrprop('selected', true);
33833417 $('#model_nanogpt_select').val(oai_settings.nanogpt_model);
33843418 $(`#model_nanogpt_select option[value="${oai_settings.nanogpt_model}"`).attrprop('selected', true);
33853419 $('#model_deepseek_select').val(oai_settings.deepseek_model);
33863420 $(`#model_deepseek_select option[value="${oai_settings.deepseek_model}"`).prop('selected', true);
33873421 $('#model_01ai_select').val(oai_settings.zerooneai_model);
33883422 $('#model_xai_select').val(oai_settings.xai_model);
33893423 $(`#model_xai_select option[value="${oai_settings.xai_model}"`).attrprop('selected', true);
3424+ $('#model_pollinations_select').val(oai_settings.pollinations_model);
3425+ $(`#model_pollinations_select option[value="${oai_settings.pollinations_model}"`).prop('selected', true);
33903426 $('#custom_model_id').val(oai_settings.custom_model);
33913427 $('#custom_api_url_text').val(oai_settings.custom_url);
33923428 $('#openai_max_context').val(oai_settings.openai_max_context);
@@ -3492,7 +3528,7 @@ function loadOpenAISettings(data, settings) {
34923528 $('#chat_completion_source').val(oai_settings.chat_completion_source).trigger('change');
34933529 $('#oai_max_context_unlocked').prop('checked', oai_settings.max_context_unlocked);
34943530 $('#custom_prompt_post_processing').val(oai_settings.custom_prompt_post_processing);
34953531 $(`#custom_prompt_post_processing option[value="${oai_settings.custom_prompt_post_processing}"]`).attrprop('selected', true);
34963532}
34973533
34983534function setNamesBehaviorControls() {
@@ -3667,6 +3703,7 @@ async function saveOpenAIPreset(name, settings, triggerUi = true) {
36673703 groq_model: settings.groq_model,
36683704 zerooneai_model: settings.zerooneai_model,
36693705 xai_model: settings.xai_model,
3706+ pollinations_model: settings.pollinations_model,
36703707 custom_model: settings.custom_model,
36713708 custom_url: settings.custom_url,
36723709 custom_include_body: settings.custom_include_body,
@@ -3739,7 +3776,7 @@ async function saveOpenAIPreset(name, settings, triggerUi = true) {
37393776 oai_settings.preset_settings_openai = data.name;
37403777 const value = openai_setting_names[data.name];
37413778 Object.assign(openai_settings[value], presetBody);
37423779 $(`#settings_preset_openai option[value="${value}"]`).attrprop('selected', true);
37433780 if (triggerUi) $('#settings_preset_openai').trigger('change');
37443781 }
37453782 else {
@@ -3747,7 +3784,7 @@ async function saveOpenAIPreset(name, settings, triggerUi = true) {
37473784 openai_setting_names[data.name] = openai_settings.length - 1;
37483785 const option = document.createElement('option');
37493786 option.selected = true;
37503787 option.value = String(openai_settings.length - 1);
37513788 option.innerText = data.name;
37523789 if (triggerUi) $('#settings_preset_openai').append(option).trigger('change');
37533790 }
@@ -3955,14 +3992,14 @@ async function onPresetImportFileChange(e) {
39553992 oai_settings.preset_settings_openai = data.name;
39563993 const value = openai_setting_names[data.name];
39573994 Object.assign(openai_settings[value], presetBody);
39583995 $(`#settings_preset_openai option[value="${value}"]`).attrprop('selected', true);
39593996 $('#settings_preset_openai').trigger('change');
39603997 } else {
39613998 openai_settings.push(presetBody);
39623999 openai_setting_names[data.name] = openai_settings.length - 1;
39634000 const option = document.createElement('option');
39644001 option.selected = true;
39654002 option.value = String(openai_settings.length - 1);
39664003 option.innerText = data.name;
39674004 $('#settings_preset_openai').append(option).trigger('change');
39684005 }
@@ -4067,7 +4104,7 @@ async function onDeletePresetClick() {
40674104 if (Object.keys(openai_setting_names).length) {
40684105 oai_settings.preset_settings_openai = Object.keys(openai_setting_names)[0];
40694106 const newValue = openai_setting_names[oai_settings.preset_settings_openai];
40704107 $(`#settings_preset_openai option[value="${newValue}"]`).attrprop('selected', true);
40714108 $('#settings_preset_openai').trigger('change');
40724109 }
40734110
@@ -4099,7 +4136,7 @@ async function onLogitBiasPresetDeleteClick() {
40994136
41004137 if (Object.keys(oai_settings.bias_presets).length) {
41014138 oai_settings.bias_preset_selected = Object.keys(oai_settings.bias_presets)[0];
41024139 $(`#openai_logit_bias_preset option[value="${oai_settings.bias_preset_selected}"]`).attrprop('selected', true);
41034140 $('#openai_logit_bias_preset').trigger('change');
41044141 }
41054142
@@ -4465,6 +4502,11 @@ async function onModelChange() {
44654502 $('#custom_model_id').val(value).trigger('input');
44664503 }
44674504
4505+ if (value && $(this).is('#model_pollinations_select')) {
4506+ console.log('Pollinations model changed to', value);
4507+ oai_settings.pollinations_model = value;
4508+ }
4509+
44684510 if ($(this).is('#model_xai_select')) {
44694511 console.log('XAI model changed to', value);
44704512 oai_settings.xai_model = value;
@@ -4705,6 +4747,18 @@ async function onModelChange() {
47054747 $('#temp_openai').attr('max', oai_max_temp).val(oai_settings.temp_openai).trigger('input');
47064748 }
47074749
4750+ if (oai_settings.chat_completion_source === chat_completion_sources.POLLINATIONS) {
4751+ if (oai_settings.max_context_unlocked) {
4752+ $('#openai_max_context').attr('max', unlocked_max);
4753+ } else {
4754+ $('#openai_max_context').attr('max', max_128k);
4755+ }
4756+
4757+ oai_settings.openai_max_context = Math.min(Number($('#openai_max_context').attr('max')), oai_settings.openai_max_context);
4758+ $('#openai_max_context').val(oai_settings.openai_max_context).trigger('input');
4759+ $('#temp_openai').attr('max', oai_max_temp).val(oai_settings.temp_openai).trigger('input');
4760+ }
4761+
47084762 if (oai_settings.chat_completion_source === chat_completion_sources.DEEPSEEK) {
47094763 if (oai_settings.max_context_unlocked) {
47104764 $('#openai_max_context').attr('max', unlocked_max);
@@ -5047,6 +5101,9 @@ function toggleChatCompletionForms() {
50475101 else if (oai_settings.chat_completion_source == chat_completion_sources.XAI) {
50485102 $('#model_xai_select').trigger('change');
50495103 }
5104+ else if (oai_settings.chat_completion_source == chat_completion_sources.POLLINATIONS) {
5105+ $('#model_pollinations_select').trigger('change');
5106+ }
50505107 $('[data-source]').each(function () {
50515108 const validSources = $(this).data('source').split(',');
50525109 $(this).toggle(validSources.includes(oai_settings.chat_completion_source));
@@ -5061,7 +5118,7 @@ async function testApiConnection() {
50615118 }
50625119
50635120 try {
50645121 const reply = await sendOpenAIRequest('quiet', [{ 'role': 'user', 'content': 'Hi' }], new AbortController().signal);
50655122 console.log(reply);
50665123 toastr.success(t`API connection successful!`);
50675124 }
@@ -5186,6 +5243,8 @@ export function isImageInliningSupported() {
51865243 return visionSupportedModels.some(model => oai_settings.cohere_model.includes(model));
51875244 case chat_completion_sources.XAI:
51885245 return visionSupportedModels.some(model => oai_settings.xai_model.includes(model));
5246+ case chat_completion_sources.POLLINATIONS:
5247+ return (Array.isArray(model_list) && model_list.find(m => m.id === oai_settings.pollinations_model)?.vision);
51895248 default:
51905249 return false;
51915250 }
@@ -5258,8 +5317,8 @@ $('#save_proxy').on('click', async function () {
52585317 toastr.success(t`Proxy Saved`);
52595318 if ($('#openai_proxy_preset').val() !== presetName) {
52605319 const option = document.createElement('option');
52615320 option.text = String(presetName);
52625321 option.value = String(presetName);
52635322
52645323 $('#openai_proxy_preset').append(option);
52655324 }
@@ -5784,6 +5843,7 @@ export function initOpenAI() {
57845843 $('#model_01ai_select').on('change', onModelChange);
57855844 $('#model_custom_select').on('change', onModelChange);
57865845 $('#model_xai_select').on('change', onModelChange);
5846+ $('#model_pollinations_select').on('change', onModelChange);
57875847 $('#settings_preset_openai').on('change', onSettingsPresetChange);
57885848 $('#new_oai_preset').on('click', onNewPresetClick);
57895849 $('#delete_oai_preset').on('click', onDeletePresetClick);
public/scripts/slash-commands.js+1 -0
@@ -4136,6 +4136,7 @@ function getModelOptions(quiet) {
41364136 { id: 'model_01ai_select', api: 'openai', type: chat_completion_sources.ZEROONEAI },
41374137 { id: 'model_deepseek_select', api: 'openai', type: chat_completion_sources.DEEPSEEK },
41384138 { id: 'model_xai_select', api: 'openai', type: chat_completion_sources.XAI },
4139+ { id: 'model_pollinations_select', api: 'openai', type: chat_completion_sources.POLLINATIONS },
41394140 { id: 'model_novel_select', api: 'novel', type: null },
41404141 { id: 'horde_model', api: 'koboldhorde', type: null },
41414142 ];
public/scripts/tool-calling.js+9 -1
@@ -1,7 +1,7 @@
11import { DOMPurify } from '../lib.js';
22
33import { addOneMessage, chat, event_types, eventSource, main_api, saveChatConditional, system_avatar, systemUserName } from '../script.js';
44import { chat_completion_sources, model_list, oai_settings } from './openai.js';
55import { Popup } from './popup.js';
66import { SlashCommand } from './slash-commands/SlashCommand.js';
77import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from './slash-commands/SlashCommandArgument.js';
@@ -575,6 +575,13 @@ export class ToolManager {
575575 return false;
576576 }
577577
578+ if (oai_settings.chat_completion_source === chat_completion_sources.POLLINATIONS && Array.isArray(model_list)) {
579+ const currentModel = model_list.find(model => model.id === oai_settings.pollinations_model);
580+ if (currentModel) {
581+ return currentModel.tools;
582+ }
583+ }
584+
578585 const supportedSources = [
579586 chat_completion_sources.OPENAI,
580587 chat_completion_sources.CUSTOM,
@@ -587,6 +594,7 @@ export class ToolManager {
587594 chat_completion_sources.MAKERSUITE,
588595 chat_completion_sources.AI21,
589596 chat_completion_sources.XAI,
597+ chat_completion_sources.POLLINATIONS,
590598 ];
591599 return supportedSources.includes(oai_settings.chat_completion_source);
592600 }
src/constants.js+1 -0
@@ -177,6 +177,7 @@ export const CHAT_COMPLETION_SOURCES = {
177177 NANOGPT: 'nanogpt',
178178 DEEPSEEK: 'deepseek',
179179 XAI: 'xai',
180+ POLLINATIONS: 'pollinations',
180181};
181182
182183/**
src/endpoints/backends/chat-completions.js+19 -1
@@ -57,6 +57,7 @@ const API_AI21 = 'https://api.ai21.com/studio/v1';
5757const API_NANOGPT = 'https://nano-gpt.com/api/v1';
5858const API_DEEPSEEK = 'https://api.deepseek.com/beta';
5959const API_XAI = 'https://api.x.ai/v1';
60+const API_POLLINATIONS = 'https://text.pollinations.ai/openai';
6061
6162/**
6263 * Applies a post-processing step to the generated messages.
@@ -1010,6 +1011,10 @@ router.post('/status', async function (request, response_getstatus_openai) {
10101011 api_url = new URL(request.body.reverse_proxy || API_XAI);
10111012 api_key_openai = request.body.reverse_proxy ? request.body.proxy_password : readSecret(request.user.directories, SECRET_KEYS.XAI);
10121013 headers = {};
1014+ } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.POLLINATIONS) {
1015+ api_url = 'https://text.pollinations.ai';
1016+ api_key_openai = 'NONE';
1017+ headers = {};
10131018 } else {
10141019 console.warn('This chat completion source is not supported yet.');
10151020 return response_getstatus_openai.status(400).send({ error: true });
@@ -1031,7 +1036,12 @@ router.post('/status', async function (request, response_getstatus_openai) {
10311036
10321037 if (response.ok) {
10331038 /** @type {any} */
10341039 constlet data = await response.json();
1040+
1041+ if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.POLLINATIONS && Array.isArray(data)) {
1042+ data = { data: data.map(model => ({ id: model.name, ...model })) };
1043+ }
1044+
10351045 response_getstatus_openai.send(data);
10361046
10371047 if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.COHERE && Array.isArray(data?.models)) {
@@ -1293,6 +1303,14 @@ router.post('/generate', function (request, response) {
12931303 apiKey = readSecret(request.user.directories, SECRET_KEYS.ZEROONEAI);
12941304 headers = {};
12951305 bodyParams = {};
1306+ } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.POLLINATIONS) {
1307+ apiUrl = API_POLLINATIONS;
1308+ apiKey = 'NONE';
1309+ headers = {};
1310+ bodyParams = {
1311+ reasoning_effort: request.body.reasoning_effort,
1312+ private: true,
1313+ };
12961314 } else {
12971315 console.warn('This chat completion source is not supported yet.');
12981316 return response.status(400).send({ error: true });
src/endpoints/openai.js+5 -1
@@ -73,7 +73,7 @@ router.post('/caption-image', async (request, response) => {
7373 key = readSecret(request.user.directories, SECRET_KEYS.XAI);
7474 }
7575
7676 const noKeyTypes = ['custom', 'ooba', 'koboldcpp', 'vllm', 'llamacpp', 'pollinations'];
7777 if (!key && !request.body.reverse_proxy && !noKeyTypes.includes(request.body.api)) {
7878 console.warn('No key found for API', request.body.api);
7979 return response.sendStatus(400);
@@ -147,6 +147,10 @@ router.post('/caption-image', async (request, response) => {
147147 apiUrl = 'https://api.x.ai/v1/chat/completions';
148148 }
149149
150+ if (request.body.api === 'pollinations') {
151+ apiUrl = 'https://text.pollinations.ai/openai/chat/completions';
152+ }
153+
150154 if (request.body.api === 'ooba') {
151155 apiUrl = `${trimV1(request.body.server_url)}/v1/chat/completions`;
152156 const imgMessage = body.messages.pop();