Commit Graph

14 Commits

Author SHA1 Message Date
b0b64c2fe3 feat: add AI-generated city descriptions
- Implement method to get multilingual city descriptions
- Create worker for generating descriptions in the background
- Update database schema to include description translations
- Update AiService to fetch descriptions from City model

This commit introduces a feature to generate city descriptions
in multiple languages using AI. It includes methods for
caching descriptions and a background job to handle
generation to improve performance and user experience.
2025-04-12 14:03:48 +08:00
b38d2fe65b feat: enhance home page layout and add sponsorship badges
- Restructure home page layout for better visual appeal
- Add links to sponsorship badges for ImgLab and Product Hunt
- Ensure buttons are styled consistently with updated classes

These changes improve the user experience by providing a more attractive and informative layout. The addition of sponsorship badges also helps in promoting partnerships.
2025-04-10 15:09:51 +08:00
ab50ed3036 feat: add support for multiple image generation models
- Introduced constant MODELS for managing model names.
- Updated the `generate_image` method to switch between FLUX and DALL-E 3.
- Added `generate_image_dalle` and `generate_image_flux` methods for respective API calls.
- Enhanced prompts for image generation across both models, ensuring correct message construction.

This update enables users to generate images using different AI models dynamically, allowing for flexible integration and improved user experience. The handling of errors now falls back to the DALL-E model if the FLUX API fails.
2025-04-10 12:00:57 +08:00
4d38dad1cf feat: improve DALL-E prompt generation for weather scenes
- Update the prompt to specify generating a highly detailed and
  photorealistic image for a specific weather moment.
- Enhance clarity regarding the scene's inspiration by retaining
  context about the city, state, country, and region.

This change refines the AI generation process by focusing on
particular weather moments, improving the output's relevance and
detail, which could lead to a better user experience.
2025-04-09 15:51:56 +08:00
3f8a5d925e feat: refine DALL-E prompt structure for weather scenes
- Update prompt structure to enhance clarity and detail.
- Include specific requirements for realism and aesthetics in the images.
- Emphasize photorealistic elements, lighting, and composition rules.

These changes enable the AI to produce more accurate and visually appealing images based on weather conditions and city characteristics. It improves the instructions given to DALL-E, ensuring detailed and realistic output.
2025-04-09 15:47:59 +08:00
98094ac0e4 style: standardize role casing in AI service 2025-03-02 11:17:05 +08:00
0ef979e5c4 feat: refactor: change image generation quality
- Modify the code to use the `hd` quality setting
- Update the code to use the `hd` quality setting.
- Ensure there are no other side effects of this change.
- These changes will improve the user experience.
</commit_message>
2025-02-16 13:27:25 +08:00
be88aebac2 fix: update AI service logging and weather services 2025-02-13 17:21:41 +08:00
af4ee3ee21 feat: enhance image generation prompt clarity
- Add requirements for clearer and brighter images
- Specify maintenance of brightness even in overcast conditions
- Include enhancements for sunny day imagery
- Revise output prompt to remove unnecessary prefix and suffix

These changes improve the clarity and effectiveness of prompts
used in AI-generated imagery. The additional specifications help
guide the AI in producing visually appealing and contextually
relevant images for various weather conditions.
2025-02-12 11:56:09 +08:00
d045f532ec feat: enhance AI prompt generation logic
- Refactor prompt generation to separate location
  description functionality
- Update user prompt generation for DALL-E 3
- Improve AI service's response handling

This change enhances the AiService by creating a more
modular approach to generating prompts. The introduction
of a `generate_location_desc` method improves the
detail and context provided in the generated prompts.
Furthermore, the `ask_ai` method centralizes AI request
logic, allowing for cleaner and more organized code.
These adjustments should improve the overall robustness
and readability of the prompt generation process.
2025-02-12 11:33:11 +08:00
e39c87ac5c feat: improve prompt generation with location details
- Include state, country, and region in the DALL-E prompt
- Enhance context for the generated weather scene

This change improves the specificity of the prompts generated
for the AI, providing more contextual information such as
state, country, and region alongside the city name. This
enhancement can lead to more accurate and relevant outputs
from the DALL-E 3 model for weather scenes.
2025-02-12 10:02:47 +08:00
0352923c5b feat: update weather data report format
Some checks are pending
Docker / docker (push) Waiting to run
- Include actual update time in weather report
- Rename watermark worker file for clarity

This commit enhances the weather data report by
updating the format to include the actual update time
retrieved from the weather service API. Additionally,
the watermark worker file has been renamed to improve
readability and consistency in the naming convention.
2025-01-31 10:46:32 +08:00
853a1d03ce refactor: clean up ai_service code formatting
- Adjust formatting for message parameters in the chat call
- Eliminate unnecessary blank lines in generate_prompt_request method
- Ensure consistent styles for arrays and block indentation

These changes improve code readability and maintain consistency in
formatting for better maintainability without altering functionality.
2025-01-22 16:50:21 +08:00
d728d7f50e feat: add batch weather art generation jobs
- Created BatchGenerateWeatherArtsJob to process eligible
  cities and generate weather art.
- Introduced GenerateWeatherArtJob for generating weather
  art and image attachment.
- Added AiService for obtaining prompts and generating
  images with OpenAI API.
- Implemented WeatherService to fetch current weather
  data from the QWeather API.
- Updated Gemfile with necessary gems (whenever,
  ruby-openai, httparty, down, aws-sdk-s3).

This commit introduces a system to create and store
weather art images for various cities based on current
weather conditions, leveraging external APIs for data
and image generation.
2025-01-22 16:50:00 +08:00