Added additional prompt setting

This commit is contained in:
tsoganov 2025-05-15 09:35:35 +03:00
parent 67a9a2ac45
commit 5b6888eb43
9 changed files with 176 additions and 159 deletions

View file

@ -53,8 +53,12 @@ print(f"Using special terms: {SPECIAL_TERMS}")
BATCH_SIZE = int(config.get('batch_size', 500))
print(f"Using batch size: {BATCH_SIZE}")
# Get additional prompt from config or use default
ADDITIONAL_PROMPT = config.get('additional_prompt', None)
print(f"Using additional prompt: {ADDITIONAL_PROMPT}")
# Function to extract words using OpenAI API
def extract_words_with_openai(domain_names, special_terms, batch_size=BATCH_SIZE):
def extract_words_with_openai(domain_names, special_terms, batch_size=BATCH_SIZE, additional_prompt=ADDITIONAL_PROMPT):
# Get API key from environment variable
api_key = os.environ.get("OPENAI_API_KEY")
if not api_key:
@ -95,6 +99,8 @@ Follow these rules strictly:
5. Try to find the most common words and phrases in the domain names.
6. Return ONLY a space-separated list of words and numberswith no explanations, no formatting, no introductions, and no additional text.
{additional_prompt}
Example output format:
word1 word2 word3 word4 word5