Giter VIP home page Giter VIP logo

infinitewisdom's People

Contributors

dependabot[bot] avatar ekeih avatar markusressel avatar renovate[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

owowobread

infinitewisdom's Issues

Vote with emoji

Although analysing images to know what kind of emotion would be associated by humans with it, it would also be nice to let users vote on images when requesting one via the /inspire command. This way it would also be possible to rank images based on user feedback.

Sort inline search results based on usage

It would be nice to sort images based on how often they were picked in an inline search. To prevent images from ranking always high this should probably only include a recent time frame.

For individual users it would also be nice to sort recently used images to the top of the inline search if no search string has been entered. This way it would be easier to find recently used images again more quickly.

Improve configuration options

Currently there is only a single value that can be configured and it can only configured in one way using environment variables. It would be cool to be able to control the behavior of the bot in a more detailed way like:

  • max url pool size
  • timeout between image polling
  • greetings message
  • etc.

It would also be cool to be able to configure less security crucial parameters using a config.yaml in addition to using environment variables.

Search by emoji

Hey there, great little bot! ๐Ÿ‘

Searching by emoji might be quite challenging if there is no easy way to detect a mood from a text snipped using some existing python library, but it would add a pretty cool way to find "appropriate" quotes.

Uploader processes items twice

Sometimes the image uploader uploads images twice before processing the next item. This may have to do with long processing times that exceed the configured uploader interval.

To solve this a mechanism to wait for the end of the last processing unit should be introduced to optionally prevent concurrent runs.

Environment config parameter values are not parsed with the correct type

Environment variables are always a string. Configuration entries have a specific type though f.ex. bool. Since there is no type safety on variable assignment in python it is currently possible to set a "False" string as the value of a boolean config entry. This is problematic because in python only bool("") == False so any other env variable would be considered as True (even "False").
To mitigate this a type conversion shall be added for types other than string (namely int, float and bool).

Cache already fetched image urls in a persistent storage

To speed up the startup process and maintain a reasonable queue size it would be useful to cache already fetched image URLs in a persistent cache. Although a local disk cache might be sufficient the desired solution would involve an AWS shared storage to be able to easily scale on a Kubernetes cluster.

Api fetch queue stops randomly

Sometimes the job that is sceduled to fetch new api images stops for no apparent reason. Altough this hasn't occurred for quite a while it should be investigated.

One thing that might improve the situation is to shorten the duration of this job as it probably never was meant to run such long running tasks.

Save Uploads in relation to bot token

Since uploaded files can only be referenced by the bot that uploaded them telegram file ids schould be stored in relation to the bot token used. To prevent the token from being spread all over the database its value should be hashed before storing.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • python 3.11-slim-buster
github-actions
.github/workflows/docker.yml
  • actions/checkout v4
  • docker/login-action v3
  • docker/metadata-action v5
  • docker/build-push-action v5
pep621
pyproject.toml
  • poetry >=1.2.2
poetry
pyproject.toml
  • python ^3.8
  • container-app-conf ^5.0.0
  • python-telegram-bot ^12.2.0
  • telegram-click ^5.0.0
  • requests *
  • prometheus-client *
  • google-cloud-vision *
  • pytesseract *
  • opencv-python *
  • sqlalchemy *
  • alembic *
  • emoji *

  • Check this box to trigger a request for Renovate to run again on this repository

Refactoring: Extract ApiCrawler

Since all data is now stored in a persistence there is no need for the bot itself to know how to directly query the image api, it just needs to access the persistence. Therefore it would be better to refactor all api querying code to a separate file/class that runs the background crawling itself and is only created and started once in the __main__ method. That way it would also be possible to run the crawler in a completely separate process.

Run image analysis in a worker thread

Currently newly added images are only analyzed once. This is bad for multiple reasons:

  1. the used analyser might have improved since the last run
  2. there might be a better analyser available now than has been on first sight

To improve this the image analysis process should be extracted to a worker that continuously checks all persistence entries for a possible analysis improvement.

It might still be a good thing to analyse new images right away though (and not wait for the worker to find it) so at least something is available until the best possible analysis is possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.