### Install TextCortex Package Source: https://github.com/textcortex/hemingwai/blob/main/README.md Install the textcortex package using pip. This is a prerequisite for using the HemingwAI API. ```bash pip install textcortex ``` -------------------------------- ### Text Generation Variables Summary Source: https://github.com/textcortex/hemingwai/blob/main/README.md Summary of variables used for TextCortex API requests, including prompt, temperature, token count, source language, and examples. ```text prompt: Prompting the HemingwAI to start writing on a specific subject temperature: Floating number between 0-1. 0 being the lowest creativity and 1 being the highest. Default is 0.7 token_count: Integer which defines the maximum amount of tokens that can be produced by the HemingwAI source_language: Language code of the source language of the written prompt. for example 'en' for English and 'de' for German. We support 72 languages. If you don't know the language code you can also use 'auto' for this field to automatically sense the input language. Examples: For example while generating ads, you can add your target segment as an option. See examples.py for examples. ``` -------------------------------- ### Generate Product Descriptions Source: https://github.com/textcortex/hemingwai/blob/main/README.md Use the TextCortex API to generate product descriptions. Provide product details, category, brand, features, and desired output parameters like token count and temperature. ```python from textcortex import TextCortex # Create the hemingwai object and enter your API Key hemingwai = TextCortex(api_key='YOUR_API_KEY') # Generate Product Descriptions using Hemingwai product_description = hemingwai.generate_product_descriptions( product_name='Black Leather Backpack Bag', product_category='Shoes & Bags, Women', brand='Cortexian', product_features='Color: Black, Material: Faux Leather', source_language='en', token_count=100, temperature=0.7, n_gen=4) ``` -------------------------------- ### Generate Product Descriptions Source: https://github.com/textcortex/hemingwai/blob/main/README.md Generates product descriptions based on provided product details. This method allows customization of output length, creativity, and the number of generated descriptions. ```APIDOC ## Generate Product Descriptions ### Description Generates product descriptions for a given product. This method allows specifying product name, category, brand, features, source language, token count, temperature for creativity, and the number of descriptions to generate. ### Method Signature `hemingwai.generate_product_descriptions(product_name: str, product_category: str, brand: str, product_features: str, source_language: str = 'en', token_count: int = 100, temperature: float = 0.7, n_gen: int = 4)` ### Parameters - **product_name** (string) - Required - The name of the product. - **product_category** (string) - Required - The category of the product. - **brand** (string) - Required - The brand of the product. - **product_features** (string) - Required - Key features of the product. - **source_language** (string) - Optional - The language of the source text. Defaults to 'en'. Supports 72 languages or 'auto'. - **token_count** (integer) - Optional - The maximum number of tokens for the generated text. Defaults to 100. - **temperature** (float) - Optional - Controls creativity (0.0 to 1.0). Defaults to 0.7. - **n_gen** (integer) - Optional - The number of descriptions to generate. Defaults to 4. ### Request Example ```python from textcortex import TextCortex hemingwai = TextCortex(api_key='YOUR_API_KEY') product_description = hemingwai.generate_product_descriptions( product_name='Black Leather Backpack Bag', product_category='Shoes & Bags, Women', brand='Cortexian', product_features='Color: Black, Material: Faux Leather', source_language='en', token_count=100, temperature=0.7, n_gen=4) ``` ### Response #### Success Response Returns a list of generated product descriptions, each with a unique ID. - **text** (string) - The generated product description. - **id** (string) - A unique identifier for the generated text. #### Response Example ```json [ { "text":"The Cortexian Black Backpack is a stylish and functional bag that can be worn for any occasion. It features a back zipper pocket so you can keep your belongings secure. The black color is ideal for any day and all occasions, from work to school to weekend outings.", "id":"2ff2d503-3d6b-405e-a8a5-13196f970160" }, { "text":"This cute and stylish black backpack is made for everyday use. The back is padded, fully adjustable and has a removable shoulder strap which can be extended to fit over your shoulder or wear like an arm/back pack. It also comes with two side pockets as well as a main compartment.", "id":"87d21b28-48f4-4b7b-90e4-6fab7d7dd0f8" }, { "text":"The Cortexian Black Backpack is the perfect travel companion for those who want to keep things simple. This backpack has a padded shoulder straps and an adjustable waist strap, making it comfortable for long periods of use.", "id":"20297317-9be6-4457-9481-17d402a988ab" } ] ``` ``` -------------------------------- ### Generate Blog Articles Source: https://github.com/textcortex/hemingwai/blob/main/README.md Generates blog articles based on a prompt. This method is part of the broader text generation capabilities of HemingwAI. ```APIDOC ## Generate Blog Articles ### Description Generates blog articles based on a given prompt. This method is part of the suite of text generation tools available through the HemingwAI API. ### Method Signature `hemingwai.generate_blog(prompt: str, source_language: str = 'en', token_count: int = 100, temperature: float = 0.7)` ### Parameters - **prompt** (string) - Required - The subject or topic to write the blog article about. - **source_language** (string) - Optional - The language of the source text. Defaults to 'en'. Supports 72 languages or 'auto'. - **token_count** (integer) - Optional - The maximum number of tokens for the generated text. Defaults to 100. - **temperature** (float) - Optional - Controls creativity (0.0 to 1.0). Defaults to 0.7. ### Request Example ```python from textcortex import TextCortex hemingwai = TextCortex(api_key='YOUR_API_KEY') blog_article = hemingwai.generate_blog(prompt='The future of AI in marketing', token_count=200) ``` ### Response #### Success Response Returns the generated blog article text. - **text** (string) - The generated blog article. - **id** (string) - A unique identifier for the generated text. ``` -------------------------------- ### TextCortex API Text Generation Methods Source: https://github.com/textcortex/hemingwai/blob/main/README.md Overview of available text generation methods in the TextCortex API, including generating blog articles, titles, extending paragraphs, paraphrasing, and product descriptions. ```python # Generate Blog Articles: hemingwai.generate_blog # Generate Blog Titles: hemingwai.generate_blog_titles # Autocomplete the rest using Hemingwai hemingwai.generate # Extend paragraphs with a blog writing tone using Hemingwai hemingwai.extend # Generate Product Descriptions using Hemingwai hemingwai.generate_product_descriptions # Paraphrase a given sentence with a tone change or without. hemingwai.paraphrase ``` -------------------------------- ### Generate Blog Titles Source: https://github.com/textcortex/hemingwai/blob/main/README.md Generates potential titles for blog articles. This is useful for brainstorming and selecting engaging titles. ```APIDOC ## Generate Blog Titles ### Description Generates a list of potential titles for a blog article based on a given prompt or topic. ### Method Signature `hemingwai.generate_blog_titles(prompt: str, source_language: str = 'en', token_count: int = 50, temperature: float = 0.7, n_gen: int = 5)` ### Parameters - **prompt** (string) - Required - The topic or main idea for the blog article. - **source_language** (string) - Optional - The language of the source text. Defaults to 'en'. Supports 72 languages or 'auto'. - **token_count** (integer) - Optional - The maximum number of tokens for each generated title. Defaults to 50. - **temperature** (float) - Optional - Controls creativity (0.0 to 1.0). Defaults to 0.7. - **n_gen** (integer) - Optional - The number of titles to generate. Defaults to 5. ### Request Example ```python from textcortex import TextCortex hemingwai = TextCortex(api_key='YOUR_API_KEY') blog_titles = hemingwai.generate_blog_titles(prompt='Benefits of remote work') ``` ### Response #### Success Response Returns a list of generated blog titles. - **text** (string) - A generated blog title. - **id** (string) - A unique identifier for the generated title. ``` -------------------------------- ### Extend Paragraphs Source: https://github.com/textcortex/hemingwai/blob/main/README.md Extends existing paragraphs with a specified writing tone. This method is useful for elaborating on content while maintaining a consistent style. ```APIDOC ## Extend Paragraphs ### Description Extends a given paragraph or text with a specific writing tone. This method is useful for elaborating on existing content while maintaining a consistent style. ### Method Signature `hemingwai.extend(prompt: str, tone: str = 'blog', source_language: str = 'en', token_count: int = 100, temperature: float = 0.7)` ### Parameters - **prompt** (string) - Required - The text to be extended. - **tone** (string) - Optional - The desired writing tone (e.g., 'blog', 'professional', 'casual'). Defaults to 'blog'. - **source_language** (string) - Optional - The language of the source text. Defaults to 'en'. Supports 72 languages or 'auto'. - **token_count** (integer) - Optional - The maximum number of tokens for the extended text. Defaults to 100. - **temperature** (float) - Optional - Controls creativity (0.0 to 1.0). Defaults to 0.7. ### Request Example ```python from textcortex import TextCortex hemingwai = TextCortex(api_key='YOUR_API_KEY') extended_text = hemingwai.extend(prompt='The quick brown fox jumps over the lazy dog.', tone='storytelling') ``` ### Response #### Success Response Returns the extended text. - **text** (string) - The extended text. - **id** (string) - A unique identifier for the generated text. ``` -------------------------------- ### Autocomplete Text Source: https://github.com/textcortex/hemingwai/blob/main/README.md Autocompletes text based on a given prompt. This method can be used to continue writing or generate text that follows a specific input. ```APIDOC ## Autocomplete Text ### Description Autocompletes the provided text based on the prompt. This method is useful for continuing a piece of writing or generating text that logically follows an input. ### Method Signature `hemingwai.generate(prompt: str, source_language: str = 'en', token_count: int = 100, temperature: float = 0.7)` ### Parameters - **prompt** (string) - Required - The text to be autocompleted or continued. - **source_language** (string) - Optional - The language of the source text. Defaults to 'en'. Supports 72 languages or 'auto'. - **token_count** (integer) - Optional - The maximum number of tokens for the generated text. Defaults to 100. - **temperature** (float) - Optional - Controls creativity (0.0 to 1.0). Defaults to 0.7. ### Request Example ```python from textcortex import TextCortex hemingwai = TextCortex(api_key='YOUR_API_KEY') completed_text = hemingwai.generate(prompt='Once upon a time in a land far away,') ``` ### Response #### Success Response Returns the autocompleted text. - **text** (string) - The generated text that completes the prompt. - **id** (string) - A unique identifier for the generated text. ``` -------------------------------- ### Paraphrase Text Source: https://github.com/textcortex/hemingwai/blob/main/README.md Paraphrases a given sentence or text, optionally changing the tone. This method is useful for rephrasing content while preserving the original meaning. ```APIDOC ## Paraphrase Text ### Description Paraphrases a given sentence or text. This method can optionally change the tone of the text while preserving the original meaning. ### Method Signature `hemingwai.paraphrase(text: str, tone: str = None, source_language: str = 'en', token_count: int = 100, temperature: float = 0.7)` ### Parameters - **text** (string) - Required - The sentence or text to be paraphrased. - **tone** (string) - Optional - The desired tone for the paraphrased text (e.g., 'formal', 'casual', 'simple'). If not specified, the original tone is maintained. - **source_language** (string) - Optional - The language of the source text. Defaults to 'en'. Supports 72 languages or 'auto'. - **token_count** (integer) - Optional - The maximum number of tokens for the paraphrased text. Defaults to 100. - **temperature** (float) - Optional - Controls creativity (0.0 to 1.0). Defaults to 0.7. ### Request Example ```python from textcortex import TextCortex hemingwai = TextCortex(api_key='YOUR_API_KEY') paraphrased_sentence = hemingwai.paraphrase(text='This is a very important piece of information.', tone='casual') ``` ### Response #### Success Response Returns the paraphrased text. - **text** (string) - The paraphrased sentence or text. - **id** (string) - A unique identifier for the generated text. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.