Helper functions and Constants

The helper module in EchoArtistry provides utility functions and constants that are used throughout the application. It includes functions for file operations, logging configurations, and cost calculation constants for various AI models.

Constants

echo_artistry.utils.helper.MODEL_TOKEN_LENGTH_MAPPING = {...}

Mapping of model names to their token length and cost. The mapping includes models like ‘gpt-3.5-turbo-1106’, ‘gpt-4’, etc.

echo_artistry.utils.helper.IMAGE_CHARACTER_LENGTH_MAPPING = {...}

Defines the character length and cost per image for different image models like ‘dall-e-2’ and ‘dall-e-3’.

echo_artistry.utils.helper.DEFAULT_MODEL_NAME = 'gpt-3.5-turbo-1106'

The default model name used in the application.

echo_artistry.utils.helper.DEFAULT_IMAGE_MODEL_NAME = 'dall-e-3'

The default image model name.

echo_artistry.utils.helper.DEFAULT_IMAGE_SIZE = '1792x1024'

The default size for generated images.

echo_artistry.utils.helper.DEFAULT_IMAGE_QUALITY = 'standard'

The default quality setting for generated images.

echo_artistry.utils.helper.MAX_RETRIES = 5

The maximum number of retries for certain operations.

Functions

echo_artistry.utils.helper.write_text_to_file(text, file_path)

Write text to a file.

Parameters:
  • text (str) – The text to write.

  • file_path (str) – The path to the file.

echo_artistry.utils.helper.get_text_from_file(file_path)

Get the text from a file.

Parameters:

file_path (str) – The path to the file.

Returns:

The text from the file.

Return type:

str