import { BaseAIUseCase } from '../../middleware/usecases/base/base-ai.usecase'; import { BaseAIRequest, BaseAIResult } from '../../middleware/shared/types/base-request.types'; import { ModelParameterOverrides } from '../../middleware/services/model-parameter-manager/model-parameter-manager.service'; /** * Tweet generation request interface */ export interface TweetGeneratorRequest extends BaseAIRequest { topic: string; includeHashtags?: boolean; } /** * Tweet generation result interface */ export interface TweetGeneratorResult extends BaseAIResult { tweet: string; characterCount: number; withinLimit: boolean; } /** * Tweet Generator Use Case * * Demonstrates parameter configuration for token limiting and concise output. * * Key Features: * - Token limiting via `num_predict` parameter (max ~70 tokens for 280 chars) * - Marketing preset for engaging, varied content * - Lower temperature for focused, on-brand output * - Character count validation * * This use case is particularly useful for: * - Social media content generation * - Testing parameter effectiveness * - Demonstrating output length control * - Validating token limiting functionality */ export declare class TweetGeneratorUseCase extends BaseAIUseCase { /** * System message emphasizing brevity and Twitter best practices */ protected readonly systemMessage = "You are an expert social media content creator specializing in Twitter/X posts.\n\nCRITICAL REQUIREMENTS:\n1. Be concise, engaging, and impactful\n2. Use clear, accessible language\n3. Avoid hashtags unless specifically requested\n4. NO explanations, NO preamble - ONLY output the tweet text\n\nSTYLE GUIDELINES:\n- Start with a hook or attention-grabbing statement\n- Use active voice and present tense when possible\n- Include a call-to-action or thought-provoking question when appropriate\n- Break complex ideas into simple, digestible statements\n\nOUTPUT FORMAT:\nReturn ONLY the tweet text. Nothing else."; /** * Get the user template from message file */ protected getUserTemplate(): (formattedPrompt: string) => string; /** * Format the user message - pass through the topic */ protected formatUserMessage(prompt: any): string; /** * Override model parameters for tweet generation * * This configuration is optimized for generating short, engaging tweets * while staying within Twitter's 280 character limit. * * @returns ModelParameterOverrides with Marketing-inspired preset + token limiting * * **Parameter Selection Rationale:** * * **Token Limiting:** * - `num_predict: 70` - Strictly limits output to ~70 tokens (roughly 280 characters) * This is the key parameter for enforcing length constraints. * * **Creative Control:** * - `temperature: 0.7` - Balanced creativity for engaging but focused content * - `repeatPenalty: 1.3` - Strong penalty to avoid repetitive phrasing in short text * - `frequencyPenalty: 0.3` - Encourages word variety in limited space * - `presencePenalty: 0.2` - Promotes diverse concepts even in brief content * * **Quality Control:** * - `topP: 0.9` - Moderate nucleus sampling for reliable quality * - `topK: 50` - Balanced vocabulary selection for natural language * - `repeatLastN: 32` - Short window appropriate for tweet-length text * * **Expected Impact:** * - Tweets will be under 280 characters (enforced by num_predict) * - Content will be varied and engaging without repetition * - Output will be focused and on-topic * - Language will be natural and conversational * * **Testing Note:** * This configuration allows testing of token limiting functionality. * Increase num_predict to see longer outputs; decrease for shorter ones. * * For more information about parameters, see docs/OLLAMA_PARAMETERS.md */ protected getParameterOverrides(): ModelParameterOverrides; /** * Create the result with character count validation */ protected createResult(content: string, usedPrompt: string, thinking?: string): TweetGeneratorResult; } //# sourceMappingURL=tweet-generator.usecase.d.ts.map