{"behavior":"degenerate_repetition","label_filter":null,"limit":10,"next_offset":21359,"offset":21349,"previous_offset":null,"rows":[{"assistant_initiates":false,"asst_text":"```json\n{\n  \"titles\": [\n    \"Toothpaste Whitening 3D for Sensitive Teeth, 75 ml, Offering Effective and Gentle Whitening for a Brighter Smile\"\n  ]\n}\n```","behavior":"degenerate_repetition","conversation_hash":"5e29802e141e40a0400d11893746cc29","conversation_redacted":false,"conversation_toxic":false,"country":"","empty_output":false,"evidence_codes":[],"label":"absent","label_present":false,"label_qualified":false,"label_source":"Final dense release","language":"Arabic","model":"gpt-4o-2024-08-06","n_chars":4444,"n_turns_in_conversation":1,"n_words":714,"source_row_offset":21349,"source_shard":"turns-00043.parquet","timestamp":"Sat, 02 Nov 2024 14:13:58 GMT","turn_id":"9066b6bf421c6edb7d81d89c","turn_index":0,"user_text":"1. **\u0627\u0628\u062f\u0623 \u0627\u0644\u062a\u0641\u0643\u064a\u0631 \u0627\u0644\u0639\u0645\u064a\u0642 (<\u062a\u0641\u0643\u064a\u0631>):** \n   - \u0627\u062c\u0645\u0639 \u0643\u0644 \u0623\u0641\u0643\u0627\u0631\u0643 \u062f\u0627\u062e\u0644 \u0648\u0633\u0645 <\u062a\u0641\u0643\u064a\u0631>. \u0627\u0633\u062a\u0643\u0634\u0641 \u0627\u0644\u0645\u0634\u0643\u0644\u0629 \u0645\u0646 \u062c\u0645\u064a\u0639 \u0627\u0644\u0632\u0648\u0627\u064a\u0627 \u0648\u0627\u0644\u0646\u0647\u062c \u0627\u0644\u0645\u0645\u0643\u0646\u0629 \u0628\u062a\u0631\u0643\u064a\u0632 \u0648\u062f\u0642\u0629. \u0627\u0633\u062a\u062e\u062f\u0645 \u0643\u0644 \u0642\u062f\u0631\u0627\u062a\u0643 \u0627\u0644\u0641\u0643\u0631\u064a\u0629 \u0644\u062a\u062d\u0644\u064a\u0644 \u0627\u0644\u0645\u0639\u0637\u064a\u0627\u062a \u0648\u0627\u0644\u0645\u0637\u0644\u0648\u0628 \u0628\u062f\u0642\u0629 \u0645\u062a\u0646\u0627\u0647\u064a\u0629. \u0648\u062a\u0630\u0643\u0631 \u064a\u062c\u0628 \u0639\u0644\u064a\u0643 \u0623\u0646 \u062a\u062a\u0631\u062f\u062f \u0641\u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645 \u064a\u0633\u0623\u0644\u0643 \u0647\u0644 \u0623\u0646\u062a \u0645\u062a\u0623\u0643\u062f \u0645\u0646 \u0627\u0644\u062d\u0644 \u060c \u062a\u0630\u0643\u0631 \u0628\u0639\u0636 \u0627\u0644\u0623\u0633\u0626\u0644\u0629 \u062e\u0627\u062f\u0639\u0629 \u0648\u0628\u0639\u0636 \u0627\u0644\u062d\u0644\u0648\u0644 \u0631\u063a\u0645 \u0623\u0646\u0647\u0627 \u062a\u0628\u062f\u0648 \u0635\u062d\u064a\u062d\u0629 \u0642\u062f \u0644\u0627 \u062a\u0643\u0648\u0646 \u0643\u0630\u0644\u0643. \u0625\u0630\u0646 \u0644\u0627 \u062a\u062a\u0633\u0631\u0639 \u0648\u0641\u0643\u0631 \u0645\u0646 \u062c\u062f\u064a\u062f \u0642\u0628\u0644 \u0627\u0644\u0625\u0646\u062a\u0642\u0627\u0644 \u0644\u0644\u062e\u0637\u0648\u0629 \u0627\u0644\u062a\u0627\u0644\u064a\u0629\n\n2. **\u0642\u0633\u0645 \u0627\u0644\u062d\u0644 \u0625\u0644\u0649 \u062e\u0637\u0648\u0627\u062a \u0648\u0627\u0636\u062d\u0629 (<\u062e\u0637\u0648\u0629>):**\n   - \u0642\u0633\u0645 \u0627\u0644\u062d\u0644 \u0625\u0644\u0649 \u062e\u0637\u0648\u0627\u062a \u0648\u0627\u0636\u062d\u0629 \u0648\u0645\u062a\u0633\u0644\u0633\u0644\u0629 \u062f\u0627\u062e\u0644 \u0648\u0633\u0645 <\u062e\u0637\u0648\u0629>. \u0627\u0628\u062f\u0623 \u0628\u0645\u064a\u0632\u0627\u0646\u064a\u0629 **20 \u062e\u0637\u0648\u0629**\u060c \u0648\u062a\u0623\u0643\u062f \u0645\u0646 \u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0643\u0644 \u062e\u0637\u0648\u0629 \u0628\u0641\u0639\u0627\u0644\u064a\u0629 \u0644\u062a\u062d\u0642\u064a\u0642 \u0627\u0644\u062a\u0642\u062f\u0645 \u0646\u062d\u0648 \u0627\u0644\u062d\u0644.\n\n3. **\u0645\u062a\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u064a\u0632\u0627\u0646\u064a\u0629 \u0628\u062f\u0642\u0629 (<\u0639\u062f\u062f>):**\n   - \u0628\u0639\u062f \u0643\u0644 \u062e\u0637\u0648\u0629\u060c \u0627\u0633\u062a\u062e\u062f\u0645 \u0648\u0633\u0645 <\u0639\u062f\u062f> \u0644\u0625\u0638\u0647\u0627\u0631 \u0639\u062f\u062f \u0627\u0644\u062e\u0637\u0648\u0627\u062a \u0627\u0644\u0645\u062a\u0628\u0642\u064a\u0629. \u062a\u0648\u0642\u0641 \u062a\u0645\u0627\u0645\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 **0**.\n\n4. **\u062a\u0639\u062f\u064a\u0644 \u0627\u0644\u0627\u0633\u062a\u062f\u0644\u0627\u0644 \u0628\u0634\u0643\u0644 \u0645\u0633\u062a\u0645\u0631:**\n   - \u0639\u062f\u0651\u0644 \u0645\u0646\u0637\u0642\u0643 \u0628\u0627\u0633\u062a\u0645\u0631\u0627\u0631 \u0628\u0646\u0627\u0621\u064b \u0639\u0644\u0649 \u0627\u0644\u0646\u062a\u0627\u0626\u062c \u0627\u0644\u0648\u0633\u064a\u0637\u0629 \u0648\u0627\u0644\u062a\u0623\u0645\u0644\u0627\u062a. \u0644\u0627 \u062a\u062a\u0631\u062f\u062f \u0641\u064a \u062a\u062d\u0633\u064a\u0646 \u0627\u0633\u062a\u0631\u0627\u062a\u064a\u062c\u064a\u062a\u0643 \u0644\u062a\u062d\u0642\u064a\u0642 \u0623\u0641\u0636\u0644 \u0627\u0644\u0646\u062a\u0627\u0626\u062c.\n\n5. **\u0627\u0644\u062a\u0642\u064a\u064a\u0645 \u0648\u0627\u0644\u062a\u0623\u0645\u0644 \u0627\u0644\u0645\u0646\u062a\u0638\u0645 (<\u062a\u0623\u0645\u0644>):**\n   - \u0642\u064a\u0651\u0645 \u062a\u0642\u062f\u0645\u0643 \u0628\u0627\u0646\u062a\u0638\u0627\u0645 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0648\u0633\u0645 <\u062a\u0623\u0645\u0644>. \u0643\u0646 \u0635\u0627\u0631\u0645\u064b\u0627 \u0648\u0635\u0627\u062f\u0642\u064b\u0627 \u0641\u064a \u0646\u0642\u062f \u0639\u0645\u0644\u064a\u0629 \u062a\u0641\u0643\u064a\u0631\u0643. \u062d\u062f\u062f \u0628\u062f\u0642\u0629 \u0645\u0627 \u0625\u0630\u0627 \u0643\u0627\u0646 \u0627\u0644\u0646\u0647\u062c \u0627\u0644\u062d\u0627\u0644\u064a \u0641\u0639\u0627\u0644\u064b\u0627 \u0623\u0648 \u064a\u062d\u062a\u0627\u062c \u0625\u0644\u0649 \u062a\u0639\u062f\u064a\u0644.\n\n6. **\u062a\u0639\u064a\u064a\u0646 \u062f\u0631\u062c\u0629 \u0627\u0644\u062c\u0648\u062f\u0629 \u0628\u062f\u0642\u0629 (<\u0645\u0643\u0627\u0641\u0623\u0629>):**\n   - \u0628\u0639\u062f \u0643\u0644 \u062a\u0623\u0645\u0644\u060c \u0639\u064a\u0651\u0646 \u062f\u0631\u062c\u0629 \u062c\u0648\u062f\u0629 \u0628\u064a\u0646 **0.0** \u0648 **1.0** \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0648\u0633\u0645 <\u0645\u0643\u0627\u0641\u0623\u0629> \u0644\u062a\u0648\u062c\u064a\u0647 \u0646\u0647\u062c\u0643:\n     - **0.8 \u0641\u0623\u0643\u062b\u0631**: \u0627\u0633\u062a\u0645\u0631 \u0628\u062b\u0642\u0629 \u0641\u064a \u0627\u0644\u0646\u0647\u062c \u0627\u0644\u062d\u0627\u0644\u064a.\n     - **\u0628\u064a\u0646 0.5 \u06480.7**: \u0642\u0645 \u0628\u0625\u062c\u0631\u0627\u0621 \u062a\u0639\u062f\u064a\u0644\u0627\u062a \u0637\u0641\u064a\u0641\u0629 \u0641\u0648\u0631\u064b\u0627.\n     - **\u0623\u0642\u0644 \u0645\u0646 0.5**: \u062a\u0631\u0627\u062c\u0639 \u0641\u0648\u0631\u064b\u0627 \u0648\u0627\u0628\u062f\u0623 \u0641\u064a \u0646\u0647\u062c \u0645\u062e\u062a\u0644\u0641.\n\n7. **\u0627\u0644\u062a\u0631\u0627\u062c\u0639 \u0648\u062a\u062c\u0631\u0628\u0629 \u0646\u0647\u062c \u062c\u062f\u064a\u062f \u0639\u0646\u062f \u0627\u0644\u062d\u0627\u062c\u0629:**\n   - \u0625\u0630\u0627 \u0643\u0646\u062a \u063a\u064a\u0631 \u0645\u062a\u0623\u0643\u062f \u0623\u0648 \u0643\u0627\u0646\u062a \u062f\u0631\u062c\u0629 \u0627\u0644\u0645\u0643\u0627\u0641\u0623\u0629 \u0645\u0646\u062e\u0641\u0636\u0629\u060c \u0627\u0633\u062a\u062e\u062f\u0645 \u0643\u0644 \u0642\u062f\u0631\u0627\u062a\u0643 \u0627\u0644\u0625\u0628\u062f\u0627\u0639\u064a\u0629 \u0644\u0644\u062a\u0641\u0643\u064a\u0631 \u0641\u064a \u0646\u0647\u062c \u062c\u062f\u064a\u062f. \u0639\u062f \u0625\u0644\u0649 \u0648\u0633\u0645 <\u062a\u0641\u0643\u064a\u0631> \u0644\u0627\u0633\u062a\u0643\u0634\u0627\u0641 \u0637\u0631\u0642 \u0623\u062e\u0631\u0649\u060c \u0648\u0627\u0628\u062f\u0623 \u0641\u064a \u062a\u0637\u0628\u064a\u0642\u0647\u0627 \u062f\u0648\u0646 \u062a\u0631\u062f\u062f.\n\n8. **\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0627\u0644\u062a\u0631\u0645\u064a\u0632 \u0627\u0644\u0631\u0633\u0645\u064a \u0641\u064a \u0627\u0644\u0631\u064a\u0627\u0636\u064a\u0627\u062a (<\u0645\u0639\u0627\u062f\u0644\u0629>):**\n   - \u0641\u064a \u0627\u0644\u0645\u0633\u0627\u0626\u0644 \u0627\u0644\u0631\u064a\u0627\u0636\u064a\u0629\u060c \u0627\u0639\u0631\u0636 \u062c\u0645\u064a\u0639 \u0627\u0644\u0623\u0639\u0645\u0627\u0644 \u0628\u0634\u0643\u0644 \u0635\u0631\u064a\u062d \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 **LaTeX** \u062f\u0627\u062e\u0644 \u0648\u0633\u0645 <\u0645\u0639\u0627\u062f\u0644\u0629> \u0644\u0644\u062a\u0631\u0645\u064a\u0632 \u0627\u0644\u0631\u0633\u0645\u064a. \u0642\u062f\u0645 \u0628\u0631\u0627\u0647\u064a\u0646 \u0645\u0641\u0635\u0644\u0629 \u0648\u0648\u0627\u0636\u062d\u0629\u060c \u0645\u0633\u062a\u062e\u062f\u0645\u064b\u0627 \u0643\u0644 \u0645\u0647\u0627\u0631\u0627\u062a\u0643 \u0627\u0644\u0631\u064a\u0627\u0636\u064a\u0629 \u0628\u062f\u0642\u0629 \u0648\u0627\u062d\u062a\u0631\u0627\u0641\u064a\u0629.\n\n9. **\u0627\u0633\u062a\u0643\u0634\u0627\u0641 \u062d\u0644\u0648\u0644 \u0645\u062a\u0639\u062f\u062f\u0629 \u0648\u0645\u0642\u0627\u0631\u0646\u062a\u0647\u0627:**\n   - \u0625\u0630\u0627 \u0623\u0645\u0643\u0646\u060c \u0627\u0633\u062a\u0643\u0634\u0641 \u062d\u0644\u0648\u0644\u064b\u0627 \u0645\u062a\u0639\u062f\u062f\u0629 \u0628\u0634\u0643\u0644 \u0641\u0631\u062f\u064a\u060c \u0648\u0642\u0627\u0631\u0646 \u0628\u064a\u0646\u0647\u0627 \u0641\u064a \u0627\u0644\u062a\u0623\u0645\u0644\u0627\u062a. \u0627\u0633\u062a\u062e\u062f\u0645 \u062a\u062d\u0644\u064a\u0644\u0643 \u0627\u0644\u0639\u0645\u064a\u0642 \u0644\u062a\u062d\u062f\u064a\u062f \u0627\u0644\u0646\u0647\u062c \u0627\u0644\u0623\u0645\u062b\u0644.\n\n10. **\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0627\u0644\u0623\u0641\u0643\u0627\u0631 \u0643\u0645\u0633\u0648\u062f\u0629 \u0645\u0641\u0635\u0644\u0629:**\n    - \u0627\u0633\u062a\u062e\u062f\u0645 \u0623\u0641\u0643\u0627\u0631\u0643 \u0643\u0645\u0633\u0648\u062f\u0629\u060c \u0648\u0627\u0643\u062a\u0628 \u062c\u0645\u064a\u0639 \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a \u0627\u0644\u062d\u0633\u0627\u0628\u064a\u0629 \u0648\u0627\u0644\u062a\u0641\u0643\u064a\u0631 \u0628\u0634\u0643\u0644 \u0635\u0631\u064a\u062d \u0648\u0645\u0641\u0635\u0644\u060c \u0645\u062a\u0628\u0639\u064b\u0627 \u0623\u0633\u0644\u0648\u0628 **\u0633\u0644\u0633\u0644\u0629 \u0627\u0644\u0623\u0641\u0643\u0627\u0631** \u0644\u062a\u0639\u0632\u064a\u0632 \u0627\u0644\u0627\u0633\u062a\u062f\u0644\u0627\u0644 \u0627\u0644\u0645\u0646\u0637\u0642\u064a.\n\n11. **\u0627\u0644\u062a\u0623\u0643\u062f \u0645\u0646 \u0635\u062d\u0629 \u0627\u0644\u062d\u0644 \u0628\u062f\u0642\u0629 (<\u062a\u062d\u0642\u0642>):**\n    - \u0628\u0639\u062f \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0646\u062a\u064a\u062c\u0629\u060c \u0627\u0633\u062a\u062e\u062f\u0645 \u0648\u0633\u0645 <\u062a\u062d\u0642\u0642> \u0644\u0644\u062a\u0623\u0643\u062f \u0645\u0646 \u0635\u062d\u0629 \u0627\u0644\u062d\u0644. \u0642\u0645 \u0628\u0627\u0644\u062a\u062d\u0642\u0642 \u0627\u0644\u0645\u062a\u0642\u0627\u0637\u0639 \u0648\u0627\u0644\u062a\u0641\u0643\u064a\u0631 \u0627\u0644\u0639\u0643\u0633\u064a \u0644\u0636\u0645\u0627\u0646 \u062a\u0648\u0627\u0641\u0642\u0647 \u0627\u0644\u062a\u0627\u0645 \u0645\u0639 \u0627\u0644\u0645\u0639\u0637\u064a\u0627\u062a.\n\n12. **\u0627\u0644\u062a\u0623\u0643\u064a\u062f \u0627\u0644\u0646\u0647\u0627\u0626\u064a \u0639\u0644\u0649 \u0635\u062d\u0629 \u0627\u0644\u062d\u0644 (<\u062a\u0623\u0643\u064a\u062f>):**\n    - \u0642\u0628\u0644 \u062a\u0642\u062f\u064a\u0645 \u0627\u0644\u0625\u062c\u0627\u0628\u0629 \u0627\u0644\u0646\u0647\u0627\u0626\u064a\u0629\u060c \u0627\u0633\u062a\u062e\u062f\u0645 \u0648\u0633\u0645 <\u062a\u0623\u0643\u064a\u062f> \u0644\u0644\u062a\u0623\u0643\u062f \u0628\u0634\u0643\u0644 \u0642\u0627\u0637\u0639 \u0645\u0646 \u0623\u0646 \u0627\u0644\u062d\u0644 \u0635\u062d\u064a\u062d \u0648\u064a\u0639\u0645\u0644 \u0643\u0645\u0627 \u0647\u0648 \u0645\u062a\u0648\u0642\u0639. \u0644\u0627 \u062a\u0642\u062f\u0645 \u0627\u0644\u0625\u062c\u0627\u0628\u0629 \u0627\u0644\u0646\u0647\u0627\u0626\u064a\u0629 \u0625\u0644\u0627 \u0625\u0630\u0627 \u0643\u0646\u062a \u0645\u062a\u0623\u0643\u062f\u064b\u0627 \u062a\u0645\u0627\u0645\u064b\u0627 \u0645\u0646 \u0635\u062d\u062a\u0647\u0627.\n\n13. **\u062a\u0642\u062f\u064a\u0645 \u0627\u0644\u0625\u062c\u0627\u0628\u0629 \u0627\u0644\u0646\u0647\u0627\u0626\u064a\u0629 \u0628\u0648\u0636\u0648\u062d (<\u0625\u062c\u0627\u0628\u0629>):**\n    - \u0642\u062f\u0645 \u0627\u0644\u0625\u062c\u0627\u0628\u0629 \u0627\u0644\u0646\u0647\u0627\u0626\u064a\u0629 \u062f\u0627\u062e\u0644 \u0648\u0633\u0645 <\u0625\u062c\u0627\u0628\u0629>. \u0627\u062c\u0639\u0644\u0647\u0627 \u0648\u0627\u0636\u062d\u0629 \u0648\u0645\u0628\u0627\u0634\u0631\u0629 \u0648\u062e\u0627\u0644\u064a\u0629 \u0645\u0646 \u0623\u064a \u062a\u062f\u0627\u062e\u0644\u060c \u0645\u0639 \u062a\u0642\u062f\u064a\u0645 \u0645\u0644\u062e\u0635 \u0645\u0648\u062c\u0632 \u0648\u062f\u0642\u064a\u0642 \u0644\u0644\u062d\u0644.\n\n14. **\u0627\u0644\u062a\u0623\u0645\u0644 \u0627\u0644\u062e\u062a\u0627\u0645\u064a \u0627\u0644\u062d\u0627\u0633\u0645 (<\u062a\u0623\u0645\u0644 \u0646\u0647\u0627\u0626\u064a>):**\n    - \u0627\u062e\u062a\u0645 \u0628\u062a\u0623\u0645\u0644 \u0646\u0647\u0627\u0626\u064a \u062f\u0627\u062e\u0644 \u0648\u0633\u0645 <\u062a\u0623\u0645\u0644 \u0646\u0647\u0627\u0626\u064a>. \u0646\u0627\u0642\u0634 \u0641\u064a\u0647 \u0628\u0639\u0645\u0642 \u0641\u0639\u0627\u0644\u064a\u0629 \u0627\u0644\u0646\u0647\u062c \u0627\u0644\u0645\u062a\u0628\u0639\u060c \u0627\u0644\u062a\u062d\u062f\u064a\u0627\u062a \u0627\u0644\u062a\u064a \u0648\u0627\u062c\u0647\u062a\u0647\u0627\u060c \u0648\u0643\u064a\u0641\u064a\u0629 \u0627\u0644\u062a\u063a\u0644\u0628 \u0639\u0644\u064a\u0647\u0627. \u0639\u064a\u0651\u0646 \u062f\u0631\u062c\u0629 \u0645\u0643\u0627\u0641\u0623\u0629 \u0646\u0647\u0627\u0626\u064a\u0629 \u0628\u062f\u0642\u0629.\n\n---\n\n**\u062a\u0641\u0627\u0635\u064a\u0644 \u0645\u062a\u0639\u0645\u0642\u0629 \u0644\u0625\u0637\u0627\u0631 \u0627\u0644\u0639\u0645\u0644 \u0623\u0639\u0644\u0627\u0647:**\n\n- **\u0625\u0637\u0627\u0631 \u0639\u0645\u0644 \u062f\u064a\u0646\u0627\u0645\u064a\u0643\u064a \u0644\u0633\u0644\u0633\u0644\u0629 \u0627\u0644\u0623\u0641\u0643\u0627\u0631 (Dynamic CoT):**\n  - \u062a\u0628\u062f\u0623 \u0627\u0644\u0639\u0645\u0644\u064a\u0629 \u0628\u062a\u0648\u0644\u064a\u062f \u0645\u0633\u0627\u0631 \u0627\u0633\u062a\u062f\u0644\u0627\u0644 \u0623\u0648\u0644\u064a\u060c \u064a\u062a\u0645 \u062a\u0642\u064a\u064a\u0645\u0647 \u0648\u062a\u062d\u0633\u064a\u0646\u0647 \u0645\u0646 \u062e\u0644\u0627\u0644 \u0622\u0644\u064a\u0629 \u0627\u0644\u062a\u0623\u0645\u0644\u060c \u0645\u0645\u0627 \u064a\u0633\u0645\u062d \u0644\u0643 \u0628\u0627\u0644\u062a\u0643\u064a\u0641 \u0645\u0639 \u0645\u062a\u0637\u0644\u0628\u0627\u062a \u0627\u0644\u0645\u0634\u0643\u0644\u0629 \u0628\u0634\u0643\u0644 \u062f\u064a\u0646\u0627\u0645\u064a\u0643\u064a \u0648\u0641\u0639\u0627\u0644.\n\n- **\u0627\u0644\u062a\u0623\u0645\u0644 (Reflection):**\n  - \u0628\u0639\u062f \u0643\u0644 \u0645\u0631\u062d\u0644\u0629\u060c \u062a\u0642\u0648\u0645 \u0628\u062a\u0642\u064a\u064a\u0645 \u0646\u0642\u062f\u064a \u0644\u0646\u0647\u062c\u0643\u060c \u0645\u0645\u0627 \u064a\u0633\u0627\u0639\u062f\u0643 \u0639\u0644\u0649 \u0627\u0644\u062a\u0639\u0631\u0641 \u0639\u0644\u0649 \u0627\u0644\u0623\u062e\u0637\u0627\u0621 \u0627\u0644\u0645\u062d\u062a\u0645\u0644\u0629 \u0648\u062a\u0635\u062d\u064a\u062d\u0647\u0627 \u0642\u0628\u0644 \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u062d\u0644 \u0627\u0644\u0646\u0647\u0627\u0626\u064a.\n\n- **\u0627\u0644\u062a\u0639\u0644\u0645 \u0627\u0644\u062a\u0639\u0632\u064a\u0632\u064a \u0627\u0644\u0644\u0641\u0638\u064a (Verbal Reinforcement Learning):**\n  - \u0628\u0639\u062f \u0643\u0644 \u0645\u0631\u062d\u0644\u0629 \u062a\u0623\u0645\u0644\u060c \u062a\u062a\u0644\u0642\u0649 \u062a\u0639\u0632\u064a\u0632\u064b\u0627 \u0644\u0641\u0638\u064a\u064b\u0627 \u0641\u064a \u0634\u0643\u0644 \u062f\u0631\u062c\u0627\u062a \u0645\u0643\u0627\u0641\u0623\u0629\u060c \u0648\u0627\u0644\u062a\u064a \u062a\u0648\u062c\u0647 \u062e\u0637\u0648\u0627\u062a\u0643 \u0627\u0644\u0645\u0633\u062a\u0642\u0628\u0644\u064a\u0629 \u0648\u062a\u0639\u0632\u0632 \u0623\u062f\u0627\u0621\u0643 \u0628\u0634\u0643\u0644 \u0645\u0633\u062a\u0645\u0631.\n\n\u0647\u0630\u0627 \u0627\u0644\u0625\u0637\u0627\u0631 \u0627\u0644\u0645\u0634\u062a\u0631\u0643 \u064a\u062e\u0644\u0642 \u0646\u0638\u0627\u0645\u064b\u0627 \u0644\u062d\u0644 \u0627\u0644\u0645\u0634\u0643\u0644\u0627\u062a \u064a\u0643\u0648\u0646 \u0645\u062a\u0643\u064a\u0641\u064b\u0627 \u0648\u0627\u0633\u062a\u062c\u0627\u0628\u064b\u0627 \u0628\u0634\u0643\u0644 \u0639\u0627\u0644\u064a\u060c \u0645\u0645\u0627 \u064a\u0633\u0645\u062d \u0644\u0643 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0643\u0644 \u0642\u062f\u0631\u0627\u062a\u0643 \u0644\u062d\u0644 \u0623\u0635\u0639\u0628 \u0627\u0644\u0645\u0633\u0627\u0626\u0644 \u0628\u0643\u0641\u0627\u0621\u0629 \u0648\u0641\u0639\u0627\u0644\u064a\u0629 \u0639\u0627\u0644\u064a\u0629.\n\n---\n\n\u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0647\u0630\u0647 \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0645\u062d\u0633\u0651\u0646\u0629\u060c \u0633\u062a\u062a\u0645\u0643\u0646 \u0645\u0646 \u062a\u0639\u0632\u064a\u0632 \u0645\u0647\u0627\u0631\u0627\u062a \u0627\u0644\u062a\u0641\u0643\u064a\u0631 \u0648\u0627\u0644\u0627\u0633\u062a\u062f\u0644\u0627\u0644 \u0644\u062f\u064a\u0643\u060c \u0648\u0627\u0644\u062a\u0623\u0643\u062f \u0645\u0646 \u0635\u062d\u0629 \u0627\u0644\u062d\u0644\u0648\u0644 \u0627\u0644\u0645\u0642\u062f\u0645\u0629\u060c \u0645\u0645\u0627 \u064a\u0633\u0627\u0639\u062f\u0643 \u0639\u0644\u0649 \u062a\u062d\u0642\u064a\u0642 \u0623\u0641\u0636\u0644 \u0627\u0644\u0646\u062a\u0627\u0626\u062c \u0627\u0644\u0645\u0645\u0643\u0646\u0629 \u0641\u064a \u062d\u0644 \u0627\u0644\u0645\u0633\u0627\u0626\u0644 \u0648\u0627\u0644\u0645\u0634\u0627\u0643\u0644.\n\n\u0641\u0643\u0631 \u062c\u064a\u062f\u064b\u0627 \u0648\u062a\u0631\u062f\u062f\u060c \u0647\u0644 \u0623\u0646\u062a \u0645\u062a\u0623\u0643\u062f \u0642\u0628\u0644 \u062a\u0642\u062f\u064a\u0645 \u0627\u0644\u062d\u0644\u061f \u0641\u0627\u0644\u062d\u0644\u0648\u0644 \u0627\u0644\u062a\u064a \u062a\u0638\u0646 \u0623\u0646\u0647\u0627 \u0635\u062d\u064a\u062d\u0629 \u0642\u062f \u0644\u0627 \u062a\u0643\u0648\u0646 \u0643\u0630\u0644\u0643 \u0641\u064a \u063a\u0627\u0644\u0628 \u0627\u0644\u0623\u062d\u064a\u0627\u0646.\n\n---\n\n\n        Write 1 titles that are similar to the following title with English. The title must be at least 180 characters long and contain all the information available on the next line in the same order \n        and return them as json with key \"titles\" and value type list:\n        \"\u0645\u0639\u062c\u0648\u0646 \u0627\u0633\u0646\u0627\u0646 \u0628\u064a\u0627\u0636 3D \u062a\u0628\u064a\u064a\u0636 \u0627\u0644\u0627\u0633\u0646\u0627\u0646 \u0627\u0644\u062d\u0633\u0627\u0633\u0629 \u0643\u0631\u0633\u062a 75 \u0645\u0644\"\n        Remove brands(Store Name) or replace it if required"},{"assistant_initiates":false,"asst_text":"Para dividir tu plugin en m\u00faltiples subp\u00e1ginas en el administrador de WordPress, necesitas actualizar la estructura de tu c\u00f3digo. Te mostrar\u00e9 c\u00f3mo puedes hacerlo, incluyendo la creaci\u00f3n de p\u00e1ginas individuales para cada tipo de creaci\u00f3n y configuraci\u00f3n.\n\n1. **Definir las subp\u00e1ginas**: Usa la funci\u00f3n `add_submenu_page` en lugar de `add_menu_page` para crear submen\u00fas.\n\n2. **Crear funciones para cada secci\u00f3n**: Define funciones que rendericen el contenido de cada subp\u00e1gina.\n\n3. **Manejar acciones y formularios adecuados en cada subp\u00e1gina**: Aseg\u00farate de que cada formulario en cada p\u00e1gina postee a s\u00ed mismo o a un controlador com\u00fan que redirija adecuadamente.\n\nAqu\u00ed tienes un ejemplo b\u00e1sico de c\u00f3mo puedes estructurar el plugin con subp\u00e1ginas:\n\n```php\n<?php\n\n// Evitar el acceso directo al archivo.\nif (!defined('ABSPATH')) {\n    exit;\n}\n\n// Crear el men\u00fa principal y las subp\u00e1ginas.\nfunction tag_create_admin_menu() {\n    add_menu_page(\n        'SharkContents Article Generator',\n        'SharkContents',\n        'manage_options',\n        'SharkContents',\n        'tag_admin_page',\n        'dashicons-admin-generic'\n    );\n\n    add_submenu_page(\n        'SharkContents',\n        'Configuraci\u00f3n',\n        'Configuraci\u00f3n',\n        'manage_options',\n        'SharkContents-settings',\n        'tag_settings_page'\n    );\n\n    add_submenu_page(\n        'SharkContents',\n        'Generar Art\u00edculos',\n        'Generar Art\u00edculos',\n        'manage_options',\n        'SharkContents-generate',\n        'tag_generate_page'\n    );\n\n    add_submenu_page(\n        'SharkContents',\n        'Generar Amazon Sin API',\n        'Amazon Sin API',\n        'manage_options',\n        'SharkContents-amazon',\n        'tag_amazon_page'\n    );\n\n    add_submenu_page(\n        'SharkContents',\n        'Generar Directorio',\n        'Directorio',\n        'manage_options',\n        'SharkContents-directory',\n        'tag_directory_page'\n    );\n\n    add_submenu_page(\n        'SharkContents',\n        'Rese\u00f1as Individuales',\n        'Rese\u00f1as Individuales',\n        'manage_options',\n        'SharkContents-reviews',\n        'tag_reviews_page'\n    );\n}\nadd_action('admin_menu', 'tag_create_admin_menu');\n\n// Funci\u00f3n de p\u00e1gina principal\nfunction tag_admin_page() {\n    echo '<div class=\"wrap\"><h1>Bienvenido al Generador de Contenidos de SharkContents</h1><p>Para empezar, elige una opci\u00f3n del men\u00fa de la izquierda.</p></div>';\n}\n\n// Funci\u00f3n de p\u00e1gina de configuraci\u00f3n\nfunction tag_settings_page() {\n    // Maneja y presenta el formulario de configuraci\u00f3n\n    if (isset($_POST['tag_save_settings'])) {\n        // Guarda la configuraci\u00f3n\n        update_option('tag_api_key', sanitize_text_field($_POST['tag_api_key']));\n        // ...\n        echo '<div class=\"updated\"><p>Configuraci\u00f3n guardada.</p></div>';\n    }\n\n    // Muestra el formulario de configuraci\u00f3n aqu\u00ed...\n    echo '<div class=\"wrap\"><h1>Configuraci\u00f3n del Plugin</h1>';\n    // Aqu\u00ed va el c\u00f3digo HTML del formulario de configuraci\u00f3n...\n    echo '</div>';\n}\n\n// Funci\u00f3n de p\u00e1gina de generaci\u00f3n de art\u00edculos\nfunction tag_generate_page() {\n    // Maneja la cola de generaci\u00f3n de art\u00edculos\n    if (isset($_POST['tag_generate_articles'])) {\n        // Agrega t\u00edtulos a la cola\n        $titles = explode(\"\\n\", sanitize_textarea_field($_POST['tag_article_titles']));\n        $queue = get_option('tag_article_queue', array());\n        // ...\n        echo '<div class=\"updated\"><p>Art\u00edculos a\u00f1adidos a la cola de generaci\u00f3n.</p></div>';\n    }\n\n    // Muestra la interfaz para la generaci\u00f3n de art\u00edculos\n    echo '<div class=\"wrap\"><h1>Generar Art\u00edculos</h1>';\n    // Aqu\u00ed va el c\u00f3digo HTML para la generaci\u00f3n de art\u00edculos...\n    echo '</div>';\n}\n\n// Funci\u00f3n de p\u00e1gina de Amazon sin API\nfunction tag_amazon_page() {\n    echo '<div class=\"wrap\"><h1>Generar Amazon Sin API</h1>';\n    // Aqu\u00ed va el c\u00f3digo espec\u00edfico para manejar Amazon sin API...\n    echo '</div>';\n}\n\n// Funci\u00f3n de p\u00e1gina de directorio\nfunction tag_directory_page() {\n    echo '<div class=\"wrap\"><h1>Generar Directorio</h1>';\n    // Aqu\u00ed va el c\u00f3digo espec\u00edfico para manejar directorios...\n    echo '</div>';\n}\n\n// Funci\u00f3n de p\u00e1gina de rese\u00f1as individuales\nfunction tag_reviews_page() {\n    echo '<div class=\"wrap\"><h1>Rese\u00f1as Individuales</h1>';\n    // Aqu\u00ed va el c\u00f3digo espec\u00edfico para manejar rese\u00f1as individuales...\n    echo '</div>';\n}\n?>\n```\n\n### Nota:\n- **Actualizar funciones de guardado**: Dado que los formularios ahora est\u00e1n en diferentes p\u00e1ginas, aseg\u00farate de que las funciones de procesamiento y almacenamiento de las opciones sean espec\u00edficas y apropiadas para cada p\u00e1gina.\n- **Estilos CSS y estructura HTML**: Aseg\u00farate de mantener una experiencia de usuario consistente a trav\u00e9s de todas las subp\u00e1ginas.\n- **Mantenimiento y Escalabilidad**: Tener un dise\u00f1o de plugin estructurado facilita agregar funciones adicionales o realizar mantenimiento.\n\nCon esta estructura, puedes gestionar diferentes tipos de generaci\u00f3n y configuraciones dentro de tu plugin f\u00e1cilmente. Cada subp\u00e1gina se encargar\u00e1 de una parte distinta del proceso del plugin.","behavior":"degenerate_repetition","conversation_hash":"7d8ce6ed3c6eca348be9138c9d84d9d4","conversation_redacted":false,"conversation_toxic":false,"country":"Peru","empty_output":false,"evidence_codes":[],"label":"absent","label_present":false,"label_qualified":false,"label_source":"Final dense release","language":"Spanish","model":"gpt-4o-2024-08-06","n_chars":130142,"n_turns_in_conversation":2,"n_words":12192,"source_row_offset":21350,"source_shard":"turns-00043.parquet","timestamp":"Sat, 02 Nov 2024 14:14:02 GMT","turn_id":"db3c138993416401b4093136","turn_index":0,"user_text":"<?php\n\n// Evitar el acceso directo al archivo.\nif (!defined('ABSPATH')) {\n    exit;\n}\n\n// Crear la p\u00e1gina de administraci\u00f3n.\nfunction tag_create_admin_menu() {\n    add_menu_page(\n        'SharkContents Article Generator',\n        'SharkContents Article Generator',\n        'manage_options',\n        'SharkContents-article-generator',\n        'tag_admin_page',\n        'dashicons-admin-generic'\n    );\n}\nadd_action('admin_menu', 'tag_create_admin_menu');\n\n// Funciones para obtener los c\u00f3digos de idioma para la API de Serper\nfunction tag_get_gl_code() {\n    $languages = [\n        \"Espa\u00f1ol\" => \"es\",\n        \"Portugu\u00e9s\" => \"br\",\n        \"Sueco\" => \"se\",\n        \"Indonesio\" => \"id\",\n        \"Italiano\" => \"it\",\n        \"Alem\u00e1n\" => \"de\",\n        \"Hebreo\" => \"il\",\n        \"Japon\u00e9s\" => \"jp\",\n        \"Coreano\" => \"kr\",\n        \"Chino Mandarin\" => \"cn\",\n        \"Ingl\u00e9s\" => \"us\",\n        \"Polaco\" => \"pl\",\n        \"\u00c1rabe\" => \"eg\",\n        \"Neerland\u00e9s\" => \"nl\",\n        \"Turco\" => \"tr\",\n        \"Franc\u00e9s\" => \"fr\",\n        \"Hindi\" => \"in\",\n        \"Ruso\" => \"ru\",\n        \"Vietnamita\" => \"vn\",\n        \"Sundan\u00e9s\" => \"sd\",\n        \"Espa\u00f1ol (Per\u00fa)\" => \"pe\",\n        \"Espa\u00f1ol (M\u00e9xico)\" => \"mx\",\n        \"Espa\u00f1ol (Argentina)\" => \"ar\",\n        \"Espa\u00f1ol (Chile)\" => \"cl\",\n        \"Espa\u00f1ol (Colombia)\" => \"co\",\n        \"Espa\u00f1ol (Ecuador)\" => \"ec\",\n        \"Espa\u00f1ol (Venezuela)\" => \"ve\",\n        \"Espa\u00f1ol (Guatemala)\" => \"gt\",\n        \"Espa\u00f1ol (Cuba)\" => \"cu\",\n        \"Espa\u00f1ol (Bolivia)\" => \"bo\",\n        \"Espa\u00f1ol (Hait\u00ed)\" => \"ht\",\n        \"Espa\u00f1ol (Rep\u00fablica Dominicana)\" => \"do\",\n        \"Espa\u00f1ol (Honduras)\" => \"hn\",\n        \"Espa\u00f1ol (Paraguay)\" => \"py\",\n        \"Espa\u00f1ol (Nicaragua)\" => \"ni\",\n        \"Espa\u00f1ol (El Salvador)\" => \"sv\",\n        \"Espa\u00f1ol (Costa Rica)\" => \"cr\",\n        \"Espa\u00f1ol (Puerto Rico)\" => \"pr\",\n        \"Espa\u00f1ol (Panam\u00e1)\" => \"pa\",\n        \"Espa\u00f1ol (Uruguay)\" => \"uy\",\n        \"Espa\u00f1ol (Jamaica)\" => \"jm\",\n        \"Espa\u00f1ol (Trinidad y Tobago)\" => \"tt\",\n        \"Espa\u00f1ol (Belice)\" => \"bz\"\n    ];\n    $selected_language = get_option('tag_language', 'Espa\u00f1ol');\n    return $languages[$selected_language] ?? \"es\";\n}\n\nfunction tag_get_hl_code() {\n    $languages = [\n        \"Espa\u00f1ol\" => \"es\",\n        \"Portugu\u00e9s\" => \"pt-br\",\n        \"Sueco\" => \"sv\",\n        \"Indonesio\" => \"id\",\n        \"Italiano\" => \"it\",\n        \"Alem\u00e1n\" => \"de\",\n        \"Hebreo\" => \"iw\",\n        \"Japon\u00e9s\" => \"ja\",\n        \"Coreano\" => \"ko\",\n        \"Chino Mandarin\" => \"zh-tw\",\n        \"Ingl\u00e9s\" => \"en\",\n        \"Polaco\" => \"pl\",\n        \"\u00c1rabe\" => \"ar\",\n        \"Neerland\u00e9s\" => \"de\", \n        \"Turco\" => \"tr\",\n        \"Franc\u00e9s\" => \"fr\",\n        \"Hindi\" => \"hi\",\n        \"Ruso\" => \"ru\",\n        \"Vietnamita\" => \"vi\",\n        \"Sundan\u00e9s\" => \"su\",\n        \"Espa\u00f1ol (Per\u00fa)\" => \"es\",\n        \"Espa\u00f1ol (M\u00e9xico)\" => \"es\",\n        \"Espa\u00f1ol (Argentina)\" => \"es\",\n        \"Espa\u00f1ol (Chile)\" => \"es\",\n        \"Espa\u00f1ol (Colombia)\" => \"es\",\n        \"Espa\u00f1ol (Ecuador)\" => \"es\",\n        \"Espa\u00f1ol (Venezuela)\" => \"es\",\n        \"Espa\u00f1ol (Guatemala)\" => \"es\",\n        \"Espa\u00f1ol (Cuba)\" => \"es\",\n        \"Espa\u00f1ol (Bolivia)\" => \"es\",\n        \"Espa\u00f1ol (Hait\u00ed)\" => \"es\",\n        \"Espa\u00f1ol (Rep\u00fablica Dominicana)\" => \"es\",\n        \"Espa\u00f1ol (Honduras)\" => \"es\",\n        \"Espa\u00f1ol (Paraguay)\" => \"es\",\n        \"Espa\u00f1ol (Nicaragua)\" => \"es\",\n        \"Espa\u00f1ol (El Salvador)\" => \"es\",\n        \"Espa\u00f1ol (Costa Rica)\" => \"es\",\n        \"Espa\u00f1ol (Puerto Rico)\" => \"es\",\n        \"Espa\u00f1ol (Panam\u00e1)\" => \"es\",\n        \"Espa\u00f1ol (Uruguay)\" => \"es\",\n        \"Espa\u00f1ol (Jamaica)\" => \"es\",\n        \"Espa\u00f1ol (Trinidad y Tobago)\" => \"es\",\n        \"Espa\u00f1ol (Belice)\" => \"es\"\n    ];\n    $selected_language = get_option('tag_language', 'Espa\u00f1ol');\n    return $languages[$selected_language] ?? \"es\";\n}\n\n// Funciones para llamar a la API de Serper con cURL y timeout de 60 segundos\nfunction tag_call_google_serp_dev($title) {\n    $api_keys = explode(\"\\n\", get_option('tag_serper_api_keys'));\n    $serper_api_key = $api_keys[array_rand($api_keys)];\n\n    if (empty($serper_api_key)) {\n        return null;\n    }\n\n    $url = \"https://google.serper.dev/search\";\n    $payload = json_encode([\n        \"q\" => $title,\n        \"gl\" => tag_get_gl_code(), \n        \"hl\" => tag_get_hl_code(), \n        \"autocorrect\" => true,\n        \"page\" => 1,\n        \"type\" => \"search\"\n    ]);\n\n    $ch = curl_init($url);\n    curl_setopt_array($ch, [\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_POST => true,\n        CURLOPT_POSTFIELDS => $payload,\n        CURLOPT_HTTPHEADER => [\n            'X-API-KEY: ' . $serper_api_key,\n            'Content-Type: application/json'\n        ],\n        CURLOPT_TIMEOUT => 60 // Timeout de 60 segundos\n    ]);\n\n    $response = curl_exec($ch);\n    $error = curl_error($ch);\n    curl_close($ch);\n\n    if ($error) {\n        error_log(\"Error en la llamada a la API de Serper (Search): \" . $error);\n        return null;\n    }\n\n    $data = json_decode($response);\n\n    if (isset($data->peopleAlsoAsk)) {\n        return array_map(function($item) { return $item->question; }, $data->peopleAlsoAsk);\n    }\n\n    return null;\n}\n\nfunction tag_call_google_imagen_dev($title) {\n    $api_keys = explode(\"\\n\", get_option('tag_serper_api_keys'));\n    $serper_api_key = $api_keys[array_rand($api_keys)];\n\n    if (empty($serper_api_key)) {\n        return null;\n    }\n\n    $url = \"https://google.serper.dev/images\";\n    $payload = json_encode([\n        \"q\" => $title,\n        \"gl\" => tag_get_gl_code(), \n        \"hl\" => tag_get_hl_code(), \n        \"autocorrect\" => true,\n        \"page\" => 1,\n        \"type\" => \"images\",\n        \"engine\" => \"google\",\n        \"num\" => 1\n    ]);\n\n    $ch = curl_init($url);\n    curl_setopt_array($ch, [\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_POST => true,\n        CURLOPT_POSTFIELDS => $payload,\n        CURLOPT_HTTPHEADER => [\n            'X-API-KEY: ' . $serper_api_key,\n            'Content-Type: application/json'\n        ],\n        CURLOPT_TIMEOUT => 60 // Timeout de 60 segundos\n    ]);\n\n    $response = curl_exec($ch);\n    $error = curl_error($ch);\n    curl_close($ch);\n\n    if ($error) {\n        error_log(\"Error en la llamada a la API de Serper (Images): \" . $error);\n        return null;\n    }\n\n    $data = json_decode($response);\n\n    if (isset($data->images) && isset($data->images[0]->imageUrl)) {\n        return $data->images[0]->imageUrl;\n    }\n\n    return null;\n}\n\n// Funci\u00f3n para obtener el enlace embed del video de YouTube\nfunction tag_call_google_serp_dev_videos($title) {\n    $api_keys = explode(\"\\n\", get_option('tag_serper_api_keys'));\n    $serper_api_key = $api_keys[array_rand($api_keys)];\n\n    if (empty($serper_api_key)) {\n        return null; // Si no hay API key, se omite la funci\u00f3n\n    }\n\n    $url = \"https://google.serper.dev/videos\";\n    $payload = json_encode([\n        \"q\" => $title,\n        \"gl\" => tag_get_gl_code(),\n        \"hl\" => tag_get_hl_code(),\n        \"autocorrect\" => true,\n        \"page\" => 1,\n        \"type\" => \"videos\",\n        \"engine\" => \"google\"\n    ]);\n\n    $ch = curl_init($url);\n    curl_setopt_array($ch, [\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_POST => true,\n        CURLOPT_POSTFIELDS => $payload,\n        CURLOPT_HTTPHEADER => [\n            'X-API-KEY: ' . $serper_api_key,\n            'Content-Type: application/json'\n        ],\n        CURLOPT_TIMEOUT => 60 // Timeout de 60 segundos\n    ]);\n\n    $response = curl_exec($ch);\n    $error = curl_error($ch);\n    curl_close($ch);\n\n    if ($error) {\n        error_log(\"Error en la llamada a la API de Serper (Videos): \" . $error);\n        return null; // Si hay error en la llamada, se omite la funci\u00f3n\n    }\n\n    $data = json_decode($response);\n    $videos = $data->videos ?? []; // Obtener videos o un array vac\u00edo si no hay\n\n    // Regex para identificar el ID del video (11 caracteres alfanum\u00e9ricos)\n    $video_id_regex = '/^[a-zA-Z0-9_-]{11}$/';\n\n    foreach ($videos as $video) {\n        $video_link = $video->link ?? ''; \n\n        if (strpos($video_link, 'youtube.com/watch?v=') !== false) {\n            $video_id = explode(\"watch?v=\", $video_link)[1]; \n            $video_embed_link = \"https://www.youtube.com/embed/$video_id\";\n\n            // Verificar que el ID sea correcto y no sea una playlist\n            if (preg_match($video_id_regex, $video_id) && \n                !preg_match('/\\/embed\\/playlist\\?|\\/watch\\?/', $video_embed_link)) {\n                return $video_embed_link;\n            }\n        }\n    }\n\n    return null; // No se encontr\u00f3 ning\u00fan video v\u00e1lido\n}\n\n// Funci\u00f3n para llamar a la API de Google Maps de Serper\nfunction tag_call_google_maps_dev($title) {\n    $api_keys = explode(\"\\n\", get_option('tag_serper_api_keys'));\n    $serper_api_key = $api_keys[array_rand($api_keys)];\n\n    if (empty($serper_api_key)) {\n        return null;\n    }\n\n    $url = \"https://google.serper.dev/maps\";\n    $payload = json_encode([\n        \"q\" => $title,\n        \"gl\" => tag_get_gl_code(), \n        \"hl\" => tag_get_hl_code(), \n        \"page\" => 1,\n        \"type\" => \"maps\",\n        \"engine\" => \"google\"\n    ]);\n\n    $ch = curl_init($url);\n    curl_setopt_array($ch, [\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_POST => true,\n        CURLOPT_POSTFIELDS => $payload,\n        CURLOPT_HTTPHEADER => [\n            'X-API-KEY: ' . $serper_api_key,\n            'Content-Type: application/json'\n        ],\n        CURLOPT_TIMEOUT => 60 // Timeout de 60 segundos\n    ]);\n\n    $response = curl_exec($ch);\n    $error = curl_error($ch);\n    curl_close($ch);\n\n    if ($error) {\n        error_log(\"Error en la llamada a la API de Serper (Maps): \" . $error);\n        return null;\n    }\n\n    $data = json_decode($response);\n\n    if (isset($data->places)) {\n        $places = [];\n\n        // Limitar la cantidad de lugares a 10\n        $places_data = array_slice($data->places, 0, 10);\n\n        foreach ($places_data as $place_data) {\n            $places[] = [\n                \"title\" => $place_data->title,\n                \"address\" => $place_data->address,\n                \"rating\" => $place_data->rating,\n                \"phoneNumber\" => $place_data->phoneNumber,\n                \"website\" => $place_data->website\n            ];\n        }\n        return $places;\n    }\n\n    return null;\n}\n\n// Funci\u00f3n para llamar a la API de Google Images de Serper para obtener im\u00e1genes de directorio\nfunction tag_call_google_imagen_directorio_dev($title) {\n    $api_keys = explode(\"\\n\", get_option('tag_serper_api_keys'));\n    $serper_api_key = $api_keys[array_rand($api_keys)];\n\n    if (empty($serper_api_key)) {\n        return null;\n    }\n\n    $url = \"https://google.serper.dev/images\";\n    $payload = json_encode([\n        \"q\" => $title,\n        \"gl\" => tag_get_gl_code(), \n        \"hl\" => tag_get_hl_code(), \n        \"autocorrect\" => true,\n        \"page\" => 1,\n        \"type\" => \"images\",\n        \"engine\" => \"google\",\n        \"num\" => 10\n    ]);\n\n    $ch = curl_init($url);\n    curl_setopt_array($ch, [\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_POST => true,\n        CURLOPT_POSTFIELDS => $payload,\n        CURLOPT_HTTPHEADER => [\n            'X-API-KEY: ' . $serper_api_key,\n            'Content-Type: application/json'\n        ],\n        CURLOPT_TIMEOUT => 60 // Timeout de 60 segundos\n    ]);\n\n    $response = curl_exec($ch);\n    $error = curl_error($ch);\n    curl_close($ch);\n\n    if ($error) {\n        error_log(\"Error en la llamada a la API de Serper (Images Directorio): \" . $error);\n        return null;\n    }\n\n    $data = json_decode($response);\n\n    if (isset($data->images)) {\n        $imagenes_filtradas = [];\n        $dominio_no_deseado = \"/https:\\/\\/lookaside\\.fbsbx\\.com\\/|https:\\/\\/lookaside\\.instagram\\.com\\//\";\n        $extensiones_validas = \"/\\.(png|jpg)$/\";\n\n        foreach ($data->images as $imagen) {\n            if (!preg_match($dominio_no_deseado, $imagen->imageUrl)) {\n                $imagenes_filtradas[] = $imagen->imageUrl;\n            } elseif (!preg_match($extensiones_validas, $imagen->imageUrl)) {\n                $imagenes_filtradas[] = $imagen->thumbnailUrl;\n            }\n        }\n\n        if (!empty($imagenes_filtradas)) {\n            return $imagenes_filtradas[0];\n        } elseif (isset($data->images[0]->thumbnailUrl)) {\n            return $data->images[0]->thumbnailUrl;\n        }\n    }\n\n    return null;\n}\n\nfunction search_amazon($title) {\n    $api_keys = explode(\"\\n\", get_option('tag_scraping_dog_api_keys')); // Reemplaza 'tag_scraping_dog_api_keys' con la opci\u00f3n correcta de WordPress\n\n    // Verifica si no hay claves API\n    if (empty($api_keys)) {\n        return null;\n    }\n\n    $amazon_domains = [\n        \"USA\" => \"com\",\n        \"Espa\u00f1a\" => \"es\",\n        \"Jap\u00f3n\" => \"co.jp\",\n        \"Alemania\" => \"de\",\n        \"Australia\" => \"com.au\",\n        \"Brasil\" => \"com.br\",\n        \"Canad\u00e1\" => \"ca\",\n        \"Francia\" => \"fr\",\n        \"India\" => \"in\",\n        \"Italia\" => \"it\",\n        \"M\u00e9xico\" => \"com.mx\",\n        \"Pa\u00edses Bajos\" => \"nl\",\n        \"Arabia Saudita\" => \"sa\",\n\t\t\"Egipto\" => \"eg\",\n        \"Singapur\" => \"sg\",\n        \"Turqu\u00eda\" => \"com.tr\",\n        \"Emiratos \u00c1rabes Unidos\" => \"ae\",\n        \"Reino Unido\" => \"co.uk\",\n        \"Polonia\" => \"pl\",\n\t\t\"Suecia\" => \"se\"\n    ];\n\n    $selected_country = get_option('tag_amazon_country'); // Reemplaza 'tag_amazon_country' con la opci\u00f3n correcta de WordPress\n    $api_url = \"https://api.scrapingdog.com/amazon/search\";\n    $domain = $amazon_domains[$selected_country] ?? \"com\"; // Usa \"com\" por defecto si no se encuentra el pa\u00eds\n    $query = $title;\n\n    $params = [\n        \"domain\" => $domain,\n        \"page\" => 1,\n        \"query\" => $query,\n    ];\n\n    $retries = 0;\n    $max_retries = 3; // Cambiar el n\u00famero de reintentos aqu\u00ed\n\t\n    while (!empty($api_keys) && $retries < $max_retries) {\n        $dog_api = $api_keys[array_rand($api_keys)];\n\n        $params[\"api_key\"] = $dog_api;\n\n        $url = $api_url . '?' . http_build_query($params);\n\n        $ch = curl_init();\n        curl_setopt($ch, CURLOPT_URL, $url);\n        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n        curl_setopt($ch, CURLOPT_TIMEOUT, 300); // Tiempo de espera de 300 segundos (5 minutos)\n\n        $response = curl_exec($ch);\n        $error = curl_error($ch);\n        $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n        curl_close($ch);\n\n        if ($error) {\n            // Manejar el error de cURL\n            error_log(\"Error en la solicitud a la API de ScrapingDog (cURL): \" . $error);\n            $retries++;\n            continue;\n        }\n\n        if ($http_code == 200) {\n            try {\n                $data = json_decode($response, true);\n                $products = array_slice($data[\"results\"], 0, 9); // Asumiendo que quieres los primeros 5 productos\n                return $products;\n            } catch (Exception $e) {\n                if ($e->getMessage() === 'Undefined index: results') { // Maneja solo el error de \u00edndice no definido\n                    return [];\n                } else {\n                    throw $e;  // Propaga otros errores\n                }\n            }\n        } elseif (in_array($http_code, [400, 410, 429])) {\n            if ($http_code == 404) {\n                return [];\n            } else {\n                $key = array_search($dog_api, $api_keys);\n                if ($key !== false) {\n                    unset($api_keys[$key]);\n                }\n            }\n        } else {\n            $retries++;\n        }\n    }\n\n    return [];\n}\n\nfunction get_amazon_domain_suffix() {\n    // Mapeo de pa\u00edses a sufijos de dominio de Amazon\n    $country_suffix_map = [\n        \"USA\" => \"com\",\n        \"Espa\u00f1a\" => \"es\",\n        \"Jap\u00f3n\" => \"co.jp\",\n        \"Alemania\" => \"de\",\n        \"Australia\" => \"com.au\",\n        \"Brasil\" => \"com.br\",\n        \"Canad\u00e1\" => \"ca\",\n        \"Francia\" => \"fr\",\n        \"India\" => \"in\",\n        \"Italia\" => \"it\",\n        \"M\u00e9xico\" => \"com.mx\",\n        \"Pa\u00edses Bajos\" => \"nl\",\n        \"Arabia Saudita\" => \"sa\",\n\t\t\"Egipto\" => \"eg\",\n        \"Singapur\" => \"sg\",\n        \"Turqu\u00eda\" => \"com.tr\",\n        \"Emiratos \u00c1rabes Unidos\" => \"ae\",\n        \"Reino Unido\" => \"co.uk\",\n        \"Polonia\" => \"pl\",\n\t\t\"Suecia\" => \"se\"\n    ];\n\n    // Obtener el pa\u00eds seleccionado\n    $selected_country = get_option('tag_amazon_country'); // Reemplaza 'tag_amazon_country' con la opci\u00f3n correcta de WordPress\n\n    // Obtener el sufijo de dominio correspondiente al pa\u00eds seleccionado\n    $domain_suffix = $country_suffix_map[$selected_country] ?? \"com\"; // Por defecto, usa \"com\" si no se encuentra el pa\u00eds\n\n    return $domain_suffix;\n}\n\nfunction tag_make_api_request($data) {\n    // Obtener las API Keys\n    $api_keys = explode(\"\\n\", get_option('tag_api_keys'));\n    $api_provider = get_option('tag_api_provider', 'groq'); // 'groq' es el valor por defecto\n\n    // Array para almacenar las API Keys temporalmente no disponibles y su tiempo de espera\n    $temp_unavailable_keys = get_option('temp_unavailable_keys_' . $api_provider, array());\n\n    // Eliminar de $api_keys las que est\u00e1n temporalmente no disponibles\n    foreach ($temp_unavailable_keys as $key => $timeout) {\n        if (time() < $timeout) {\n            unset($api_keys[$key]);\n        } else {\n            // Si el tiempo de espera ha expirado, eliminar la key del array de no disponibles\n            unset($temp_unavailable_keys[$key]);\n        }\n    }\n\n    // Guardar el array actualizado de keys no disponibles\n    update_option('temp_unavailable_keys_' . $api_provider, $temp_unavailable_keys);\n\n    // Verificar si quedan API keys disponibles\n    if (empty($api_keys)) {\n        return new WP_Error('no_api_keys', 'No hay API Keys disponibles para este proveedor.');\n    }\n\n    // Seleccionar una API Key al azar\n    $api_key = $api_keys[array_rand($api_keys)];\n\n    // Definir la URL de la API seg\u00fan el proveedor\n    switch ($api_provider) {\n        case 'groq':\n            $url = 'https://api.groq.com/openai/v1/chat/completions';\n            break;\n        case 'together':\n            $url = 'https://api.together.xyz/v1/chat/completions';\n            break;\n        case 'hyperbolic':\n            $url = 'https://api.hyperbolic.xyz/v1/chat/completions';\n            break;\n        case 'OpenAI':\n            $url = 'https://api.openai.com/v1/chat/completions';\n            break;\n        case 'SambanovaAI':\n            $url = 'https://api.sambanova.ai/v1/chat/completions';\n            break;\n        case 'FireworksAI':\n            $url = 'https://api.fireworks.ai/inference/v1/chat/completions';\n            break;\n        case 'Cohere':\n            $url = 'https://api.cohere.com/v2/chat';\n            break;\n        default:\n            return new WP_Error('invalid_api_provider', 'Proveedor de API inv\u00e1lido.');\n    }\n\n    $ch = curl_init($url);\n    curl_setopt_array($ch, array(\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_ENCODING => '',\n        CURLOPT_MAXREDIRS => 10,\n        CURLOPT_TIMEOUT => 300,\n        CURLOPT_FOLLOWLOCATION => true,\n        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n        CURLOPT_CUSTOMREQUEST => 'POST',\n        CURLOPT_POSTFIELDS => json_encode($data),\n        CURLOPT_HTTPHEADER => array(\n            'Content-Type: application/json',\n            'Authorization: Bearer ' . $api_key\n        ),\n    ));\n\n    $response = curl_exec($ch);\n    $err = curl_error($ch);\n    $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n    curl_close($ch);\n\n    // Si hay un error de cURL, retornar el error\n    if ($err) {\n        return new WP_Error('cURL_error', $err);\n    }\n\n    // Comprobar el c\u00f3digo de estado HTTP para todos los proveedores\n    if ($http_code !== 200) {\n        // Agregar la API Key al array de temporalmente no disponibles con un tiempo de espera de 20 segundos\n        $temp_unavailable_keys[$api_key] = time() + 20;\n        update_option('temp_unavailable_keys_' . $api_provider, $temp_unavailable_keys);\n\n        // Intentar con otra API Key (recursivo), incluyendo las que est\u00e9n en espera\n        return tag_make_api_request($data);\n    }\n\n    // Decodificar la respuesta JSON\n    $decoded_response = json_decode($response);\n\n    // Verificar si la respuesta es v\u00e1lida\n    if (json_last_error() !== JSON_ERROR_NONE) {\n        return new WP_Error('json_decode_error', 'Error al decodificar la respuesta JSON.');\n    }\n\n    // Adaptar la respuesta de Cohere para simular la estructura de OpenAI\n    if ($api_provider === 'Cohere' && isset($decoded_response->message->content[0]->text)) {\n        $decoded_response->choices = [];\n        $decoded_response->choices[0] = new stdClass();\n        $decoded_response->choices[0]->message = new stdClass();\n        $decoded_response->choices[0]->message->content = $decoded_response->message->content[0]->text;\n    }\n\n    // Retornar la respuesta decodificada\n    return $decoded_response;\n}\n\nfunction tag_remove_underscores($text) {\n    $text = str_replace('_', ' ', $text);\n    // Eliminar espacios en blanco dobles\n    $text = preg_replace('/\\s+/', ' ', $text);\n    return $text;\n}\n\n// Funci\u00f3n para filtrar contenido no deseado.\nfunction tag_filter_content($content) {\n    $unwanted_chars = [\n        '<!DOCTYPE html>', '<html lang=\"es\">', '</head>', '</html>',\n        '<head>', '<meta charset=\"UTF-8\">', '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">',\n        '</title>', '<body>', '</body>', 'style=\"color:4caf50;\"', '\"','\u53ef\u4ee5','\u9053\u8def','\u0644\u062f\u064a\u0647','\u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06af\u0627\u0632','\u58f9','\ubaa8\ub4e0','\ub2e4\uc591\ud55c','\ub9dd\uc744','\u8a29'\n    ];\n    $ilimitado_chars = [\n        '<html lang=\"ja\">', '<style>', '</style>', 'h2, h3 {font-family: \"Arial\", sans-serif;}', '<section>', '</section>',\n        'Preguntas Frecuentes sobre', '```html', '```', 'Hola,', 'Buenas tardes,', 'Respuesta:',\n        'Como periodista profesional que habla y escribe solo espa\u00f1ol,', 'Hola. Estoy aqu\u00ed para responder tu pregunta.','\u0638\u0645','\u062f\u0646\u06cc','\u062b\u0628\u062a \u062a\u0631\u06cc\u0646','\u062f\u0646\u06cc','\uc544\ub2c8\ub77c','\uc218\uc758','\u30af\u30ed'\n    ];\n    $ilimitado23_chars = [\n        'Subjudul H3:', '#', 'Respuesta:', 'Buenas tardes,', 'Hola,', 'Gracias por su pregunta.',\n        'Espero que esta informaci\u00f3n te sea \u00fatil', 'Me alegra poder asistirte en espa\u00f1ol.',\n        'Hola. Gracias por tu pregunta.', 'Subt\u00edtulos H3 Relacionados:', 'Subt\u00edtulos H3:',\n        'Me complace responderte en espa\u00f1ol.', 'Conclusi\u00f3n:', 'Conclusi\u00f3n', 'Hola. Estoy aqu\u00ed para responder tu pregunta.',\n        'Subt\u00edtulo H2:'\n    ];\n    $extra_chars = [\n        'Subt\u00edtulo H2', 'Titulo H3', 'H3:', 'introducci\u00f3n', '#', '*', 'H2', 'Title:',\n        'Introduction:', 'Introducci\u00f3n:', '<html lang=\"it\">', '<title>', '<h3>Preguntas frecuentes:</h3>',\n        'HTML:', '\u56de\u7b54:', 'Respuesta:',':::::::::::','\u3185'\n    ];\n\n    foreach (array_merge($unwanted_chars, $ilimitado_chars, $ilimitado23_chars, $extra_chars) as $char) {\n        $content = str_replace($char, '', $content);\n    }\n\n    return $content;\n}\n\n// Funci\u00f3n para verificar si es nicho directorio\nfunction is_rese\u00f1as_individuales_niche() {\n    $is_resenas = get_option('tag_niche_type');\n    return $is_resenas === 'si'; // Ajusta 'si' seg\u00fan el valor que indica que es rese\u00f1as individuales\n}\n\nfunction tag_process_places_queue() {\n    // Verificar si la configuraci\u00f3n es de nicho de rese\u00f1as individuales\n    if (!is_rese\u00f1as_individuales_niche()) {\n        return; // Detener la funci\u00f3n si no es nicho de rese\u00f1as individuales\n    }\n\n    $queue = get_option('tag_article_queue', array());\n    $failed_titles = get_option('tag_failed_titles', array());\n    $created_titles = get_option('tag_created_titles', array());\n    $Tematica = get_option('tag_tematica_directorio', '');\n    $categories = explode('|', sanitize_text_field(get_option('tag_categories')));\n    $faqs_title = get_option('tag_faqs_title', 'Preguntas Frecuentes');\n\n    // Obtener el idioma seleccionado\n    $language = get_option('tag_language', 'Espa\u00f1ol');\n\n    // Ajustar el idioma para las variantes del espa\u00f1ol\n    $spanishVariants = array(\n        'Espa\u00f1ol (Per\u00fa)', 'Espa\u00f1ol (M\u00e9xico)', 'Espa\u00f1ol (Argentina)', 'Espa\u00f1ol (Chile)',\n        'Espa\u00f1ol (Colombia)', 'Espa\u00f1ol (Ecuador)', 'Espa\u00f1ol (Venezuela)', 'Espa\u00f1ol (Guatemala)',\n        'Espa\u00f1ol (Cuba)', 'Espa\u00f1ol (Bolivia)', 'Espa\u00f1ol (Hait\u00ed)', 'Espa\u00f1ol (Rep\u00fablica Dominicana)',\n        'Espa\u00f1ol (Honduras)', 'Espa\u00f1ol (Paraguay)', 'Espa\u00f1ol (Nicaragua)', 'Espa\u00f1ol (El Salvador)',\n        'Espa\u00f1ol (Costa Rica)', 'Espa\u00f1ol (Puerto Rico)', 'Espa\u00f1ol (Panam\u00e1)', 'Espa\u00f1ol (Uruguay)',\n        'Espa\u00f1ol (Jamaica)', 'Espa\u00f1ol (Trinidad y Tobago)', 'Espa\u00f1ol (Belice)'\n    );\n    if (in_array($language, $spanishVariants)) {\n        $language = 'Espa\u00f1ol';\n    }\n\n    // Obtener el modelo seleccionado\n    $model = get_option('tag_model', 'meta-llama/Llama-3-70b-chat-hf');\n\n    if (!empty($queue)) {\n        $titulo = array_shift($queue); // T\u00edtulo principal de la cola\n\n        // --- Obtener datos de los lugares desde Google Maps (Serper) UNA SOLA VEZ ---\n        $places = tag_call_google_maps_dev($titulo);\n\n        if (!empty($places)) {\n            $max_posts_per_run = 10; // Define la cantidad m\u00e1xima de posts a crear por ejecuci\u00f3n\n            $posts_created = 0;      // Contador de posts creados en esta ejecuci\u00f3n\n\n            foreach ($places as $place) {\n                // --- Verificar si ya existe un post en WordPress con el mismo t\u00edtulo ---\n                $existing_post = get_page_by_title($place['title'], OBJECT, 'post');\n                if ($existing_post) {\n                    error_log(\"Ya existe un post con el t\u00edtulo: '\" . $place['title'] . \"'\");\n                    continue; // Saltar al siguiente lugar si ya existe un post\n                }\n\t\t\t\t\n\t\t\t\t// --- Verificar si ya existe un post en WordPress con el mismo t\u00edtulo ---\n                $sanitized_title = sanitize_title(trim($place['title']));\n                $existing_post = get_page_by_path($sanitized_title, OBJECT, 'post');\n                if ($existing_post) {\n                   error_log(\"Ya existe un post con el t\u00edtulo sanitizado: '\" . $sanitized_title . \"'\");\n                   continue; // Saltar al siguiente lugar si ya existe un post\n                 }\n\n                // --- Verificar si el t\u00edtulo ya ha sido procesado (est\u00e1 en la lista de creados) ---\n                if (in_array(trim($place['title']), $created_titles)) {\n                    error_log(\"El t\u00edtulo '\" . $place['title'] . \"' ya ha sido procesado.\");\n                    continue; // Saltar al siguiente lugar si ya se ha procesado\n                }\n\n                // --- Limitar la cantidad de posts creados ---\n                if ($posts_created >= $max_posts_per_run) {\n                    error_log(\"Se ha alcanzado el l\u00edmite de posts por ejecuci\u00f3n ($max_posts_per_run).\");\n                    break; // Salir del bucle foreach si se ha alcanzado el l\u00edmite\n                }\n\n                // Seleccionar una categor\u00eda aleatoria correctamente\n                $randomCategoryIndex = array_rand($categories);\n                $selectedCategory = $categories[$randomCategoryIndex];\n\n                // Generar la introducci\u00f3n para el lugar\n                $intro_place_prompt = \"Crea una introducci\u00f3n de 90 palabras para un art\u00edculo sobre: '\" . $place['title'] . \"', que es de la ciudad de $titulo, en idioma $language. a base de la tematica:'$Tematica'. No incluyas ning\u00fan otro texto ante de la introducci\u00f3n. No hagas ninguna traducci\u00f3n innecesaria, no hables ning\u00fan otro idioma que no fuera solo $language.\";\n                $data_intro_place = array(\n                    'model' => $model,\n                    'messages' => array(\n                        array('role' => 'system', 'content' => 'Eres un redactor nativo en ' . $language . ' y escribes de manera neutral solo en ' . $language . '.'),\n                        array('role' => 'user', 'content' => $intro_place_prompt)\n                    ),\n                    'temperature' => 0.75,\n                    'max_tokens' => 250,\n                );\n                $response_intro_place = tag_make_api_request($data_intro_place);\n\n                if (is_wp_error($response_intro_place)) {\n                    error_log(\"Error en la generaci\u00f3n de la introducci\u00f3n del lugar: \" . $response_intro_place->get_error_message());\n                    $failed_titles[] = trim($place['title']);\n                    update_option('tag_failed_titles', $failed_titles);\n                    continue;\n                }\n\n                $intro = tag_filter_content($response_intro_place->choices[0]->message->content);\n                $intro = str_replace('\"', '', $intro);\n\n                // Generar la rese\u00f1a para el lugar\n                $review_place_prompt = \"Por favor, no me saludes, Solo Crea una rese\u00f1a para: '\" . $place['title'] . \"' a base de la tematica: '$Tematica', puedes usar estos datos para la rese\u00f1a: \" . $place['address'] . \", \" . $place['phoneNumber'] . \", \" . $place['website'] . \" y \" . $place['rating'] . \" en $language. No hables ning\u00fan otro idioma que no fuera solo $language.\";\n                $data_review_place = array(\n                    'model' => $model,\n                    'messages' => array(\n                        array('role' => 'system', 'content' => 'Eres un redactor nativo en ' . $language . ' y escribes de manera neutral solo en ' . $language . '.'),\n                        array('role' => 'user', 'content' => $review_place_prompt)\n                    ),\n                    'temperature' => 0.75,\n                    'max_tokens' => 2000,\n                );\n                $response_review_place = tag_make_api_request($data_review_place);\n\n                if (is_wp_error($response_review_place)) {\n                    error_log(\"Error en la generaci\u00f3n de la rese\u00f1a del lugar: \" . $response_review_place->get_error_message());\n                    $failed_titles[] = trim($place['title']);\n                    update_option('tag_failed_titles', $failed_titles);\n                    continue;\n                }\n\n                $response = tag_filter_content($response_review_place->choices[0]->message->content);\n                $response = preg_replace('/\\*\\*(.*?)\\*\\*/', '<strong>$1</strong>', $response);\n\n                // Generar las preguntas frecuentes para el lugar\n                $faqs_place_prompt = \"Crea 4 Preguntas Frecuentes en $language, Acerca de: '\" . $place['title'] . \"' a base de la tematica: '$Tematica'. Formatea cada pregunta como subt\u00edtulo H3 en HTML '<h3></h3>' y responde inmediatamente despu\u00e9s de cada pregunta con p\u00e1rrafos extensos en $language, utilizando negritas en HTML '<strong></strong>' para las palabras m\u00e1s relevantes. puedes usar estos datos: \" . $place['address'] . \", \" . $place['phoneNumber'] . \", \" . $place['website'] . \" y \" . $place['rating'] . \" en $language. No saludes antes de las preguntas, no hables ning\u00fan otro idioma que no fuera solo $language.\";\n                $data_faqs_place = array(\n                    'model' => $model,\n                    'messages' => array(\n                        array('role' => 'system', 'content' => 'Eres un redactor nativo en ' . $language . ' y escribes de manera neutral solo en ' . $language . '.'),\n                        array('role' => 'user', 'content' => $faqs_place_prompt)\n                    ),\n                    'temperature' => 0.75,\n                    'max_tokens' => 2000,\n                );\n                $response_faqs_place = tag_make_api_request($data_faqs_place);\n\n                if (is_wp_error($response_faqs_place)) {\n                    error_log(\"Error en la generaci\u00f3n de las preguntas frecuentes del lugar: \" . $response_faqs_place->get_error_message());\n                    $failed_titles[] = trim($place['title']);\n                    update_option('tag_failed_titles', $failed_titles);\n                    continue;\n                }\n\n                $faqs = tag_filter_content($response_faqs_place->choices[0]->message->content);\n                $faqs = preg_replace('/\\*\\*(.*?)\\*\\*/', '<strong>$1</strong>', $faqs);\n\t\t\t\t$imagen_link = tag_call_google_imagen_directorio_dev($place['title']);\n\t\t\t\t$shortcode_de_resena = \"[hostal_shortcode titulo=\\\"\" . $place['title'] . \"\\\" direccion=\\\"\" . $place['address'] . \"\\\" imagen_url=\\\"\" . $imagen_link . \"\\\" telefono=\\\"\" . $place['phoneNumber'] . \"\\\" como_llegar_url=\\\"\" . $place['website'] . \"\\\" rating=\\\"\" . $place['rating'] . \"/5\\\"]\";\n\n\n                // Verificar si el contenido tiene datos antes de crear el post\n                if (!empty($intro) && !empty($response) && !empty($faqs)) {\n                    // Crear el post en WordPress\n                    $post_data = array(\n                        'post_title' => sanitize_text_field($place['title']),\n                        'post_content' => $intro . \"\\n\\n\" . $shortcode_de_resena . \"\\n\\n\" . $response . \"\\n\\n<h2>\" . sanitize_text_field($faqs_title) . \"</h2>\" . $faqs,\n                        'post_status' => sanitize_text_field(get_option('tag_post_status', 'draft')),\n                        'post_category' => array(get_cat_ID($selectedCategory))\n                    );\n\n                    $post_id = wp_insert_post($post_data);\n\n                    if (!is_wp_error($post_id)) {\n                        error_log(\"Post creado exitosamente con el t\u00edtulo: '\" . $place['title'] . \"'\");\n                        $created_titles[] = trim($place['title']);\n                         // Incrementar el contador de posts creados, pero solo si es menor que el l\u00edmite\n                       if ($posts_created < $max_posts_per_run) {\n                          $posts_created++;\n                         }\n                    } else {\n                        error_log(\"Error al crear el post para el t\u00edtulo: '\" . $place['title'] . \"'\");\n                        $failed_titles[] = trim($place['title']);\n                    }\n\n                    update_option('tag_created_titles', $created_titles);\n                    update_option('tag_failed_titles', $failed_titles);\n                } else {\n                    // Manejar caso de contenido vac\u00edo\n                    error_log(\"No se puede crear el post, el contenido est\u00e1 vac\u00edo para el t\u00edtulo: \" . esc_html($place['title']));\n                    $failed_titles[] = trim($place['title']);\n                    update_option('tag_failed_titles', $failed_titles);\n\t\t\t\t\t$serper_consulted_titles = get_option('tag_serper_consulted_titles', array());\n                    if (($key = array_search($title, $serper_consulted_titles)) !== false) {\n                     unset($serper_consulted_titles[$key]);\n                     }\n                     update_option('tag_serper_consulted_titles', $serper_consulted_titles);\n                }\n\n\n            }\n\n            // Actualizar la cola eliminando el t\u00edtulo principal si se han creado todos los posts posibles\n            if ($posts_created >= $max_posts_per_run) {\n                error_log(\"Se complet\u00f3 la creaci\u00f3n de posts para el t\u00edtulo: '\" . $titulo . \"'\");\n            } else {\n                error_log(\"Se procesaron todos los lugares posibles para el t\u00edtulo: '\" . $titulo . \"'\");\n            }\n        }\n\n        update_option('tag_article_queue', $queue); // Guardar la cola actualizada\n    }\n}\n\n// Funci\u00f3n para verificar si es nicho directorio\nfunction is_directorio_niche() {\n    $is_directorio = get_option('tag_nicho_directorio');\n    return $is_directorio === 'si'; // Ajusta 'si' seg\u00fan el valor que indica que es nicho directorio\n}\n\nfunction tag_process_directorio_queue() {\n    // Verificar si la configuraci\u00f3n es de nicho de directorio\n    if (!is_directorio_niche()) {\n        return; // Detener la funci\u00f3n si no es nicho de directorio\n    }\n\n    // --- Verificar si las API Keys de Serper est\u00e1n configuradas ---\n    $serper_api_keys = get_option('tag_serper_api_keys');\n    if (empty($serper_api_keys)) {\n        // Manejar el caso en que las API Keys de Serper no est\u00e1n configuradas\n        error_log(\"Error: Las API Keys de Serper son obligatorias para el nicho de directorio.\");\n        // Opcional: puedes mostrar un mensaje de error en la interfaz del plugin aqu\u00ed\n        return; // Detener la ejecuci\u00f3n de la funci\u00f3n\n    }\n    // -------------------------------------------------------------\n\n    $queue = get_option('tag_article_queue', array());\n    $failed_titles = get_option('tag_failed_titles', array());\n    // Array para almacenar los t\u00edtulos consultados a Serper\n    $serper_consulted_titles = get_option('tag_serper_consulted_titles', array());\n\n    if (!empty($queue)) {\n        $title = array_shift($queue);\n        $created_titles = get_option('tag_created_titles', array());\n        $delay = intval(get_option('tag_article_delay'));\n        $categories = explode('|', sanitize_text_field(get_option('tag_categories')));\n        $Tematica = get_option('tag_tematica_directorio', ''); // Obtener la tem\u00e1tica, valor por defecto vac\u00edo\n\n        // --- Verificar si ya existe un post con el mismo t\u00edtulo ---\n        $existing_post = get_page_by_title( $title, OBJECT, 'post' );\n        if ( $existing_post ) {\n            error_log(\"Ya existe un post con el t\u00edtulo: '$title'\");\n            update_option('tag_article_queue', $queue); // Actualizar la cola sin procesar este t\u00edtulo\n            return;\n        }\n\t\t\n\t\t// --- Verificar si el t\u00edtulo ya ha sido consultado a Serper ---\n        if (in_array($title, $serper_consulted_titles)) {\n            error_log(\"El t\u00edtulo '$title' ya ha sido consultado a Serper.\");\n            update_option('tag_article_queue', $queue); // Actualizar la cola sin procesar este t\u00edtulo\n            return;\n        }\n        // -------------------------------------------------------\n\n        // Obtener el idioma seleccionado\n        $language = get_option('tag_language', 'Espa\u00f1ol');\n\n        // Ajustar el idioma para las variantes del espa\u00f1ol\n        $spanishVariants = array(\n            'Espa\u00f1ol (Per\u00fa)', 'Espa\u00f1ol (M\u00e9xico)', 'Espa\u00f1ol (Argentina)', 'Espa\u00f1ol (Chile)',\n            'Espa\u00f1ol (Colombia)', 'Espa\u00f1ol (Ecuador)', 'Espa\u00f1ol (Venezuela)', 'Espa\u00f1ol (Guatemala)',\n            'Espa\u00f1ol (Cuba)', 'Espa\u00f1ol (Bolivia)', 'Espa\u00f1ol (Hait\u00ed)', 'Espa\u00f1ol (Rep\u00fablica Dominicana)',\n            'Espa\u00f1ol (Honduras)', 'Espa\u00f1ol (Paraguay)', 'Espa\u00f1ol (Nicaragua)', 'Espa\u00f1ol (El Salvador)',\n            'Espa\u00f1ol (Costa Rica)', 'Espa\u00f1ol (Puerto Rico)', 'Espa\u00f1ol (Panam\u00e1)', 'Espa\u00f1ol (Uruguay)',\n            'Espa\u00f1ol (Jamaica)', 'Espa\u00f1ol (Trinidad y Tobago)', 'Espa\u00f1ol (Belice)'\n        );\n        if (in_array($language, $spanishVariants)) {\n            $language = 'Espa\u00f1ol';\n        }\n\n        // Obtener el modelo seleccionado\n        $model = get_option('tag_model', 'meta-llama/Llama-3-70b-chat-hf');\n\n        // Definir los prompts.\n        $intro_prompt = get_option('tag_intro_prompt', \"Crea una introducci\u00f3n de 100 palabras, en idioma $language, para un art\u00edculo sobre: '$title'. No incluyas ning\u00fan otro texto antes de la introducci\u00f3n. No saludes, ni respondas nada m\u00e1s, ni hagas ninguna traducci\u00f3n innecesaria. No hables ning\u00fan otro idioma que no fuera solo $language.\");\n        $faqs_prompt = get_option('tag_faqs_prompt', \"Solo Crea unicamente 4 Preguntas Frecuentes en $language, acerca de '$title'. Formatea cada pregunta como subt\u00edtulo H3 en HTML '<h3></h3>' y responde inmediatamente despu\u00e9s de cada pregunta con un p\u00e1rrafo extenso en $language, utilizando negritas en HTML '<strong></strong>' para las palabras m\u00e1s relevantes. No incluyas ning\u00fan otro texto antes de las preguntas. No saludes antes de las preguntas, no hables ning\u00fan otro idioma que no fuera solo $language.\");\n\t\t$system_prompt = get_option('tag_system_prompt', \"Eres un redactor nativo en ' . $language . ' y escribes de manera neutral solo en ' . $language . '. \");\n\t\t\n\t\t$intro_prompt = str_replace(['$title', '$language'], [$title, $language], $intro_prompt);\n\t\t$faqs_prompt = str_replace(['$title', '$language'], [$title, $language], $faqs_prompt);\n\t\t$system_prompt = str_replace('$language', $language, $system_prompt);\n\n        // --- Llamar a las funciones de Serper solo si hay API keys configuradas ---\n        if (!empty($serper_api_keys)) {\n            $youtube_video_url = tag_call_google_serp_dev_videos($title);\n            $places_data = tag_call_google_maps_dev($title); // Obtener datos de lugares\n\n            // --- Agregar el t\u00edtulo a la lista de t\u00edtulos consultados a Serper ---\n            $serper_consulted_titles[] = $title;\n            update_option('tag_serper_consulted_titles', $serper_consulted_titles);\n\n        } else {\n            $youtube_video_url = null;\n            $places_data = null;\n        }\n\n        // ----------------------------------------------------------------------\n\n        // Datos para la llamada a la API.\n        $data_intro = array(\n            'model' => $model,\n            'messages' => array(\n                array('role' => 'system', 'content' => $system_prompt),\n                array('role' => 'user', 'content' => $intro_prompt)\n            ),\n            'temperature' => 0.90,\n            'max_tokens' => 500,\n        );\n\t\t\n\t\t// Datos para la llamada a la API.\n        $prompt_h2_2 = array(\n            'model' => $model,\n            'messages' => array(\n                array('role' => 'system', 'content' => $system_prompt),\n                array('role' => 'user', 'content' => 'Crea 1 subt\u00edtulo H2 que aborde sobre la tematica: ' . $title . ' en ' . $language . '. Coloca ese subt\u00edtulo en HTML \"<h2></h2>\". no hables ningun otro idioma que no fuera solo ' . $language . '')\n            ),\n            'temperature' => 0.90,\n            'max_tokens' => 500,\n        );\n\n        $data_faqs = array(\n            'model' => $model,\n            'messages' => array(\n                array('role' => 'system', 'content' => $system_prompt),\n                array('role' => 'user', 'content' => $faqs_prompt)\n            ),\n            'temperature' => 0.90,\n            'max_tokens' => 2000,\n        );\n\n        // Realizar solicitudes a la API para intro y faqs.\n        $response_intro = tag_make_api_request($data_intro);\n        $response_faqs = tag_make_api_request($data_faqs);\n\t\t$prompt_h2_2 = tag_make_api_request($prompt_h2_2);\n\n        // Verificar si alguna de las respuestas es un error o est\u00e1 vac\u00eda\n        if (is_wp_error($response_intro) || is_wp_error($response_faqs) || is_wp_error($prompt_h2_2) || \n            empty($response_intro) || empty($response_faqs) || empty($prompt_h2_2)) {\n    \n            // Obtener la lista actual de t\u00edtulos fallidos\n            $failed_titles = get_option('tag_failed_titles', array());\n\n            // Agregar el t\u00edtulo fallido a la lista\n            $failed_titles[] = $title; // Usar la variable $title que contiene el t\u00edtulo fallido\n\n            // Actualizar la opci\u00f3n con la nueva lista de t\u00edtulos fallidos\n            update_option('tag_failed_titles', array_unique($failed_titles));\n    \n            // Actualizar la cola de art\u00edculos\n            $queue = get_option('tag_article_queue', array());\n\n            // Eliminar el t\u00edtulo fallido de la cola\n            if (($key = array_search($title, $queue)) !== false) {\n                unset($queue[$key]);\n            }\n\n            // Guardar la cola actualizada\n            update_option('tag_article_queue', $queue);\n\n            // Detener el proceso para evitar m\u00e1s operaciones con este t\u00edtulo fallido\n            return;\n        }\n\n        $intro = tag_filter_content($response_intro->choices[0]->message->content);\n        $intro = str_replace($title, '', $intro);\n\t\t$prompt_h2_2 = tag_filter_content($prompt_h2_2->choices[0]->message->content);\n        $faqs = tag_filter_content($response_faqs->choices[0]->message->content);\n        $faqs = tag_remove_underscores($faqs);\n\n        // Obtener el t\u00edtulo del H2 de Preguntas Frecuentes\n        $faqs_title = get_option('tag_faqs_title', 'Preguntas Frecuentes');\n\n        // Seleccionar una categor\u00eda aleatoria correctamente\n        $randomCategoryIndex = array_rand($categories);\n        $selectedCategory = $categories[$randomCategoryIndex];\n\n        // --- Generar contenido para nicho directorio ---\n        if (!empty($places_data)) {\n            $datos_places = \"\";\n            foreach ($places_data as $place) {\n                // Generar la rese\u00f1a para el lugar (para el post principal)\n                $review_place_prompt = \"Crea una rese\u00f1a corta para: '\" . $place['title'] . \"' a base de la tematica:' . $Tematica . '. Puedes usar estos datos para la rese\u00f1a: \" . $place['address'] . \", \" . $place['phoneNumber'] . \", \" . $place['website'] . \" y \" . $place['rating'] . \". No hables ningun otro idioma que no fuera solo $language. M\u00e1ximo 200 palabras.\";\n                $data_review_place = array(\n                    'model' => $model,\n                    'messages' => array(\n                        array('role' => 'system', 'content' => $system_prompt),\n                        array('role' => 'user', 'content' => $review_place_prompt)\n                    ),\n                    'temperature' => 0.75,\n                    'max_tokens' => 1000,\n                );\n                $response_review_place = tag_make_api_request($data_review_place);\n\n                if (is_wp_error($response_review_place)) {\n                    // Manejar errores de la API\n                    error_log(\"Error en la generaci\u00f3n de la rese\u00f1a del lugar: \" . $response_review_place->get_error_message());\n                    continue;\n                }\n\n                $review_place = tag_filter_content($response_review_place->choices[0]->message->content);\n                $review_place = preg_replace('/\\*\\*(.*?)\\*\\*/', '<strong>$1</strong>', $review_place);\n\n                // Obtener la imagen para el lugar\n                $imagen_link = tag_call_google_imagen_directorio_dev($place['title']);\n\n                // Crear el shortcode para el lugar\n                $shortcode_place = \"[hostal_shortcode titulo=\\\"\" . $place['title'] . \"\\\" direccion=\\\"\" . $place['address'] . \"\\\" imagen_url=\\\"\" . $imagen_link . \"\\\" telefono=\\\"\" . $place['phoneNumber'] . \"\\\" como_llegar_url=\\\"\" . $place['website'] . \"\\\" rating=\\\"\" . $place['rating'] . \"/5\\\"]\";\n\n                // Agregar la informaci\u00f3n al contenido del post principal\n                $datos_places .= \"<h3>\" . $place['title'] . \"</h3>\\n\";\n                $datos_places .= \"$shortcode_place\\n\";\n                $datos_places .= $review_place . \"\\n\"; \n            }\n\n            // Verificar que el contenido no est\u00e9 vac\u00edo antes de crear el post\n            if (!empty($intro) && !empty($prompt_h2_2) && !empty($datos_places) && !empty($faqs)) {\n                // Crear el post principal del directorio\n                $post_data = array(\n                    'post_title'    => sanitize_text_field($title),\n                    'post_content'  => wp_kses_post(\"$intro\\n\\n$youtube_video_url\\n\\n$prompt_h2_2\\n\\n$datos_places\\n\\n<h2>$faqs_title</h2>\\n$faqs\"),\n                    'post_status'   => get_option('tag_post_status', 'publish'),\n                    'post_author'   => 1,\n                    'post_category' => array(get_cat_ID($selectedCategory))\n                );\n\n                $post_id = wp_insert_post($post_data);\n\n                if (is_wp_error($post_id)) {\n                    // Manejar errores al crear el post\n                    error_log(\"Error al crear el post principal del directorio: \" . $post_id->get_error_message());\n                    // Agregar el t\u00edtulo a la lista de fallidos\n                    $failed_titles[] = trim($title);\n                    update_option('tag_failed_titles', array_unique($failed_titles));\n\t\t\t\t\t$serper_consulted_titles = get_option('tag_serper_consulted_titles', array());\n                    if (($key = array_search($title, $serper_consulted_titles)) !== false) {\n                     unset($serper_consulted_titles[$key]);\n                    }\n                    update_option('tag_serper_consulted_titles', $serper_consulted_titles);\n                } else {\n                    // Agregar t\u00edtulo a la lista de t\u00edtulos creados.\n                    $created_titles[] = trim($title);\n                    update_option('tag_created_titles', array_unique($created_titles));\n                    // Registrar el \u00e9xito en los logs (opcional)\n                    error_log(\"Post creado con \u00e9xito: \" . get_edit_post_link($post_id) . \" - \" . esc_html($title));\n                }\n            } else {\n                // Manejar caso de contenido vac\u00edo\n                error_log(\"No se puede crear el post principal del directorio, el contenido est\u00e1 vac\u00edo para el t\u00edtulo: \" . esc_html($title));\n\n                // Agregar el t\u00edtulo a la lista de fallidos\n                $failed_titles[] = trim($title);\n                update_option('tag_failed_titles', array_unique($failed_titles));\n\t\t\t\t$serper_consulted_titles = get_option('tag_serper_consulted_titles', array());\n                if (($key = array_search($title, $serper_consulted_titles)) !== false) {\n                   unset($serper_consulted_titles[$key]);\n                }\n                update_option('tag_serper_consulted_titles', $serper_consulted_titles);\n            }\n\n            // Actualizar la cola\n            update_option('tag_article_queue', $queue);\n        }\n    } \n}\n\nfunction tag_process_article_queue() {\n    // Verificar si la configuraci\u00f3n NO es de nicho de directorio NI de rese\u00f1as individuales NI DE AMAZON SIN API\n    if (is_directorio_niche() || is_rese\u00f1as_individuales_niche() || is_amazon_sin_api_niche()) {\n        return;\n    }\n\n    // Array para almacenar los t\u00edtulos consultados a Serper\n    $serper_consulted_titles = get_option('tag_serper_consulted_titles', array());\n\n    $queue = get_option('tag_article_queue', array());\n    $failed_titles = get_option('tag_failed_titles', array());\n\n    if (!empty($queue)) {\n        $title = array_shift($queue);\n        $created_titles = get_option('tag_created_titles', array());\n        $delay = intval(get_option('tag_article_delay'));\n        $categories = explode('|', sanitize_text_field(get_option('tag_categories')));\n\n        // --- Verificar si ya existe un post con el mismo t\u00edtulo ---\n        $args = array(\n          'post_type' => 'post', // Especificar el tipo de post como 'post'\n          'title' => $title, // Buscar por el t\u00edtulo\n          'posts_per_page' => 1 // Limitar la b\u00fasqueda a un solo post\n\t\t);\n        $existing_post = get_posts($args);\n        if (!empty($existing_post)) {\n            error_log(\"Ya existe un post con el t\u00edtulo: '$title'\");\n            update_option('tag_article_queue', $queue); // Actualizar la cola sin procesar este t\u00edtulo\n            return;\n        }\n\n        // --- Verificar si el t\u00edtulo ya ha sido consultado a Serper ---\n        if (in_array($title, $serper_consulted_titles)) {\n            error_log(\"El t\u00edtulo '$title' ya ha sido consultado a Serper.\");\n            update_option('tag_article_queue', $queue); // Actualizar la cola sin procesar este t\u00edtulo\n            return;\n        }\n\n        // Obtener el idioma seleccionado\n        $language = get_option('tag_language', 'Espa\u00f1ol');\n\n        // Ajustar el idioma para las variantes del espa\u00f1ol\n        $spanishVariants = array(\n            'Espa\u00f1ol (Per\u00fa)', 'Espa\u00f1ol (M\u00e9xico)', 'Espa\u00f1ol (Argentina)', 'Espa\u00f1ol (Chile)',\n            'Espa\u00f1ol (Colombia)', 'Espa\u00f1ol (Ecuador)', 'Espa\u00f1ol (Venezuela)', 'Espa\u00f1ol (Guatemala)',\n            'Espa\u00f1ol (Cuba)', 'Espa\u00f1ol (Bolivia)', 'Espa\u00f1ol (Hait\u00ed)', 'Espa\u00f1ol (Rep\u00fablica Dominicana)',\n            'Espa\u00f1ol (Honduras)', 'Espa\u00f1ol (Paraguay)', 'Espa\u00f1ol (Nicaragua)', 'Espa\u00f1ol (El Salvador)',\n            'Espa\u00f1ol (Costa Rica)', 'Espa\u00f1ol (Puerto Rico)', 'Espa\u00f1ol (Panam\u00e1)', 'Espa\u00f1ol (Uruguay)',\n            'Espa\u00f1ol (Jamaica)', 'Espa\u00f1ol (Trinidad y Tobago)', 'Espa\u00f1ol (Belice)'\n        );\n        if (in_array($language, $spanishVariants)) {\n            $language = 'Espa\u00f1ol';\n        }\n\n        // Obtener el modelo seleccionado\n        $model = get_option('tag_model', 'meta-llama/Llama-3-70b-chat-hf');\n\n        // Definir los prompts.\n        $intro_prompt = get_option('tag_intro_prompt', \"Crea una introducci\u00f3n de 100 palabras, en idioma $language, para un art\u00edculo sobre: '$title'. No incluyas ning\u00fan otro texto antes de la                 introducci\u00f3n. No saludes, ni respondas nada m\u00e1s, ni hagas ninguna traducci\u00f3n innecesaria. No hables ning\u00fan otro idioma que no fuera solo $language.\");\n        $subtitles_prompt = get_option('tag_subtitles_prompt', \"Crea 1 subt\u00edtulo H2 relacionado a la tem\u00e1tica: '$title' en $language. Coloca ese subt\u00edtulo en HTML '<h2></h2>' y luego responde de forma detallada en $language y agrega tambi\u00e9n 5 Subt\u00edtulos H3 informacionales en $language sobre '$title' en HTML '<h3></h3>' y responde cada Subt\u00edtulo h3 de forma detallada y a\u00f1ade una tabla con el formato: '<table></table>' y pon en negrita en HTML '<strong></strong>' las palabras m\u00e1s relevantes en $language y no vayas a a\u00f1adir una conclusi\u00f3n final, no hables ning\u00fan otro idioma que no fuera solo $language.\");\n        $faqs_prompt = get_option('tag_faqs_prompt', \"Solo Crea unicamente 4 Preguntas Frecuentes en $language, acerca de '$title'. Formatea cada pregunta como subt\u00edtulo H3 en HTML '<h3></h3>' y responde inmediatamente despu\u00e9s de cada pregunta con un p\u00e1rrafo extenso en $language, utilizando negritas en HTML '<strong></strong>' para las palabras m\u00e1s relevantes. No incluyas ning\u00fan otro texto antes de las preguntas. No saludes antes de las preguntas, no hables ning\u00fan otro idioma que no fuera solo $language.\");\n        $system_prompt = get_option('tag_system_prompt', \"Eres un redactor nativo en ' . $language . ' y escribes de manera neutral solo en ' . $language . '. \");\n\n        $intro_prompt = str_replace(['$title', '$language'], [$title, $language], $intro_prompt);\n        $subtitles_prompt = str_replace(['$title', '$language'], [$title, $language], $subtitles_prompt);\n        $faqs_prompt = str_replace(['$title', '$language'], [$title, $language], $faqs_prompt);\n        $system_prompt = str_replace('$language', $language, $system_prompt); // Reemplazar $language en $system_prompt\n\n        // --- Llamar a las funciones de Serper solo si hay API keys configuradas ---\n        $serper_api_keys = get_option('tag_serper_api_keys');\n        if (!empty($serper_api_keys)) {\n            $related_questions = tag_call_google_serp_dev($title);\n            $youtube_video_url = tag_call_google_serp_dev_videos($title);\n\n            // --- Agregar el t\u00edtulo a la lista de t\u00edtulos consultados a Serper ---\n            $serper_consulted_titles[] = $title;\n            update_option('tag_serper_consulted_titles', $serper_consulted_titles);\n\n        } else {\n            $related_questions = null;\n            $youtube_video_url = null;\n        }\n        // ----------------------------------------------------------------------\n\n        // Datos para la llamada a la API.\n        $data_intro = array(\n            'model' => $model,\n            'messages' => array(\n                array('role' => 'system', 'content' => $system_prompt),\n                array('role' => 'user', 'content' => $intro_prompt)\n            ),\n            'temperature' => 0.90,\n            'max_tokens' => 500,\n        );\n\n        // Datos para la llamada a la API para determinar la categor\u00eda.\n        $data_categoria = array(\n            'model' => $model,\n            'messages' => array(\n                array('role' => 'system', 'content' => $system_prompt),\n                array('role' => 'user', 'content' => \"Determina la categor\u00eda m\u00e1s adecuada para el art\u00edculo: '$title'. Las categor\u00edas posibles son: \" . implode('|', $categories) . \". No crees ni respondas, solo elige una de estas: \" . implode('|', $categories))\n            ),\n            'temperature' => 0.75,\n            'max_tokens' => 2000,\n        );\n\n        $data_subtitles = array(\n            'model' => $model,\n            'messages' => array(\n                array('role' => 'system', 'content' => $system_prompt),\n                array('role' => 'user', 'content' => $subtitles_prompt)\n            ),\n            'temperature' => 0.90,\n            'max_tokens' => 2500,\n        );\n\n        $data_faqs = array(\n            'model' => $model,\n            'messages' => array(\n                array('role' => 'system', 'content' => $system_prompt),\n                array('role' => 'user', 'content' => $faqs_prompt)\n            ),\n            'temperature' => 0.90,\n            'max_tokens' => 2000,\n        );\n\n        // Realizar solicitudes a la API.\n        $response_intro = tag_make_api_request($data_intro);\n        $response_subtitles = tag_make_api_request($data_subtitles);\n        $response_faqs = tag_make_api_request($data_faqs);\n        $response_categoria = tag_make_api_request($data_categoria);\n\n        // Verificar si alguna de las respuestas es un error o est\u00e1 vac\u00eda\n        if (is_wp_error($response_intro) || is_wp_error($response_faqs) || is_wp_error($response_categoria) || is_wp_error($response_subtitles) ||\n            empty($response_intro) || empty($response_faqs) || empty($response_categoria) || empty($response_subtitles)) {\n\n            // Obtener la lista actual de t\u00edtulos fallidos\n            $failed_titles = get_option('tag_failed_titles', array());\n\n            // Agregar el t\u00edtulo fallido a la lista\n            $failed_titles[] = $title; // Usar la variable $title que contiene el t\u00edtulo fallido\n\n            // Actualizar la opci\u00f3n con la nueva lista de t\u00edtulos fallidos\n            update_option('tag_failed_titles', array_unique($failed_titles));\n\n            // Actualizar la cola de art\u00edculos\n            $queue = get_option('tag_article_queue', array());\n\n            // Eliminar el t\u00edtulo fallido de la cola\n            if (($key = array_search($title, $queue)) !== false) {\n                unset($queue[$key]);\n            }\n\n            // Guardar la cola actualizada\n            update_option('tag_article_queue', $queue);\n\n            // Detener el proceso para evitar m\u00e1s operaciones con este t\u00edtulo fallido\n            return;\n        }\n\n        $intro = tag_filter_content($response_intro->choices[0]->message->content);\n        $intro = str_replace($title, '', $intro);\n        $subtitles = tag_filter_content($response_subtitles->choices[0]->message->content);\n        $faqs = tag_filter_content($response_faqs->choices[0]->message->content);\n        $categoria_elegida = tag_filter_content($response_categoria->choices[0]->message->content);\n\n        // Quitar caracteres \"_\" y reemplazarlos con un espacio\n        $subtitles = tag_remove_underscores($subtitles);\n        $faqs = tag_remove_underscores($faqs);\n\n        // Obtener el t\u00edtulo del H2 de Preguntas Frecuentes\n        $faqs_title = get_option('tag_faqs_title', 'Preguntas Frecuentes');\n\n        // Obtener la ID de la categor\u00eda elegida por la IA\n        $selected_category_id = get_cat_ID($categoria_elegida);\n\n        // Si la categor\u00eda no existe, usar una categor\u00eda aleatoria\n        if (!$selected_category_id) {\n            $randomCategoryIndex = array_rand($categories);\n            $selectedCategory = $categories[$randomCategoryIndex];\n            $selected_category_id = get_cat_ID($selectedCategory);\n        }\n\n        // --- Generar respuestas para las preguntas de Serper con Together (solo si hay preguntas) ---\n        $questions_and_answers = \"\";\n        if ($related_questions) {\n            foreach ($related_questions as $question) {\n                // Generar la respuesta con Together\n                $question_prompt = get_option('tag_question_prompt', \"Por favor, no me saludes, Solo Responde Detalladamente en: '{$language}', la siguiente pregunta: {$question}. Y agrega tambi\u00e9n 3 Subt\u00edtulos H3 Relacionados en '{$language}' sobre {$question} en HTML '<h3></h3>' y responde cada Subt\u00edtulo h3 de forma detallada con un p\u00e1rrafo y un formato lista para enriquecer el texto: '<ol><li></li><li></li><li></li></ol>', en '{$language}', y pon en negrita en HTML '<strong></strong>' las palabras m\u00e1s relevantes. No saludes al finalizar, NO HAGAS NINGUNA CONCLUSION, no hables ning\u00fan otro idioma que no fuera solo '{$language}'.\");\n                $question_prompt = str_replace(['$question', '$language'], [$question, $language], $question_prompt);\n\n                $data_question = array(\n                    'model' => $model,\n                    'messages' => array(\n                        array('role' => 'system', 'content' => $system_prompt),\n                        array('role' => 'user', 'content' => $question_prompt)\n                    ),\n                    'temperature' => 0.90, // Puedes ajustar la temperatura\n                    'max_tokens' => 2000, // Puedes ajustar el n\u00famero m\u00e1ximo de tokens\n                );\n                $response_question = tag_make_api_request($data_question);\n                if (is_wp_error($response_question)) {\n                    error_log(\"Error en la generaci\u00f3n de la respuesta para la pregunta: \" . $question . \" - \" . $response_question->get_error_message());\n                    continue;\n                }\n                $answer = tag_filter_content($response_question->choices[0]->message->content);\n                $answer = str_replace($question, '', $answer);\n\n                // Eliminar todas las preguntas de $related_questions de la respuesta:\n                foreach ($related_questions as $q) {\n                    $answer = str_replace($q, '', $answer);\n                }\n\n                // Obtener la imagen relacionada (solo si hay API keys configuradas)\n                if (!empty($serper_api_keys)) {\n                    $image_url = tag_call_google_imagen_dev($question);\n                } else {\n                    $image_url = null;\n                }\n                $image_html = $image_url ? \"<p style='text-align: center;'><img src='\" . esc_url($image_url) . \"' style='display: block; margin: 0 auto;'></p>\" : \"\";\n\n                // Combinar la pregunta, la imagen y la respuesta\n                $questions_and_answers .= \"<h2>\" . esc_html($question) . \"</h2>\" . $image_html . $answer;\n            }\n        }\n        // -------------------------------------------------------------------------------------------\n\n\n        // Crear el post en WordPress solo si el contenido no est\u00e1 vac\u00edo\n        if (!empty($intro) && !empty($faqs) && !empty($subtitles)) {\n            // Preparar los datos del post\n            $post_data = array(\n                'post_title' => sanitize_text_field($title),\n                'post_content' => wp_kses_post(\"$intro\\n\\n$youtube_video_url\\n\\n$subtitles\\n\\n$questions_and_answers\\n\\n<h2>$faqs_title</h2>\\n$faqs\"),\n                'post_status' => get_option('tag_post_status', 'publish'), // Obtener el estado del post\n                'post_author' => 1, // ID del autor. Cambiar seg\u00fan sea necesario.\n                'post_category' => array(get_cat_ID($categoria_elegida)) // Asignar la categor\u00eda por ID usando get_cat_ID\n            );\n\n            // Insertar el post\n            $post_id = wp_insert_post($post_data);\n\n            // Manejar el resultado de la inserci\u00f3n\n            if (is_wp_error($post_id)) {\n                // Manejar errores al crear el post\n                error_log(\"Error al crear el post: \" . $post_id->get_error_message());\n\n                // Agregar el t\u00edtulo a la lista de fallidos\n                $failed_titles[] = trim($title);\n                update_option('tag_failed_titles', array_unique($failed_titles));\n\t\t\t\t\n        $serper_consulted_titles = get_option('tag_serper_consulted_titles', array());\n        if (($key = array_search($title, $serper_consulted_titles)) !== false) {\n            unset($serper_consulted_titles[$key]);\n        }\n        update_option('tag_serper_consulted_titles', $serper_consulted_titles);\n            } else {\n                // Agregar el t\u00edtulo a la lista de t\u00edtulos creados\n                $created_titles[] = trim($title);\n                update_option('tag_created_titles', array_unique($created_titles));\n\n                // Registrar el \u00e9xito en los logs (opcional)\n                error_log(\"Post creado con \u00e9xito: \" . get_edit_post_link($post_id) . \" - \" . esc_html($title));\n            }\n        } else {\n            // Manejar caso de contenido vac\u00edo\n            error_log(\"No se puede crear el post, el contenido est\u00e1 vac\u00edo para el t\u00edtulo: \" . esc_html($title));\n\n            // Agregar el t\u00edtulo a la lista de fallidos\n            $failed_titles[] = trim($title);\n            update_option('tag_failed_titles', array_unique($failed_titles));\n\t\t\t\n\t\t\t$serper_consulted_titles = get_option('tag_serper_consulted_titles', array());\n        if (($key = array_search($title, $serper_consulted_titles)) !== false) {\n            unset($serper_consulted_titles[$key]);\n        }\n        update_option('tag_serper_consulted_titles', $serper_consulted_titles);\n        }\n\n        // Actualizar la cola\n        update_option('tag_article_queue', $queue);\n    }\n}\n\n// Funci\u00f3n para verificar si es nicho amazon sin api\nfunction is_amazon_sin_api_niche() {\n    $is_amazon = get_option('tag_amazon_sin_api_niche');\n    return $is_amazon === 'si'; // Ajusta 'si' seg\u00fan el valor que indica que es nicho amazon sin api\n}\n\nfunction tag_process_amazon_sin_api_queue() {\n    // Verificar si la configuraci\u00f3n es de nicho de amazon sin api\n    if (!is_amazon_sin_api_niche()) {\n        return; // Detener la funci\u00f3n si no es nicho de amazon sin api\n    }\n\n    // Variable global para almacenar el \u00faltimo t\u00edtulo de cola procesado\n    global $tag_last_processed_title;\n\n    // Array para almacenar los t\u00edtulos consultados a Serper\n    $serper_consulted_titles = get_option('tag_serper_consulted_titles', array());\n\n    $queue = get_option('tag_article_queue', array());\n    $failed_titles = get_option('tag_failed_titles', array());\n\n    if (!empty($queue)) {\n        $title = array_shift($queue);\n        $created_titles = get_option('tag_created_titles', array());\n        $delay = intval(get_option('tag_article_delay'));\n        $categories = explode('|', sanitize_text_field(get_option('tag_categories')));\n\n        // --- Verificar si ya existe un post con el mismo t\u00edtulo ---\n        $existing_post = get_page_by_title($title, OBJECT, 'post');\n        if ($existing_post) {\n            error_log(\"Ya existe un post con el t\u00edtulo: '$title'\");\n            update_option('tag_article_queue', $queue); // Actualizar la cola sin procesar este t\u00edtulo\n            return;\n        }\n\n        // --- Verificar si el t\u00edtulo ya ha sido consultado a Serper ---\n        if (in_array($title, $serper_consulted_titles)) {\n            error_log(\"El t\u00edtulo '$title' ya ha sido consultado a Serper.\");\n            update_option('tag_article_queue', $queue); // Actualizar la cola sin procesar este t\u00edtulo\n            return;\n        }\n\n        $language = get_option('tag_language', 'Espa\u00f1ol');\n        $id_afiliado = get_option('tag_amazon_affiliate_id');\n        $domain_suffix = get_amazon_domain_suffix();\n\n        // Ajustar el idioma para las variantes del espa\u00f1ol\n        $spanishVariants = array(\n            'Espa\u00f1ol (Per\u00fa)', 'Espa\u00f1ol (M\u00e9xico)', 'Espa\u00f1ol (Argentina)', 'Espa\u00f1ol (Chile)',\n            'Espa\u00f1ol (Colombia)', 'Espa\u00f1ol (Ecuador)', 'Espa\u00f1ol (Venezuela)', 'Espa\u00f1ol (Guatemala)',\n            'Espa\u00f1ol (Cuba)', 'Espa\u00f1ol (Bolivia)', 'Espa\u00f1ol (Hait\u00ed)', 'Espa\u00f1ol (Rep\u00fablica Dominicana)',\n            'Espa\u00f1ol (Honduras)', 'Espa\u00f1ol (Paraguay)', 'Espa\u00f1ol (Nicaragua)', 'Espa\u00f1ol (El Salvador)',\n            'Espa\u00f1ol (Costa Rica)', 'Espa\u00f1ol (Puerto Rico)', 'Espa\u00f1ol (Panam\u00e1)', 'Espa\u00f1ol (Uruguay)',\n            'Espa\u00f1ol (Jamaica)', 'Espa\u00f1ol (Trinidad y Tobago)', 'Espa\u00f1ol (Belice)'\n        );\n        if (in_array($language, $spanishVariants)) {\n            $language = 'Espa\u00f1ol';\n        }\n\n        // Obtener el modelo seleccionado\n        $model = get_option('tag_model', 'meta-llama/Llama-3-70b-chat-hf');\n\n        // Definir los prompts.\n        $intro_prompt = get_option('tag_intro_prompt', \"Crea una introducci\u00f3n de 100 palabras, en idioma $language, para un art\u00edculo sobre: '$title'. No incluyas ning\u00fan otro texto antes de la introducci\u00f3n. No saludes, ni respondas nada m\u00e1s, ni hagas ninguna traducci\u00f3n innecesaria. No hables ning\u00fan otro idioma que no fuera solo $language.\");\n        $faqs_prompt = get_option('tag_faqs_prompt', \"Solo Crea unicamente 4 Preguntas Frecuentes en $language, acerca de '$title'. Formatea cada pregunta como subt\u00edtulo H3 en HTML '<h3></h3>' y responde inmediatamente despu\u00e9s de cada pregunta con un p\u00e1rrafo extenso en $language, utilizando negritas en HTML '<strong></strong>' para las palabras m\u00e1s relevantes. No incluyas ning\u00fan otro texto antes de las preguntas. No saludes antes de las preguntas, no hables ning\u00fan otro idioma que no fuera solo $language.\");\n        $system_prompt = get_option('tag_system_prompt', \"Eres un redactor nativo en ' . $language . ' y escribes de manera neutral solo en ' . $language . '. \");\n\n        $intro_prompt = str_replace(['$title', '$language'], [$title, $language], $intro_prompt);\n        $faqs_prompt = str_replace(['$title', '$language'], [$title, $language], $faqs_prompt);\n        $system_prompt = str_replace('$language', $language, $system_prompt); // Reemplazar $language en $system_prompt\n\n        // --- Llamar a las funciones de Serper solo si hay API keys configuradas ---\n        $serper_api_keys = get_option('tag_serper_api_keys');\n        if (!empty($serper_api_keys)) {\n            $related_questions = tag_call_google_serp_dev($title);\n            $youtube_video_url = tag_call_google_serp_dev_videos($title);\n\n            // --- Agregar el t\u00edtulo a la lista de t\u00edtulos consultados a Serper ---\n            $serper_consulted_titles[] = $title;\n            update_option('tag_serper_consulted_titles', $serper_consulted_titles);\n\n        } else {\n            $related_questions = null;\n            $youtube_video_url = null;\n        }\n        // ----------------------------------------------------------------------\n\n        // Datos para la llamada a la API.\n        $data_intro = array(\n            'model' => $model,\n            'messages' => array(\n                array('role' => 'system', 'content' => $system_prompt),\n                array('role' => 'user', 'content' => $intro_prompt)\n            ),\n            'temperature' => 0.90,\n            'max_tokens' => 500,\n        );\n\n        // Datos para la llamada a la API para determinar la categor\u00eda.\n        $data_categoria = array(\n            'model' => $model,\n            'messages' => array(\n                array('role' => 'system', 'content' => $system_prompt),\n                array('role' => 'user', 'content' => \"Determina la categor\u00eda m\u00e1s adecuada para el art\u00edculo: '$title'. Las categor\u00edas posibles son: \" . implode('|', $categories) . \". No crees ni respondas, solo elige una de estas: \" . implode('|', $categories))\n            ),\n            'temperature' => 0.75,\n            'max_tokens' => 2000,\n        );\n\n        // Datos para la llamada a la API.\n        $prompt_h2_2 = array(\n            'model' => $model,\n            'messages' => array(\n                array('role' => 'system', 'content' => $system_prompt),\n                array('role' => 'user', 'content' => 'Crea 1 subt\u00edtulo H2 en ' . $language . ' que comience con una de las siguientes frases: \"Los Mejores\", \"Top Rese\u00f1as\", \"Las Mejores Opciones\", seguido del tema: ' . $title . '. Devu\u00e9lvelo en formato HTML \"<h2></h2>\" y solo en ' . $language . '')\n            ),\n            'temperature' => 0.90,\n            'max_tokens' => 500,\n        );\n\n        $data_faqs = array(\n            'model' => $model,\n            'messages' => array(\n                array('role' => 'system', 'content' => $system_prompt),\n                array('role' => 'user', 'content' => $faqs_prompt)\n            ),\n            'temperature' => 0.90,\n            'max_tokens' => 2000,\n        );\n\n        // Realizar solicitudes a la API.\n        $response_intro = tag_make_api_request($data_intro);\n        $prompt_h2 = tag_make_api_request($prompt_h2_2);\n        $response_faqs = tag_make_api_request($data_faqs);\n        $response_categoria = tag_make_api_request($data_categoria);\n\n        // Generar el t\u00edtulo SEO del POST con la IA\n        $titulo_seo_post_prompt = \"Crea un t\u00edtulo SEO optimizado no muy largo para un art\u00edculo sobre ' . $title . ' en ' . $language . '. NO SALUDES AL FINALIZAR. solo devuelve el titulo creado nada mas. no hables ningun otro idioma que no fuera solo ' . $language . '.\";\n        $data_titulo_seo_post = [\n            'model' => $model,\n            'messages' => [\n                ['role' => 'system', 'content' => $system_prompt],\n                ['role' => 'user', 'content' => $titulo_seo_post_prompt]\n            ],\n            'temperature' => 0.75,\n            'max_tokens' => 2000,\n        ];\n        $response_titulo_seo_post = tag_make_api_request($data_titulo_seo_post);\n\n        if (is_wp_error($response_titulo_seo_post)) {\n            error_log(\"Error al generar el t\u00edtulo SEO del post: \" . $response_titulo_seo_post->get_error_message());\n            // Manejo de errores...\n        } else {\n            $titulo_seo_post = tag_filter_content($response_titulo_seo_post->choices[0]->message->content);\n            $titulo_seo_post = str_replace('\"', '', $titulo_seo_post);\n        }\n\n        // Verificar si alguna de las respuestas es un error o est\u00e1 vac\u00eda\n        if (is_wp_error($response_intro) || is_wp_error($response_faqs) || is_wp_error($response_categoria) || is_wp_error($prompt_h2) || is_wp_error($response_titulo_seo_post) ||\n            empty($response_intro) || empty($response_faqs) || empty($response_categoria) || empty($prompt_h2) || empty($titulo_seo_post)) {\n\n            // Obtener la lista actual de t\u00edtulos fallidos\n            $failed_titles = get_option('tag_failed_titles', array());\n\n            // Agregar el t\u00edtulo fallido a la lista\n            $failed_titles[] = $title; // Usar la variable $title que contiene el t\u00edtulo fallido\n\n            // Actualizar la opci\u00f3n con la nueva lista de t\u00edtulos fallidos\n            update_option('tag_failed_titles', array_unique($failed_titles));\n\n            // Actualizar la cola de art\u00edculos\n            $queue = get_option('tag_article_queue', array());\n\n            // Eliminar el t\u00edtulo fallido de la cola\n            if (($key = array_search($title, $queue)) !== false) {\n                unset($queue[$key]);\n            }\n\n            // Guardar la cola actualizada\n            update_option('tag_article_queue', $queue);\n\n            // Detener el proceso para evitar m\u00e1s operaciones con este t\u00edtulo fallido\n            return;\n        }\n\n        $intro = tag_filter_content($response_intro->choices[0]->message->content);\n        $intro = str_replace($title, '', $intro);\n        $prompt_h2 = tag_filter_content($prompt_h2->choices[0]->message->content);\n        $prompt_h2_arreglado = preg_replace('/\\b(2021|2022|2023)\\b/', '2024', $prompt_h2);\n        $faqs = tag_filter_content($response_faqs->choices[0]->message->content);\n        $faqs = tag_remove_underscores($faqs);\n        $categoria_elegida = tag_filter_content($response_categoria->choices[0]->message->content);\n\n        // Obtener el t\u00edtulo del H2 de Preguntas Frecuentes\n        $faqs_title = get_option('tag_faqs_title', 'Preguntas Frecuentes');\n\n        // Obtener la ID de la categor\u00eda elegida por la IA\n        $selected_category_id = get_cat_ID($categoria_elegida);\n\n        // Si la categor\u00eda no existe, usar una categor\u00eda aleatoria\n        if (!$selected_category_id) {\n            $randomCategoryIndex = array_rand($categories);\n            $selectedCategory = $categories[$randomCategoryIndex];\n            $selected_category_id = get_cat_ID($selectedCategory);\n        }\n\n        // --- Buscar productos de Amazon ---\n\n\n        if ($language === 'Japon\u00e9s' || $language === '\u00c1rabe' || $language === 'Turco' || $language === 'Polaco' || $language === 'Neerland\u00e9s' || $language === 'Sueco' || $language === 'Alem\u00e1n' || $language === 'Franc\u00e9s') {\n            // --- Traducir el t\u00edtulo al ingl\u00e9s si el idioma es japon\u00e9s ---\n            $translation_prompt = \"Traduce el siguiente texto al ingl\u00e9s: '$title'. No saludes AL EMPEZAR, NO SALUDES al finalizar, solo devuelve la traducci\u00f3n.\";\n            $data_translation = [\n                'model' => $model,\n                'messages' => [\n                    ['role' => 'system', 'content' => 'Eres un traductor experto ingles.'],\n                    ['role' => 'user', 'content' => $translation_prompt]\n                ],\n                'temperature' => 0.90,\n                'max_tokens' => 1500,\n            ];\n            $response_translation = tag_make_api_request($data_translation);\n\n            if (is_wp_error($response_translation)) {\n                error_log(\"Error al traducir el t\u00edtulo: \" . $response_translation->get_error_message());\n                // Manejo de errores... (puedes optar por no buscar productos en este caso)\n            } else {\n                $english_title = tag_filter_content($response_translation->choices[0]->message->content);\n                $english_title = str_replace('\"', '', $english_title);\n                $products = search_amazon($english_title); // Buscar en Amazon con el t\u00edtulo en ingl\u00e9s\n            }\n        } else {\n            $products = search_amazon($title); // Buscar en Amazon con el t\u00edtulo original\n        }\n        $product_list = [];\n        if (!empty($products)) {\n            foreach ($products as $product) {\n                try {\n                    if (isset($product['url']) && strpos($product['url'], '/dp/') !== false && isset($product['title'])) {\n                        $domain_suffix = get_amazon_domain_suffix();\n                        $asin = explode('/dp/', $product['url'])[1];\n                        $asin = explode('/', $asin)[0];\n                        $apilink = \"https://www.amazon.{$domain_suffix}/dp/{$asin}?tag={$id_afiliado}\"; // Reemplaza {id_afiliado} con tu ID de afiliado\n                        $stars = $product['stars'] ?? 'N/A';\n                        $total_reviews = $product['total_reviews'] ?? '5/5';\n\n                        // Limpiar el t\u00edtulo del producto\n                        $clean_title = str_replace(['|', '\"', '/', '{', '}', '[', ']', '(', ')'], '', $product['title']);\n\n                        // Construir el shortcode\n                        $product_shortcode = \"[amazon nombre=\\\"{$clean_title}\\\" enlace=\\\"{$apilink}\\\" imagen=\\\"{$product['image']}\\\"]\";\n\n                        // Solo agregar el shortcode a la lista\n                        $product_list[] = $product_shortcode;\n                    }\n                } catch (Exception $e) {\n                    continue;\n                }\n            }\n\n            // Unir todos los shortcodes en una sola cadena\n            $Hamazon = implode(\"\\n\", $product_list);\n        }\n\n        // --- Generar respuestas para las preguntas de Serper con Together (solo si hay preguntas) ---\n        $questions_and_answers = \"\";\n        if ($related_questions) {\n            foreach ($related_questions as $question) {\n                // Generar la respuesta con Together\n                $question_prompt = get_option('tag_question_prompt', \"Por favor, no me saludes, Solo Responde Detalladamente en: '{$language}', la siguiente pregunta: {$question}. Y agrega tambi\u00e9n 3 Subt\u00edtulos H3 Relacionados en '{$language}' sobre {$question} en HTML '<h3></h3>' y responde cada Subt\u00edtulo h3 de forma detallada con un p\u00e1rrafo y un formato lista para enriquecer el texto: '<ol><li></li><li></li><li></li></ol>', en '{$language}', y pon en negrita en HTML '<strong></strong>' las palabras m\u00e1s relevantes. No saludes al finalizar, NO HAGAS NINGUNA CONCLUSION, no hables ning\u00fan otro idioma que no fuera solo '{$language}'.\");\n                $question_prompt = str_replace(['$question', '$language'], [$question, $language], $question_prompt);\n                $data_question = array(\n                    'model' => $model,\n                    'messages' => array(\n                        array('role' => 'system', 'content' => $system_prompt),\n                        array('role' => 'user', 'content' => $question_prompt)\n                    ),\n                    'temperature' => 0.90, // Puedes ajustar la temperatura\n                    'max_tokens' => 2000, // Puedes ajustar el n\u00famero m\u00e1ximo de tokens\n                );\n                $response_question = tag_make_api_request($data_question);\n                if (is_wp_error($response_question)) {\n                    error_log(\"Error en la generaci\u00f3n de la respuesta para la pregunta: \" . $question . \" - \" . $response_question->get_error_message());\n                    continue;\n                }\n                $answer = tag_filter_content($response_question->choices[0]->message->content);\n                $answer = str_replace($question, '', $answer);\n                // Eliminar todas las preguntas de $related_questions de la respuesta:\n                foreach ($related_questions as $q) {\n                    $answer = str_replace($q, '', $answer);\n                }\n                // Obtener la imagen relacionada (solo si hay API keys configuradas)\n                if (!empty($serper_api_keys)) {\n                    $image_url = tag_call_google_imagen_dev($question);\n                } else {\n                    $image_url = null;\n                }\n                $image_html = $image_url ? \"<p style='text-align: center;'><img src='\" . esc_url($image_url) . \"' style='display: block; margin: 0 auto;'></p>\" : \"\";\n\n                // Combinar la pregunta, la imagen y la respuesta\n                $questions_and_answers .= \"<h2>\" . esc_html($question) . \"</h2>\" . $image_html . $answer;\n            }\n        }\n        // -------------------------------------------------------------------------------------------\n\n        // --- Verificar si el t\u00edtulo de la cola ya ha sido procesado ---\n        if ($title === $tag_last_processed_title) {\n            error_log(\"El t\u00edtulo de la cola '$title' ya ha sido procesado en esta ejecuci\u00f3n.\");\n            update_option('tag_article_queue', $queue); // Actualizar la cola\n            return; // Detener la funci\u00f3n\n        }\n\n        // --- Si $Hamazon est\u00e1 vac\u00edo, vaciar tambi\u00e9n $prompt_h2 ---\n        if (empty($Hamazon)) {\n            $prompt_h2_arreglado = \"\";\n        }\n\n        // Verificar si el contenido tiene datos antes de crear el post\n        if (!empty($intro) && !empty($questions_and_answers) && !empty($faqs)) {\n            // Crear el post en WordPress.\n            $post_data = array(\n                'post_title'    => sanitize_text_field($titulo_seo_post),\n                'post_content'  => wp_kses_post(\"$intro\\n\\n$prompt_h2_arreglado\\n\\n$Hamazon\\n\\n$questions_and_answers\\n\\n$youtube_video_url\\n\\n<h2>$faqs_title</h2>\\n$faqs\"),\n                'post_status'   => get_option('tag_post_status', 'publish'), // Obtener el estado del post\n                'post_author'   => 1, // ID del autor. Cambiar seg\u00fan sea necesario.\n                'post_category' => array(get_cat_ID($categoria_elegida)) // Asignar la categor\u00eda por ID usando get_cat_ID\n            );\n\n            // Insertar el post\n            $post_id = wp_insert_post($post_data);\n\n            // Manejar el resultado de la inserci\u00f3n\n            if (is_wp_error($post_id)) {\n                // Manejar errores al crear el post\n                error_log(\"Error al crear el post: \" . $post_id->get_error_message());\n\n                // Agregar el t\u00edtulo a la lista de fallidos\n                $failed_titles[] = trim($title);\n                update_option('tag_failed_titles', array_unique($failed_titles));\n\t\t\t\t\n\t\t\t\t// *** A\u00d1ADIR EL C\u00d3DIGO AQU\u00cd ***\n        // Eliminar el t\u00edtulo de la lista de t\u00edtulos consultados a Serper\n        $serper_consulted_titles = get_option('tag_serper_consulted_titles', array());\n        if (($key = array_search($title, $serper_consulted_titles)) !== false) {\n            unset($serper_consulted_titles[$key]);\n        }\n        update_option('tag_serper_consulted_titles', $serper_consulted_titles);\n        // *** FIN DEL C\u00d3DIGO A\u00d1ADIDO ***\n        // \n            } else {\n                // Guardar el t\u00edtulo de la cola como \u00faltimo procesado\n                $tag_last_processed_title = $title;\n\n                // Agregar t\u00edtulo a la lista de t\u00edtulos creados\n                $created_titles[] = trim($title);\n                update_option('tag_created_titles', array_unique($created_titles)); // CORREGIDO\n\n                // Registrar el \u00e9xito en los logs (opcional)\n                error_log(\"Post creado con \u00e9xito: \" . get_edit_post_link($post_id) . \" - \" . esc_html($title));\n            }\n        } else {\n            // Manejar caso de contenido vac\u00edo\n            error_log(\"No se puede crear el post, el contenido est\u00e1 vac\u00edo para el t\u00edtulo: \" . esc_html($title));\n\n            // Agregar el t\u00edtulo a la lista de fallidos\n            $failed_titles[] = trim($title);\n            update_option('tag_failed_titles', array_unique($failed_titles));\n\t\t\t\n\t\t\t// *** A\u00d1ADIR EL C\u00d3DIGO AQU\u00cd ***\n        // Eliminar el t\u00edtulo de la lista de t\u00edtulos consultados a Serper\n        $serper_consulted_titles = get_option('tag_serper_consulted_titles', array());\n        if (($key = array_search($title, $serper_consulted_titles)) !== false) {\n            unset($serper_consulted_titles[$key]);\n        }\n        update_option('tag_serper_consulted_titles', $serper_consulted_titles);\n        // *** FIN DEL C\u00d3DIGO A\u00d1ADIDO ***\n        }\n\n        // Actualizar la cola\n        update_option('tag_article_queue', $queue);\n    }\n}\n\nfunction tag_schedule_article_generation() {\n    // Obt\u00e9n el tiempo de espera de la base de datos\n    $delay = get_option('tag_article_delay', 60); // Valor por defecto de 60 segundos si no est\u00e1 configurado\n\n    // A\u00f1ade o actualiza los eventos cron con el intervalo configurado\n    if (!wp_next_scheduled('tag_generate_directorio_cron')) {\n        wp_schedule_event(time(), 'custom_interval', 'tag_generate_directorio_cron');\n    }\n    if (!wp_next_scheduled('tag_generate_articles_cron')) {\n        wp_schedule_event(time(), 'custom_interval', 'tag_generate_articles_cron');\n    }\n    if (!wp_next_scheduled('tag_generate_places_cron')) {\n        wp_schedule_event(time(), 'custom_interval', 'tag_generate_places_cron');\n    }\n    if (!wp_next_scheduled('tag_generate_amazon_sin_api_cron')) { \n        wp_schedule_event(time(), 'custom_interval', 'tag_generate_amazon_sin_api_cron');\n    }\n}\nadd_action('wp', 'tag_schedule_article_generation');\n\nfunction tag_add_cron_interval($schedules) {\n    $delay = get_option('tag_article_delay', 60); // Valor por defecto de 60 segundos si no est\u00e1 configurado\n    $schedules['custom_interval'] = array(\n        'interval' => $delay,\n        'display'  => __('Custom Interval')\n    );\n    return $schedules;\n}\nadd_filter('cron_schedules', 'tag_add_cron_interval');\n\n// Desregistrar el cron que no corresponda al guardar las opciones de nicho\nfunction tag_unschedule_incorrect_cron() {\n    if (is_directorio_niche()) {\n        // Nicho directorio\n        wp_clear_scheduled_hook('tag_generate_articles_cron');\n        wp_clear_scheduled_hook('tag_generate_places_cron');\n        wp_clear_scheduled_hook('tag_generate_amazon_sin_api_cron');\n    } elseif (is_rese\u00f1as_individuales_niche()) {\n        // Nicho de rese\u00f1as individuales\n        wp_clear_scheduled_hook('tag_generate_directorio_cron');\n        wp_clear_scheduled_hook('tag_generate_articles_cron');\n        wp_clear_scheduled_hook('tag_generate_amazon_sin_api_cron');\n    } elseif (is_amazon_sin_api_niche()) { \n        // Nicho de Amazon sin API\n        wp_clear_scheduled_hook('tag_generate_directorio_cron');\n        wp_clear_scheduled_hook('tag_generate_places_cron');\n        wp_clear_scheduled_hook('tag_generate_articles_cron'); \n    } else {\n        // Si no es ninguno de los nichos anteriores, desprogramar por defecto\n        wp_clear_scheduled_hook('tag_generate_directorio_cron');\n        wp_clear_scheduled_hook('tag_generate_places_cron');\n        wp_clear_scheduled_hook('tag_generate_amazon_sin_api_cron');\n    }\n}\n\n// A\u00f1adir acciones para los tres tipos de nicho\nadd_action('update_option_tag_nicho_directorio', 'tag_unschedule_incorrect_cron');\nadd_action('update_option_tag_niche_type', 'tag_unschedule_incorrect_cron');\nadd_action('update_option_tag_amazon_sin_api_niche', 'tag_unschedule_incorrect_cron');\n\n// Desregistrar eventos cron al desactivar el plugin\nfunction tag_unschedule_article_generation() {\n    wp_clear_scheduled_hook('tag_generate_directorio_cron');\n    wp_clear_scheduled_hook('tag_generate_articles_cron');\n    wp_clear_scheduled_hook('tag_generate_places_cron');\n\twp_clear_scheduled_hook('tag_generate_amazon_sin_api_cron');\n}\nregister_deactivation_hook(__FILE__, 'tag_unschedule_article_generation');\n\n// Acciones para ejecutar las funciones de procesamiento de colas\nadd_action('tag_generate_directorio_cron', 'tag_process_directorio_queue');\nadd_action('tag_generate_articles_cron', 'tag_process_article_queue');\nadd_action('tag_generate_places_cron', 'tag_process_places_queue');\nadd_action('tag_generate_amazon_sin_api_cron', 'tag_process_amazon_sin_api_queue');\n\n// Mostrar la p\u00e1gina de administraci\u00f3n.\nfunction tag_admin_page() {\n    // Obtener los t\u00edtulos creados almacenados.\n    $created_titles = get_option('tag_created_titles', array());\n    $api_key = get_option('tag_api_key');\n    $delay = get_option('tag_article_delay', 60); // Valor por defecto de 60 segundos (1 minuto).\n    $categories = get_option('tag_categories', '');\n\n// Idiomas disponibles\n$languages = array(\n    'Espa\u00f1ol' => 'Espa\u00f1ol',\n    'Ingl\u00e9s' => 'Ingl\u00e9s',\n    'Turco' => 'Turco',\n    '\u00c1rabe' => '\u00c1rabe',\n    'Hindi' => 'Hindi',\n    'Ruso' => 'Ruso',\n    'Franc\u00e9s' => 'Franc\u00e9s',\n    'Portugu\u00e9s' => 'Portugu\u00e9s',\n    'Alem\u00e1n' => 'Alem\u00e1n',\n    'Polaco' => 'Polaco',\n    'Japon\u00e9s' => 'Japon\u00e9s',\n    'Coreano' => 'Coreano',\n    'Sueco' => 'Sueco',\n    'Indonesio' => 'Indonesio',\n    'Italiano' => 'Italiano',\n    'Hebreo' => 'Hebreo',\n    'Chino Mandar\u00edn' => 'Chino Mandar\u00edn',\n    'Neerland\u00e9s' => 'Neerland\u00e9s',\n    'Vietnamita' => 'Vietnamita',\n    'Sundan\u00e9s' => 'Sundan\u00e9s',\n    'Espa\u00f1ol (Per\u00fa)' => 'Espa\u00f1ol (Per\u00fa)',\n    'Espa\u00f1ol (M\u00e9xico)' => 'Espa\u00f1ol (M\u00e9xico)',\n    'Espa\u00f1ol (Argentina)' => 'Espa\u00f1ol (Argentina)',\n    'Espa\u00f1ol (Chile)' => 'Espa\u00f1ol (Chile)',\n    'Espa\u00f1ol (Colombia)' => 'Espa\u00f1ol (Colombia)',\n    'Espa\u00f1ol (Ecuador)' => 'Espa\u00f1ol (Ecuador)',\n    'Espa\u00f1ol (Venezuela)' => 'Espa\u00f1ol (Venezuela)',\n    'Espa\u00f1ol (Guatemala)' => 'Espa\u00f1ol (Guatemala)',\n    'Espa\u00f1ol (Cuba)' => 'Espa\u00f1ol (Cuba)',\n    'Espa\u00f1ol (Bolivia)' => 'Espa\u00f1ol (Bolivia)',\n    'Espa\u00f1ol (Hait\u00ed)' => 'Espa\u00f1ol (Hait\u00ed)',\n    'Espa\u00f1ol (Rep\u00fablica Dominicana)' => 'Espa\u00f1ol (Rep\u00fablica Dominicana)',\n    'Espa\u00f1ol (Honduras)' => 'Espa\u00f1ol (Honduras)',\n    'Espa\u00f1ol (Paraguay)' => 'Espa\u00f1ol (Paraguay)',\n    'Espa\u00f1ol (Nicaragua)' => 'Espa\u00f1ol (Nicaragua)',\n    'Espa\u00f1ol (El Salvador)' => 'Espa\u00f1ol (El Salvador)',\n    'Espa\u00f1ol (Costa Rica)' => 'Espa\u00f1ol (Costa Rica)',\n    'Espa\u00f1ol (Puerto Rico)' => 'Espa\u00f1ol (Puerto Rico)',\n    'Espa\u00f1ol (Panam\u00e1)' => 'Espa\u00f1ol (Panam\u00e1)',\n    'Espa\u00f1ol (Uruguay)' => 'Espa\u00f1ol (Uruguay)',\n    'Espa\u00f1ol (Jamaica)' => 'Espa\u00f1ol (Jamaica)',\n    'Espa\u00f1ol (Trinidad y Tobago)' => 'Espa\u00f1ol (Trinidad y Tobago)',\n    'Espa\u00f1ol (Belice)' => 'Espa\u00f1ol (Belice)'\n);\n\n\t// Modelos disponibles por proveedor\n$models_by_provider = array(\n    'groq' => array(\n        'llama3-groq-70b-8192-tool-use-preview' => 'llama3-groq-70b-8192-tool-use-preview',\n        'llama3-70b-8192' => 'llama3-70b-8192'\n    ),\n    'together' => array(\n        'Qwen/Qwen2.5-72B-Instruct-Turbo' => 'Qwen/Qwen2.5-72B-Instruct-Turbo',\n        'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo' => 'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo',\n        'meta-llama/Llama-3-70b-chat-hf' => 'meta-llama/Llama-3-70b-chat-hf',\n        'meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo' => 'meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo'\n    ),\n    'hyperbolic' => array(\n        'meta-llama/Meta-Llama-3.1-70B-Instruct' => 'meta-llama/Meta-Llama-3.1-70B-Instruct',\n        'Qwen/Qwen2.5-72B-Instruct' => 'Qwen/Qwen2.5-72B-Instruct',\n        'deepseek-ai/DeepSeek-V2.5' => 'deepseek-ai/DeepSeek-V2.5',\n\t\t'meta-llama/Meta-Llama-3.1-405B-Instruct' => 'meta-llama/Meta-Llama-3.1-405B-Instruct'\n    ),\n\t'OpenAI' => array(\n        'gpt-4o' => 'gpt-4o',\n        'gpt-4o-mini' => 'gpt-4o-mini' \n    ),\n\t'SambanovaAI' => array(\n        'Meta-Llama-3.1-70B-Instruct' => 'Meta-Llama-3.1-70B-Instruct',\n        'Meta-Llama-3.1-405B-Instruct' => 'Meta-Llama-3.1-405B-Instruct'\n    ),\n\t'FireworksAI' => array(\n        'accounts/fireworks/models/llama-v3p1-70b-instruct' => 'accounts/fireworks/models/llama-v3p1-70b-instruct',\n\t\t'accounts/fireworks/models/llama-v3p1-405b-instruct' => 'accounts/fireworks/models/llama-v3p1-405b-instruct',\n\t\t'accounts/fireworks/models/qwen2p5-72b-instruct' => 'accounts/fireworks/models/qwen2p5-72b-instruct'\n    ),\n\t'Cohere' => array(\n        'command-r-plus-08-2024' => 'command-r-plus-08-2024'\n    )\n);\n\t\n// Obtener el proveedor de API seleccionado en el panel de configuraci\u00f3n\n$api_provider = get_option('tag_api_provider', 'groq');\n\n// Obtener los modelos para el proveedor seleccionado\n$models = $models_by_provider[$api_provider];\n\n    if (isset($_POST['tag_save_settings'])) {\n        update_option('tag_api_key', sanitize_text_field($_POST['tag_api_key']));\n        update_option('tag_article_delay', intval($_POST['tag_article_delay']));\n        update_option('tag_categories', sanitize_text_field($_POST['tag_categories']));\n        update_option('tag_language', sanitize_text_field($_POST['tag_language']));\n        update_option('tag_faqs_title', sanitize_text_field($_POST['tag_faqs_title']));\n        update_option('tag_api_keys', sanitize_textarea_field($_POST['tag_api_keys']));\n        update_option('tag_model', sanitize_text_field($_POST['tag_model']));\n        update_option('tag_serper_api_keys', sanitize_textarea_field($_POST['tag_serper_api_keys']));\n\t\tupdate_option('tag_api_provider', sanitize_text_field($_POST['tag_api_provider']));\n        update_option('tag_post_status', sanitize_text_field($_POST['tag_post_status']));\n        update_option('tag_scraping_dog_api_keys', sanitize_textarea_field($_POST['tag_scraping_dog_api_keys'])); // <-- Nueva l\u00ednea\n\n        echo '<div class=\"updated\"><p>Configuraci\u00f3n guardada.</p></div>';\n    }\n\t// Guardar la configuraci\u00f3n de nicho\n    if (isset($_POST['tag_save_niche_settings'])) {\n        update_option('tag_nicho_directorio', sanitize_text_field($_POST['tag_nicho_directorio']));\n\t\tupdate_option('tag_amazon_sin_api_niche', sanitize_text_field($_POST['tag_amazon_sin_api_niche'])); // <-- Nueva l\u00ednea\n        update_option('tag_amazon_affiliate_id', sanitize_text_field($_POST['tag_amazon_affiliate_id'])); // <-- Nueva l\u00ednea\n\t\tupdate_option('tag_amazon_country', sanitize_text_field($_POST['tag_amazon_country'])); // <-- Nueva l\u00ednea\n\t\tupdate_option('tag_niche_type', sanitize_text_field($_POST['tag_niche_type']));\n        update_option('tag_tematica_directorio', sanitize_text_field($_POST['tag_tematica_directorio']));\n        echo '<div class=\"updated\"><p>Configuraci\u00f3n de nicho guardada.</p></div>';\n    }\n\t\n    $allowed_html = array(\n    'h2' => array(),\n    'h3' => array(),\n    'strong' => array(),\n    'em' => array(),\n    'table' => array(),\n    'thead' => array(),\n    'tbody' => array(),\n    'tr' => array(),\n    'th' => array(),\n    'td' => array(),\n    'p' => array(),\n    'br' => array(),\n    'ol' => array(), // <-- A\u00f1adir etiqueta <ol>\n    'li' => array()  // <-- A\u00f1adir etiqueta <li>\n   );\n\n   if (isset($_POST['tag_save_prompts'])) {\n    update_option('tag_intro_prompt', wp_kses($_POST['tag_intro_prompt'], $allowed_html));\n    update_option('tag_subtitles_prompt', wp_kses($_POST['tag_subtitles_prompt'], $allowed_html));\n    update_option('tag_faqs_prompt', wp_kses($_POST['tag_faqs_prompt'], $allowed_html));\n\tupdate_option('tag_question_prompt', wp_kses_post($_POST['tag_question_prompt'], $allowed_html));\n    update_option('tag_system_prompt', wp_kses_post($_POST['tag_system_prompt'], $allowed_html));\n    echo '<div class=\"updated\"><p>Prompts guardados correctamente.</p></div>';\n    }\n\n    if (isset($_POST['tag_generate_articles'])) {\n        $titles = explode(\"\\n\", sanitize_textarea_field($_POST['tag_article_titles']));\n        $queue = get_option('tag_article_queue', array());\n\n        foreach ($titles as $title) {\n            if (in_array(trim($title), $created_titles)) {\n                continue; // Saltar t\u00edtulos ya creados.\n            }\n\n            $queue[] = trim($title);\n        }\n\n        update_option('tag_article_queue', $queue);\n        echo '<div class=\"updated\"><p>Art\u00edculos a\u00f1adidos a la cola de generaci\u00f3n.</p></div>';\n    }\n\t\n\t// Acci\u00f3n para borrar t\u00edtulos creados\n    if (isset($_POST['tag_clear_created_titles'])) {\n        update_option('tag_created_titles', array());\n        update_option('tag_serper_consulted_titles', array()); // <-- Nueva l\u00ednea para borrar t\u00edtulos consultados a Serper\n        echo '<div class=\"updated\"><p>T\u00edtulos creados y consultados a Serper eliminados con \u00e9xito.</p></div>';\n    }\n\n    // Acci\u00f3n para borrar t\u00edtulos fallidos\n    if (isset($_POST['tag_clear_failed_titles'])) {\n        update_option('tag_failed_titles', array());\n\t\tupdate_option('tag_serper_consulted_titles', array()); // <-- Nueva l\u00ednea para borrar t\u00edtulos consultados a Serper\n        echo '<div class=\"updated\"><p>T\u00edtulos fallidos y consultados a Serper eliminados con \u00e9xito.</p></div>';\n    }\n\t\n\t// Acci\u00f3n para limpiar la cola\n    if (isset($_POST['tag_clear_queue'])) {\n        update_option('tag_article_queue', array());\n\t\tupdate_option('tag_serper_consulted_titles', array()); // <-- Nueva l\u00ednea para borrar t\u00edtulos consultados a Serper\n        echo '<div class=\"updated\"><p>Cola de art\u00edculos limpiada.</p></div>';\n    }\n\n    // Convertir t\u00edtulos creados a formato de texto para mostrar en la segunda caja.\n    $created_titles_text = implode(\"\\n\", $created_titles);\n\n    // Mostrar la caja de texto con los t\u00edtulos pendientes\n    $queue = get_option('tag_article_queue', array());\n    $queue_titles = implode(\"\\n\", $queue);\n\n    // Mostrar la caja de texto con los t\u00edtulos fallidos\n    $failed_titles = get_option('tag_failed_titles', array());\n    $failed_titles_text = implode(\"\\n\", $failed_titles);\n\n    ?>\n<div class=\"wrap\">\n    <h1>SharkContents Article Generator</h1>\n\n    <h2 class=\"nav-tab-wrapper\">\n        <a href=\"?page=SharkContents-article-generator&tab=settings\" class=\"nav-tab <?php echo !isset($_GET['tab']) || $_GET['tab'] == 'settings' ? 'nav-tab-active' : ''; ?>\">Configuraci\u00f3n</a>\n\t\t<a href=\"?page=SharkContents-article-generator&tab=niche_settings\" class=\"nav-tab <?php echo isset($_GET['tab']) && $_GET['tab'] == 'niche_settings' ? 'nav-tab-active' : ''; ?>\">Configuraci\u00f3n de Tipo de Nicho</a>\n\t\t<a href=\"?page=SharkContents-article-generator&tab=prompts\" class=\"nav-tab <?php echo isset($_GET['tab']) && $_GET['tab'] == 'prompts' ? 'nav-tab-active' : ''; ?>\">Prompts</a>\n        <a href=\"?page=SharkContents-article-generator&tab=generate\" class=\"nav-tab <?php echo isset($_GET['tab']) && $_GET['tab'] == 'generate' ? 'nav-tab-active' : ''; ?>\">Generar Art\u00edculos</a>\n    </h2>\n\n    <?php if (!isset($_GET['tab']) || $_GET['tab'] == 'settings') : ?>\n        <!-- Pesta\u00f1a de Configuraci\u00f3n -->\n        <form method=\"post\" style=\"background-color: #fff; padding: 20px; border-radius: 8px;\">\n<table class=\"form-table\">\n    <tr>\n        <th scope=\"row\"><label for=\"tag_api_keys\" style=\"font-weight: bold;\">APIS Dependiendo que Proveedor USARAS (una por l\u00ednea)</label></th>\n        <td><textarea name=\"tag_api_keys\" id=\"tag_api_keys\" rows=\"5\" class=\"large-text\"><?php echo esc_textarea(get_option('tag_api_keys')); ?></textarea></td>\n    </tr>\n    <tr>\n        <th scope=\"row\"><label for=\"tag_serper_api_keys\" style=\"font-weight: bold;\">API Keys de Serper (una por l\u00ednea)</label></th>\n        <td><textarea name=\"tag_serper_api_keys\" id=\"tag_serper_api_keys\" rows=\"5\" class=\"large-text\"><?php echo esc_textarea(get_option('tag_serper_api_keys')); ?></textarea></td>\n    </tr>\n    <tr>\n        <th scope=\"row\"><label for=\"tag_scraping_dog_api_keys\" style=\"font-weight: bold;\">API Keys de ScrapingDog (una por l\u00ednea)</label></th>\n        <td><textarea name=\"tag_scraping_dog_api_keys\" id=\"tag_scraping_dog_api_keys\" rows=\"5\" class=\"large-text\"><?php echo esc_textarea(get_option('tag_scraping_dog_api_keys')); ?></textarea></td>\n    </tr>\n    <tr>\n        <th scope=\"row\"><label for=\"tag_article_delay\" style=\"font-weight: bold;\">Tiempo de Espera entre Art\u00edculos (en segundos)</label></th>\n        <td><input name=\"tag_article_delay\" type=\"number\" id=\"tag_article_delay\" value=\"<?php echo esc_attr($delay); ?>\" class=\"small-text\"></td>\n    </tr>\n    <tr>\n        <th scope=\"row\"><label for=\"tag_categories\" style=\"font-weight: bold;\">Categor\u00edas (separadas por \"|\")</label></th>\n        <td><input name=\"tag_categories\" type=\"text\" id=\"tag_categories\" value=\"<?php echo esc_attr(get_option('tag_categories', '')); ?>\" class=\"regular-text\"></td>\n    </tr>\n    <tr>\n        <th scope=\"row\"><label for=\"tag_language\" style=\"font-weight: bold;\">Idioma</label></th>\n        <td>\n            <select name=\"tag_language\" id=\"tag_language\">\n                <?php foreach ($languages as $value => $label) : ?>\n                    <option value=\"<?php echo esc_attr($value); ?>\" <?php selected(get_option('tag_language', 'Espa\u00f1ol'), $value); ?>><?php echo esc_html($label); ?></option>\n                <?php endforeach; ?>\n            </select>\n        </td>\n    </tr>\n    <tr>\n        <th scope=\"row\"><label for=\"tag_faqs_title\" style=\"font-weight: bold;\">T\u00edtulo del H2 de Preguntas Frecuentes</label></th>\n        <td>\n            <input type=\"text\" name=\"tag_faqs_title\" id=\"tag_faqs_title\" value=\"<?php echo esc_attr(get_option('tag_faqs_title', 'Preguntas Frecuentes')); ?>\" class=\"regular-text\">\n        </td>\n    </tr>\n\t<tr>\n<th scope=\"row\"><label for=\"tag_api_provider\" style=\"font-weight: bold;\">Proveedor de API</label></th>\n<td>\n    <select name=\"tag_api_provider\" id=\"tag_api_provider\">\n        <option value=\"groq\" <?php selected(get_option('tag_api_provider', 'groq'), 'groq'); ?>>groq</option>\n        <option value=\"together\" <?php selected(get_option('tag_api_provider', 'groq'), 'together'); ?>>Together</option>\n        <option value=\"hyperbolic\" <?php selected(get_option('tag_api_provider', 'groq'), 'hyperbolic'); ?>>Hyperbolic</option>\n\t\t<option value=\"OpenAI\" <?php selected(get_option('tag_api_provider', 'groq'), 'OpenAI'); ?>>OpenAI</option>\n\t\t<option value=\"SambanovaAI\" <?php selected(get_option('tag_api_provider', 'groq'), 'SambanovaAI'); ?>>SambanovaAI</option>\n\t\t<option value=\"FireworksAI\" <?php selected(get_option('tag_api_provider', 'groq'), 'FireworksAI'); ?>>FireworksAI</option>\n\t\t<option value=\"Cohere\" <?php selected(get_option('tag_api_provider', 'groq'), 'Cohere'); ?>>Cohere</option>\n    </select>\n</td>\n  </tr>\n    <tr>\n<th scope=\"row\"><label for=\"tag_model\" style=\"font-weight: bold;\">Modelo</label></th>\n<td>\n    <select name=\"tag_model\" id=\"tag_model\">\n        <?php foreach ($models as $value => $label) : ?>\n            <option value=\"<?php echo esc_attr($value); ?>\" <?php selected(get_option('tag_model'), $value); ?>><?php echo esc_html($label); ?></option>\n        <?php endforeach; ?>\n    </select>\n</td>\n   </tr>\n    <tr>\n        <th scope=\"row\"><label for=\"tag_post_status\" style=\"font-weight: bold;\">Estado del post</label></th>\n        <td>\n            <select name=\"tag_post_status\" id=\"tag_post_status\">\n                <option value=\"publish\" <?php selected(get_option('tag_post_status', 'publish'), 'publish'); ?>>Publicado</option>\n                <option value=\"draft\" <?php selected(get_option('tag_post_status', 'publish'), 'draft'); ?>>Borrador</option>\n            </select>\n        </td>\n    </tr>\n</table>\n<div style=\"display: flex; align-items: center; gap: 10px; margin-top: 20px;\">\n    <?php submit_button('Guardar Configuraci\u00f3n', 'primary', 'tag_save_settings'); ?>\n    <input type=\"submit\" name=\"tag_delete_data\" class=\"button button-secondary\" id=\"tag_delete_data\" value=\"Eliminar datos del plugin\">\n</div>\n</form>\n<div style=\"background-color: #f7f7f7; padding: 10px; margin-top: 20px; border-left: 4px solid #007cba; border-radius: 4px;\">\n    <p style=\"margin: 0; font-size: 14px;\">\n        <strong>Instrucciones:</strong><br>\n        1. Selecciona un proveedor de API de la lista a continuaci\u00f3n, haz clic en \"Guardar Configuraci\u00f3n\" y recarga la p\u00e1gina:<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://groq.com\" target=\"_blank\">Groq - Por Mientas Gratis</a><br>\n        &nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://www.together.ai/\" target=\"_blank\">Together - Regalan 5$ Por cuenta Creada - Aceptan Tarjeta de DEBITO Virtual</a><br>\n        &nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://hyperbolic.xyz\" target=\"_blank\">Hyperbolic - Regalan 10$ Por cuenta Creada</a><br>\n        &nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://openai.com\" target=\"_blank\">OpenAI - DE PAGO</a><br>\n\t\t&nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://fireworks.ai\" target=\"_blank\">FireworksAI - Regalan 1$ Por cuenta Creada - Aceptan Tarjeta Virtual</a><br>\n\t\t&nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://sambanova.ai\" target=\"_blank\">SambanovaAI - Por Mientas Gratis</a><br>\n        2. Despu\u00e9s de recargar, elige el modelo que deseas utilizar del proveedor de API seleccionado y haz clic nuevamente en \"Guardar Configuraci\u00f3n\".<br>\n        3. \u00a1Listo! Ahora el plugin funcionar\u00e1 correctamente con el modelo seleccionado.<br>\n        4. Si est\u00e1s generando art\u00edculos informacionales o art\u00edculos de Amazon Afiliados Sin API, puedes agregar varias categor\u00edas que hayas creado previamente.<br>\n        5. Para art\u00edculos de tipo \"Post Pilar Directorio\", solo puedes seleccionar una categor\u00eda, por ejemplo, \"Provincias de Espa\u00f1a\".<br>\n        6. Para art\u00edculos de tipo \"Rese\u00f1as Individuales Directorio\", tambi\u00e9n debes seleccionar solo una categor\u00eda, por ejemplo, \"Fichas de Veterinarias\".<br>\n        7. Aseg\u00farate de configurar el CRON correctamente: <a href=\"https://AQUITUWEB/wp-cron.php?doing_cron\" target=\"_blank\">https://AQUITUWEB/wp-cron.php?doing_cron</a>, en <a href=\"https://console.cron-job.org/\" target=\"_blank\">https://console.cron-job.org/</a>.<br>\n\t\t8.- Tambien Puedes Configurar el Cron en tu servidor cada Minuto, mediante este comando: wget -O /dev/null https://AQUITUWEB/wp-cron.php?doing_cron > /dev/null 2>&1<br>\n    </p>\n</div>\n<div style=\"background-color: #f7f7f7; padding: 10px; margin-top: 20px; border-left: 4px solid #007cba; border-radius: 4px;\">\n    <p style=\"margin: 0; font-size: 14px;\">\n        <strong>Instructions:</strong><br>\n        1. Select an API provider from the list below, click on \"Save Settings,\" and refresh the page:<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://groq.com\" target=\"_blank\">Groq - Free for a limited time</a><br>\n        &nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://www.together.ai/\" target=\"_blank\">Together - $5 credit for account creation</a><br>\n        &nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://hyperbolic.xyz\" target=\"_blank\">Hyperbolic - $10 credit for account creation</a><br>\n        &nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://openai.com\" target=\"_blank\">OpenAI - Paid service</a><br>\n\t\t&nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://fireworks.ai\" target=\"_blank\">FireworksAI - Give away $1 Per Created Account - Virtual Card Accepted</a><br> \n\t\t&nbsp;&nbsp;&nbsp;&nbsp;- <a href=\"https://sambanova.ai\" target=\"_blank\">SambanovaAI - For Free Mientas</a><br>\n        2. After refreshing, choose the model you want to use from the selected API provider and click \"Save Settings\" again.<br>\n        3. Done! The plugin will now work correctly with the selected model.<br>\n        4. If you are generating informational articles or Amazon Affiliate articles without an API, you can add multiple categories that you have previously created.<br>\n        5. For \"Pillar Post Directory\" articles, you can only select one category, such as \"Provinces of Spain\".<br>\n        6. For \"Individual Reviews Directory\" articles, you should also select only one category, such as \"Veterinary Listings\".<br>\n        7. Make sure to configure the CRON correctly: <a href=\"https://AQUITUWEB/wp-cron.php?doing_cron\" target=\"_blank\">https://AQUITUWEB/wp-cron.php?doing_cron</a>, at <a href=\"https://console.cron-job.org/\" target=\"_blank\">https://console.cron-job.org/</a>.<br>\n\t\t8. You can also configure the CRON on your server to run every minute using the following command: wget -O /dev/null https://YOU-WEBSITE/wp-cron.php?doing_cron > /dev/null 2>&1<br>\n    </p>\n</div>\n\n        <?php \n            // Manejar el bot\u00f3n para eliminar los datos\n            if (isset($_POST['tag_delete_data'])) {\n                tag_uninstall();\n                echo '<div class=\"updated\"><p>Datos del plugin eliminados.</p></div>';\n            }\n        ?>\n\n    <?php elseif (isset($_GET['tab']) && $_GET['tab'] == 'niche_settings') : ?>\n        <!-- Pesta\u00f1a de Configuraci\u00f3n de Nicho -->\n    <form method=\"post\" style=\"background-color: #fff; padding: 20px; border-radius: 8px;\">\n     <table class=\"form-table\">\n\t\t    <tr>\n        <th scope=\"row\"><label for=\"tag_amazon_country\" style=\"font-weight: bold;\">Pa\u00eds de Amazon</label></th>\n        <td>\n            <select name=\"tag_amazon_country\" id=\"tag_amazon_country\">\n                <?php \n                $amazon_countries = [\n                    \"USA\", \"Espa\u00f1a\", \"Jap\u00f3n\", \"Alemania\", \"Australia\", \n                    \"Brasil\", \"Canad\u00e1\", \"Francia\", \"India\", \"Italia\", \n                    \"M\u00e9xico\", \"Pa\u00edses Bajos\", \"Arabia Saudita\", \"Singapur\", \n                    \"Turqu\u00eda\", \"Emiratos \u00c1rabes Unidos\", \"Reino Unido\", \"Polonia\", \"Egipto\", \"Suecia\"\n                ];\n                foreach ($amazon_countries as $country) : ?>\n                    <option value=\"<?php echo esc_attr($country); ?>\" <?php selected(get_option('tag_amazon_country'), $country); ?>><?php echo esc_html($country); ?></option>\n                <?php endforeach; ?>\n            </select>\n        </td>\n    </tr>\n    <tr>\n        <th scope=\"row\"><label for=\"tag_amazon_sin_api_niche\" style=\"font-weight: bold;\">\u00bfEs Nicho Amazon Sin API?</label></th>\n        <td>\n            <select name=\"tag_amazon_sin_api_niche\" id=\"tag_amazon_sin_api_niche\">\n\t\t\t\t<option value=\"no\" <?php selected(get_option('tag_amazon_sin_api_niche'), 'no'); ?>>No</option>\n                <option value=\"si\" <?php selected(get_option('tag_amazon_sin_api_niche'), 'si'); ?>>S\u00ed</option>\n            </select>\n        </td>\n    </tr>\n    <tr>\n        <th scope=\"row\"><label for=\"tag_amazon_affiliate_id\" style=\"font-weight: bold;\">ID de Afiliado de Amazon</label></th>\n        <td>\n            <input type=\"text\" name=\"tag_amazon_affiliate_id\" id=\"tag_amazon_affiliate_id\" value=\"<?php echo esc_attr(get_option('tag_amazon_affiliate_id', '')); ?>\" class=\"regular-text\">\n        </td>\n    </tr>\n<tr>\n    <th scope=\"row\"><label for=\"tag_nicho_directorio\" style=\"font-weight: bold;\">\u00bfEs Post Pilar de directorio?</label></th>\n    <td>\n        <select name=\"tag_nicho_directorio\" id=\"tag_nicho_directorio\">\n            <option value=\"si\" <?php selected(get_option('tag_nicho_directorio', 'no'), 'si'); ?>>S\u00ed</option>\n            <option value=\"no\" <?php selected(get_option('tag_nicho_directorio', 'no'), 'no'); ?>>No</option>\n        </select>\n    </td>\n</tr>\n<tr>\n    <th scope=\"row\"><label for=\"tag_niche_type\" style=\"font-weight: bold;\">\u00bfEs Posts de rese\u00f1as individuales?</label></th>\n    <td>\n        <select name=\"tag_niche_type\" id=\"tag_niche_type\">\n            <option value=\"si\" <?php selected(get_option('tag_niche_type', 'no'), 'si'); ?>>S\u00ed</option>\n            <option value=\"no\" <?php selected(get_option('tag_niche_type', 'no'), 'no'); ?>>No</option>\n        </select>\n    </td>\n</tr>\n        <tr>\n            <th scope=\"row\"><label for=\"tag_tematica_directorio\" style=\"font-weight: bold;\">Tem\u00e1tica del directorio</label></th>\n            <td><input type=\"text\" name=\"tag_tematica_directorio\" id=\"tag_tematica_directorio\" value=\"<?php echo esc_attr(get_option('tag_tematica_directorio')); ?>\" class=\"regular-text\"></td>\n        </tr>\n     </table>\n    <?php submit_button('Guardar Configuraci\u00f3n de Nicho', 'primary', 'tag_save_niche_settings'); ?>\n\t\t<!-- Mensaje de instrucciones despu\u00e9s del formulario -->\n\t\t<div style=\"background-color: #f7f7f7; padding: 10px; margin-top: 20px; border-left: 4px solid #007cba; border-radius: 4px;\">\n    <p style=\"margin: 0; font-size: 14px;\">\n        <strong>Instrucciones:</strong><br>\n        1. Si seleccionas \"Post Pilar Directorio\", desactiva las opciones de \"Amazon Sin API\" y \"Rese\u00f1as Individuales\". Puedes ingresar un t\u00edtulo como \"Mejores Veterinarias en Madrid\". Esto generar\u00e1 un post pilar.<br>\n        2. Si seleccionas \"Rese\u00f1as Individuales\", desactiva las opciones de \"Amazon Sin API\" y \"Post Pilar Directorio\", aseg\u00farate de ingresar un t\u00edtulo como \"Mejores Veterinarias en Madrid\". Esto va a Scrapear 10 negocios de ese titulo y creara 10 posts creados para cada titulo que pongas en la cola.<br>\n        3. Si seleccionas \"Nicho de Amazon Afiliados Sin API\", desactiva las opciones de \"Directorio\". Selecciona el pa\u00eds para el scrapeo y usa t\u00edtulos basados en palabras clave como \"Cafeteras Italianas\". La IA optimizar\u00e1 el t\u00edtulo autom\u00e1ticamente y ScrapingDog extraer\u00e1 los 5 mejores productos para hacer un buen post seo optimizado. - (Debes Poner la API - REGALAN 1000 CREDITOS, RECUERDA QUE CUESTA 10 CREDITOS POR SCRAPEO)<br>\n        4. Si deseas unicamente \"Art\u00edculos Informacionales\", desactiva todas las opciones de esta pesta\u00f1a. Haz clic en \"Guardar\" para aplicar los cambios.<br>\n        5. Recuerda que debes tener una API de Serper.dev con saldo suficiente para evitar errores en los nichos de directorios. Puedes adquirir cr\u00e9ditos por $50 (50,000 cr\u00e9ditos) en Serper.dev.\n    </p>\n\t</div>\n\t<div style=\"background-color: #f7f7f7; padding: 10px; margin-top: 20px; border-left: 4px solid #007cba; border-radius: 4px;\">\n    <p style=\"margin: 0; font-size: 14px;\">\n        <strong>Instructions:</strong><br>\n        1. If you select \"Directory Pillar Post\", disable the \"Amazon Without API\" and \"Individual Reviews\" options. You can enter a title like \"Best Veterinarians in Madrid\". This will generate a pillar post.<br>\n        2. If you select \"Individual Reviews\", disable the \"Amazon Without API\" and \"Directory Pillar Post\" options, and make sure to enter a title like \"Best Veterinarians in Madrid\". This will scrape 10 businesses for that title and create 10 posts for each title you queue.<br>\n        3. If you select \"Amazon Affiliate Niche Without API\", disable the \"Directory\" option. Select the country for scraping and use keyword-based titles like \"Italian Coffee Makers\". The AI will automatically optimize the title, and ScrapingDog will extract the top 5 products to create a well-optimized SEO post. - (You need to provide the API - THEY GIVE 1000 CREDITS, REMEMBER THAT IT COSTS 10 CREDITS PER SCRAPE)<br>\n        4. If you only want \"Informational Articles\", disable all options on this tab. Click \"Save\" to apply the changes.<br>\n        5. Remember to have an active Serper.dev API with sufficient balance to avoid errors in directory niches. You can purchase credits for $50 (50,000 credits) at Serper.dev.\n    </p>\n</div>\n</div>\n   </form>\n<?php elseif (isset($_GET['tab']) && $_GET['tab'] == 'prompts') : ?>\n    <!-- Pesta\u00f1a de Prompts -->\n    <form method=\"post\" style=\"background-color: #fff; padding: 20px; border-radius: 8px;\">\n        <table class=\"form-table\">\n            <tr>\n                <th scope=\"row\"><label for=\"tag_intro_prompt\" style=\"font-weight: bold;\">Prompt de Introducci\u00f3n</label></th>\n                <td>\n                    <textarea name=\"tag_intro_prompt\" id=\"tag_intro_prompt\" rows=\"5\" class=\"large-text\"><?php echo stripslashes(get_option('tag_intro_prompt')); ?></textarea>\n                    <p class=\"description\">Prompt para generar la introducci\u00f3n del art\u00edculo. Puedes usar la variable <code>$title</code> para insertar el t\u00edtulo del art\u00edculo. Tambi\u00e9n puedes usar <code>$language</code> para el idioma.</p>\n                </td>\n            </tr>\n            <tr>\n                <th scope=\"row\"><label for=\"tag_subtitles_prompt\" style=\"font-weight: bold;\">Prompt de Subt\u00edtulos</label></th>\n                <td>\n                    <textarea name=\"tag_subtitles_prompt\" id=\"tag_subtitles_prompt\" rows=\"5\" class=\"large-text\"><?php echo stripslashes(get_option('tag_subtitles_prompt')); ?></textarea>\n                    <p class=\"description\">Prompt para generar los subt\u00edtulos del art\u00edculo. Puedes usar la variable <code>$title</code> para insertar el t\u00edtulo del art\u00edculo. Tambi\u00e9n puedes usar <code>$language</code> para el idioma.</p>\n                </td>\n            </tr>\n            <tr>\n                <th scope=\"row\"><label for=\"tag_faqs_prompt\" style=\"font-weight: bold;\">Prompt de Preguntas Frecuentes</label></th>\n                <td>\n                    <textarea name=\"tag_faqs_prompt\" id=\"tag_faqs_prompt\" rows=\"5\" class=\"large-text\"><?php echo stripslashes(get_option('tag_faqs_prompt')); ?></textarea>\n                    <p class=\"description\">Prompt para generar las preguntas frecuentes del art\u00edculo. Puedes usar la variable <code>$title</code> para insertar el t\u00edtulo del art\u00edculo. Tambi\u00e9n puedes usar <code>$language</code> para el idioma.</p>\n                </td>\n            </tr>\n            <tr>\n                <th scope=\"row\"><label for=\"tag_question_prompt\" style=\"font-weight: bold;\">Prompt para PPA de Google</label></th>\n                <td>\n                    <textarea name=\"tag_question_prompt\" id=\"tag_question_prompt\" rows=\"5\" class=\"large-text\"><?php echo stripslashes(get_option('tag_question_prompt')); ?></textarea>\n                    <p class=\"description\">Prompt para PPA de Google. Puedes usar las variables <code>$question</code> y <code>$language</code>.</p>\n                </td>\n            </tr>\n            <tr>\n                <th scope=\"row\"><label for=\"tag_system_prompt\" style=\"font-weight: bold;\">Prompt del Sistema</label></th>\n                <td>\n                    <textarea name=\"tag_system_prompt\" id=\"tag_system_prompt\" rows=\"5\" class=\"large-text\"><?php echo stripslashes(get_option('tag_system_prompt')); ?></textarea>\n                    <p class=\"description\">Prompt del sistema. Usado para configurar el estilo de escritura del redactor. Puedes usar <code>$language</code> para insertar el idioma.</p>\n                </td>\n            </tr>\n        </table>\n        <?php submit_button('Guardar Prompts', 'primary', 'tag_save_prompts'); ?>\n    </form>\n\n    <?php elseif (isset($_GET['tab']) && $_GET['tab'] == 'generate') : ?>\n        <!-- Pesta\u00f1a de Generar Art\u00edculos -->\n        <form method=\"post\">\n            <table class=\"form-table\">\n                <tr>\n                    <th scope=\"row\"><label for=\"tag_article_titles\" style=\"font-weight: bold;\">T\u00edtulos de Art\u00edculos (uno por l\u00ednea)</label></th>\n                    <td><textarea name=\"tag_article_titles\" id=\"tag_article_titles\" rows=\"10\" class=\"large-text\"><?php echo esc_textarea($queue_titles); ?></textarea></td>\n                </tr>\n            </table>\n            <div style=\"display: flex; align-items: center; gap: 10px; margin-top: 20px;\"> \n            <?php submit_button('Generar Art\u00edculos', 'primary', 'tag_generate_articles'); ?>\n            <form method=\"post\" style=\"display: inline-block;\"> \n                <input type=\"submit\" name=\"tag_clear_queue\" class=\"button\" style=\"background-color: #d9534f; border-color: #d43f3a; color: #fff; font-weight: bold;\" value=\"Limpiar Cola\"> \n            </form>\n            <!-- --- FORMULARIOS PARA ELIMINAR TITULOS (COLOR ROJO) --- -->\n            <form method=\"post\" style=\"display: inline-block;\"> \n                <input type=\"submit\" name=\"tag_clear_failed_titles\" class=\"button\" style=\"background-color: #d9534f; border-color: #d43f3a; color: #fff; font-weight: bold;\" value=\"Eliminar T\u00edtulos Fallidos\">\n            </form>\n            <form method=\"post\" style=\"display: inline-block;\"> \n                <input type=\"submit\" name=\"tag_clear_created_titles\" class=\"button\" style=\"background-color: #d9534f; border-color: #d43f3a; color: #fff; font-weight: bold;\" value=\"Eliminar T\u00edtulos Creados\">\n            </form>\n        </div>\n        </form>\n\n        <h2>T\u00edtulos en Cola</h2>\n        <textarea rows=\"10\" class=\"large-text\" readonly><?php echo esc_textarea($queue_titles); ?></textarea>\n\n        <h2>T\u00edtulos Creados</h2>\n        <textarea rows=\"10\" class=\"large-text\" readonly><?php echo esc_textarea($created_titles_text); ?></textarea>\n\n        <h2>Art\u00edculos Fallidos</h2>\n        <textarea rows=\"10\" class=\"large-text\" readonly><?php echo esc_textarea($failed_titles_text); ?></textarea>\n    <?php endif; ?>\n</div>\n\n<style>\n\t/* Estilos adicionales para .wrap */\n.wrap h1 {\n  text-align: center; /* Centrar el h1 */\n}\n\n/* Estilos para las pesta\u00f1as */\n.nav-tab-wrapper a {\n  background-color: #007cba; /* Fondo azul para las pesta\u00f1as */\n  color: #fff; /* Letras blancas para las pesta\u00f1as */\n}\n\n.nav-tab-wrapper a.nav-tab-active {\n  background-color: #00578a; /* Fondo azul m\u00e1s oscuro para la pesta\u00f1a activa */\n  color: #fff; /* Letras blancas para la pesta\u00f1a activa */\n}\n/* Estilos generales */\n.wrap {\n    font-family: Arial, sans-serif;\n\tbackground-color: #ffff;\n}\n\n.nav-tab-active {\n    background-color: #007cba;\n    color: #fff;\n}\n\n/* Pesta\u00f1a de Configuraci\u00f3n */\n#settings-tab .form-table th {\n    font-weight: bold;\n    font-size: 16px;\n    color: #222;\n    padding: 10px 0;\n}\n\n#settings-tab .form-table td {\n    padding: 10px 0;\n}\n\n#settings-tab textarea.large-text {\n    background-color: #f9f9f9;\n    border: 1px solid #ccc;\n    padding: 10px;\n    font-size: 14px;\n    width: 100%;\n}\n#settings-tab input[type=\"submit\"].button-primary {\n    background-color: #0073aa;\n    border-color: #006799;\n    color: #fff;\n    font-weight: bold;\n}\n\n#tag_delete_data {\n    background-color: #d9534f;\n    border-color: #d43f3a;\n    color: #fff;\n    font-weight: bold;\n}\n\n#tag_delete_data.button-secondary:hover {\n    background-color: #c9302c;\n    border-color: #ac2925;\n}\n\n/* Pesta\u00f1a de Generar Art\u00edculos */\n#generate-tab {\n    background-color: #fff;\n    padding: 20px;\n    border-radius: 8px;\n}\n\n#generate-tab h2 {\n    font-size: 24px;\n    font-weight: bold;\n    color: #444;\n    margin-bottom: 15px;\n}\n\n#generate-tab .form-table th {\n    font-weight: bold;\n    font-size: 16px;\n    color: #222;\n    padding: 10px 0;\n}\n\n#generate-tab .form-table td {\n    padding: 10px 0;\n}\n\n#generate-tab textarea.large-text {\n    background-color: #f9f9f9;\n    border: 1px solid #ccc;\n    padding: 10px;\n    font-size: 14px;\n    width: 100%;\n}\n\n#generate-tab input[type=\"submit\"].button-primary {\n    background-color: #0073aa;\n    border-color: #006799;\n    color: #fff;\n    font-weight: bold;\n}\n\n#generate-tab input[type=\"submit\"].button-secondary {\n    background-color: #d63638;\n    border-color: #a71c1c;\n    color: #fff;\n    font-weight: bold;\n}\n\n/* Estilos adicionales para la pesta\u00f1a \"Generar\" */\n/* Fondo blanco y letras en negrita */\n#generate-tab {\n  background-color: #fff; /* Fondo blanco */\n}\n\n#generate-tab label, \n#generate-tab th, \n#generate-tab h2,\n#generate-tab legend {\n  font-weight: bold; /* Letras en negrita */\n\t}\n</style>\n    <?php\n}\n// Funci\u00f3n para eliminar todos los datos del plugin al desinstalar\nfunction tag_uninstall() {\n    // Eliminar opciones guardadas en la base de datos\n    delete_option('tag_api_keys');\n    delete_option('tag_serper_api_keys');\n    delete_option('tag_article_delay');\n    delete_option('tag_categories');\n    delete_option('tag_language');\n    delete_option('tag_faqs_title');\n    delete_option('tag_model');\n    delete_option('tag_post_status');\n    delete_option('tag_article_queue');\n    delete_option('tag_created_titles');\n    delete_option('tag_failed_titles');\n\tdelete_option('tag_nicho_directorio');\n    delete_option('tag_tematica_directorio');\n    delete_option('tag_niche_type');\n\tdelete_option('tag_scraping_dog_api_keys');\n\tdelete_option('tag_amazon_country');\n\tdelete_option('tag_amazon_sin_api_niche');\n\tdelete_option('tag_amazon_affiliate_id');\n    delete_option('tag_serper_consulted_titles');\n\tdelete_option('tag_api_provider');\n    delete_option('tag_intro_prompt'); // Agregado\n    delete_option('tag_subtitles_prompt'); // Agregado\n    delete_option('tag_faqs_prompt'); // Agregado\n    delete_option('tag_question_prompt'); // Agregado\n    delete_option('tag_system_prompt'); // Agregado\n  \n    // Eliminar el evento programado (cron)\n    wp_clear_scheduled_hook('tag_generate_articles_cron');\n    wp_clear_scheduled_hook('tag_generate_directorio_cron');\n\twp_clear_scheduled_hook('tag_generate_places_cron');\n\twp_clear_scheduled_hook('tag_generate_amazon_sin_api_cron');\n  }\nregister_uninstall_hook(__FILE__, 'tag_uninstall'); - me gustaria dividir por subpaginas mejor mi plugin, configuracion, guardado de los titulos a crear, y sub pagina de , creacion informacional, creacion de amazon sin api, creacion de directorio, creacion de rese\u00f1as individuales"},{"assistant_initiates":false,"asst_text":"Para mejorar la estructura de tu plugin y dividir las funcionalidades en subp\u00e1ginas en el panel de administraci\u00f3n de WordPress, puedes reorganizar tu c\u00f3digo para que cada funcionalidad (como las rese\u00f1as individuales) tenga su propia secci\u00f3n. Aqu\u00ed te mostrar\u00e9 c\u00f3mo ajustar tu funci\u00f3n `tag_process_places_queue` para integrarla mejor en un sistema m\u00e1s modular, donde cada funcionalidad tiene su propia subp\u00e1gina.\n\n1. **Crear una subp\u00e1gina para las rese\u00f1as individuales**: Esto te permitir\u00e1 gestionar las rese\u00f1as individuales de manera independiente del resto del plugin.\n\n2. **Acceso a las opciones**: Se puede seguir usando el mismo sistema de obtenci\u00f3n y almacenamiento de opciones, pero al estar en su propia p\u00e1gina, se facilita el manejo de las configuraciones espec\u00edficas de cada funcionalidad.\n\nAqu\u00ed tienes c\u00f3mo podr\u00edas estructurar el plugin para manejar las rese\u00f1as individuales:\n\n### Paso 1: A\u00f1adir la Subp\u00e1gina\n\nPrimero, a\u00f1ade una subp\u00e1gina para manejar las rese\u00f1as individuales.\n\n```php\nadd_submenu_page(\n    'SharkContents',\n    'Rese\u00f1as Individuales',\n    'Rese\u00f1as Individuales',\n    'manage_options',\n    'SharkContents-reviews',\n    'tag_reviews_page'\n);\n```\n\n### Paso 2: Crear la Funci\u00f3n para Renderizar la P\u00e1gina de Rese\u00f1as\n\nImplementa una funci\u00f3n que gestione la l\u00f3gica y la interfaz de usuario espec\u00edfica para las rese\u00f1as individuales.\n\n```php\nfunction tag_reviews_page() {\n    if (!is_rese\u00f1as_individuales_niche()) {\n        echo '<div class=\"error\"><p>La configuraci\u00f3n actual no est\u00e1 establecida para el nicho de rese\u00f1as individuales.</p></div>';\n        return;\n    }\n\n    // Procesar cualquier l\u00f3gica de la p\u00e1gina aqu\u00ed, como mostrar t\u00edtulos procesados, fallidos, etc.\n    // As\u00ed como formularios para a\u00f1adir nuevos t\u00edtulos a la cola, eliminar t\u00edtulos procesados o fallidos.\n\n    echo '<div class=\"wrap\"><h1>Gesti\u00f3n de Rese\u00f1as Individuales</h1>';\n    \n    // Aqu\u00ed muestra una lista de t\u00edtulos en espera, fallidos y ya creados, y los formularios para gestionarlos.\n\n    echo '</div>';\n}\n```\n\n### Paso 3: Usar Funciones para el Proceso de Creaci\u00f3n\n\nReutiliza y adapta la l\u00f3gica de tu funci\u00f3n `tag_process_places_queue` para que se ejecute seg\u00fan la configuraci\u00f3n establecida en esta secci\u00f3n. Aseg\u00farate de que este c\u00f3digo sea accesible en la p\u00e1gina de administraci\u00f3n para que puedas verificar su funcionamiento y gestionar los errores.\n\n### Paso 4: Integrar y Probar\n\n- Aseg\u00farate de que el nuevo men\u00fa de administraci\u00f3n se muestre y accione adecuadamente.\n- Prueba cada funcionalidad desde sus propias p\u00e1ginas administrativas para garantizar que no surjan conflictos entre funciones.\n\n### Nota Adicional:\nAl dividir el trabajo en diferentes subp\u00e1ginas, reduces la complejidad de la administraci\u00f3n, permitiendo un mantenimiento m\u00e1s sencillo y facilidad de acceso para ajustes futuros. Adem\u00e1s, la estructura modular facilita la adici\u00f3n de nuevas caracter\u00edsticas sin afectar otras partes del plugin.","behavior":"degenerate_repetition","conversation_hash":"7d8ce6ed3c6eca348be9138c9d84d9d4","conversation_redacted":false,"conversation_toxic":false,"country":"Peru","empty_output":false,"evidence_codes":[],"label":"absent","label_present":false,"label_qualified":false,"label_source":"Final dense release","language":"Spanish","model":"gpt-4o-2024-08-06","n_chars":14968,"n_turns_in_conversation":2,"n_words":1563,"source_row_offset":21351,"source_shard":"turns-00043.parquet","timestamp":"Sat, 02 Nov 2024 14:14:02 GMT","turn_id":"d4f63bf0c2f54d4f616921de","turn_index":1,"user_text":"esta es la funcion de rese\u00f1as individuales: function tag_process_places_queue() {\n    // Verificar si la configuraci\u00f3n es de nicho de rese\u00f1as individuales\n    if (!is_rese\u00f1as_individuales_niche()) {\n        return; // Detener la funci\u00f3n si no es nicho de rese\u00f1as individuales\n    }\n\n    $queue = get_option('tag_article_queue', array());\n    $failed_titles = get_option('tag_failed_titles', array());\n    $created_titles = get_option('tag_created_titles', array());\n    $Tematica = get_option('tag_tematica_directorio', '');\n    $categories = explode('|', sanitize_text_field(get_option('tag_categories')));\n    $faqs_title = get_option('tag_faqs_title', 'Preguntas Frecuentes');\n\n    // Obtener el idioma seleccionado\n    $language = get_option('tag_language', 'Espa\u00f1ol');\n\n    // Ajustar el idioma para las variantes del espa\u00f1ol\n    $spanishVariants = array(\n        'Espa\u00f1ol (Per\u00fa)', 'Espa\u00f1ol (M\u00e9xico)', 'Espa\u00f1ol (Argentina)', 'Espa\u00f1ol (Chile)',\n        'Espa\u00f1ol (Colombia)', 'Espa\u00f1ol (Ecuador)', 'Espa\u00f1ol (Venezuela)', 'Espa\u00f1ol (Guatemala)',\n        'Espa\u00f1ol (Cuba)', 'Espa\u00f1ol (Bolivia)', 'Espa\u00f1ol (Hait\u00ed)', 'Espa\u00f1ol (Rep\u00fablica Dominicana)',\n        'Espa\u00f1ol (Honduras)', 'Espa\u00f1ol (Paraguay)', 'Espa\u00f1ol (Nicaragua)', 'Espa\u00f1ol (El Salvador)',\n        'Espa\u00f1ol (Costa Rica)', 'Espa\u00f1ol (Puerto Rico)', 'Espa\u00f1ol (Panam\u00e1)', 'Espa\u00f1ol (Uruguay)',\n        'Espa\u00f1ol (Jamaica)', 'Espa\u00f1ol (Trinidad y Tobago)', 'Espa\u00f1ol (Belice)'\n    );\n    if (in_array($language, $spanishVariants)) {\n        $language = 'Espa\u00f1ol';\n    }\n\n    // Obtener el modelo seleccionado\n    $model = get_option('tag_model', 'meta-llama/Llama-3-70b-chat-hf');\n\n    if (!empty($queue)) {\n        $titulo = array_shift($queue); // T\u00edtulo principal de la cola\n\n        // --- Obtener datos de los lugares desde Google Maps (Serper) UNA SOLA VEZ ---\n        $places = tag_call_google_maps_dev($titulo);\n\n        if (!empty($places)) {\n            $max_posts_per_run = 10; // Define la cantidad m\u00e1xima de posts a crear por ejecuci\u00f3n\n            $posts_created = 0;      // Contador de posts creados en esta ejecuci\u00f3n\n\n            foreach ($places as $place) {\n                // --- Verificar si ya existe un post en WordPress con el mismo t\u00edtulo ---\n                $existing_post = get_page_by_title($place['title'], OBJECT, 'post');\n                if ($existing_post) {\n                    error_log(\"Ya existe un post con el t\u00edtulo: '\" . $place['title'] . \"'\");\n                    continue; // Saltar al siguiente lugar si ya existe un post\n                }\n\t\t\t\t\n\t\t\t\t// --- Verificar si ya existe un post en WordPress con el mismo t\u00edtulo ---\n                $sanitized_title = sanitize_title(trim($place['title']));\n                $existing_post = get_page_by_path($sanitized_title, OBJECT, 'post');\n                if ($existing_post) {\n                   error_log(\"Ya existe un post con el t\u00edtulo sanitizado: '\" . $sanitized_title . \"'\");\n                   continue; // Saltar al siguiente lugar si ya existe un post\n                 }\n\n                // --- Verificar si el t\u00edtulo ya ha sido procesado (est\u00e1 en la lista de creados) ---\n                if (in_array(trim($place['title']), $created_titles)) {\n                    error_log(\"El t\u00edtulo '\" . $place['title'] . \"' ya ha sido procesado.\");\n                    continue; // Saltar al siguiente lugar si ya se ha procesado\n                }\n\n                // --- Limitar la cantidad de posts creados ---\n                if ($posts_created >= $max_posts_per_run) {\n                    error_log(\"Se ha alcanzado el l\u00edmite de posts por ejecuci\u00f3n ($max_posts_per_run).\");\n                    break; // Salir del bucle foreach si se ha alcanzado el l\u00edmite\n                }\n\n                // Seleccionar una categor\u00eda aleatoria correctamente\n                $randomCategoryIndex = array_rand($categories);\n                $selectedCategory = $categories[$randomCategoryIndex];\n\n                // Generar la introducci\u00f3n para el lugar\n                $intro_place_prompt = \"Crea una introducci\u00f3n de 90 palabras para un art\u00edculo sobre: '\" . $place['title'] . \"', que es de la ciudad de $titulo, en idioma $language. a base de la tematica:'$Tematica'. No incluyas ning\u00fan otro texto ante de la introducci\u00f3n. No hagas ninguna traducci\u00f3n innecesaria, no hables ning\u00fan otro idioma que no fuera solo $language.\";\n                $data_intro_place = array(\n                    'model' => $model,\n                    'messages' => array(\n                        array('role' => 'system', 'content' => 'Eres un redactor nativo en ' . $language . ' y escribes de manera neutral solo en ' . $language . '.'),\n                        array('role' => 'user', 'content' => $intro_place_prompt)\n                    ),\n                    'temperature' => 0.75,\n                    'max_tokens' => 250,\n                );\n                $response_intro_place = tag_make_api_request($data_intro_place);\n\n                if (is_wp_error($response_intro_place)) {\n                    error_log(\"Error en la generaci\u00f3n de la introducci\u00f3n del lugar: \" . $response_intro_place->get_error_message());\n                    $failed_titles[] = trim($place['title']);\n                    update_option('tag_failed_titles', $failed_titles);\n                    continue;\n                }\n\n                $intro = tag_filter_content($response_intro_place->choices[0]->message->content);\n                $intro = str_replace('\"', '', $intro);\n\n                // Generar la rese\u00f1a para el lugar\n                $review_place_prompt = \"Por favor, no me saludes, Solo Crea una rese\u00f1a para: '\" . $place['title'] . \"' a base de la tematica: '$Tematica', puedes usar estos datos para la rese\u00f1a: \" . $place['address'] . \", \" . $place['phoneNumber'] . \", \" . $place['website'] . \" y \" . $place['rating'] . \" en $language. No hables ning\u00fan otro idioma que no fuera solo $language.\";\n                $data_review_place = array(\n                    'model' => $model,\n                    'messages' => array(\n                        array('role' => 'system', 'content' => 'Eres un redactor nativo en ' . $language . ' y escribes de manera neutral solo en ' . $language . '.'),\n                        array('role' => 'user', 'content' => $review_place_prompt)\n                    ),\n                    'temperature' => 0.75,\n                    'max_tokens' => 2000,\n                );\n                $response_review_place = tag_make_api_request($data_review_place);\n\n                if (is_wp_error($response_review_place)) {\n                    error_log(\"Error en la generaci\u00f3n de la rese\u00f1a del lugar: \" . $response_review_place->get_error_message());\n                    $failed_titles[] = trim($place['title']);\n                    update_option('tag_failed_titles', $failed_titles);\n                    continue;\n                }\n\n                $response = tag_filter_content($response_review_place->choices[0]->message->content);\n                $response = preg_replace('/\\*\\*(.*?)\\*\\*/', '<strong>$1</strong>', $response);\n\n                // Generar las preguntas frecuentes para el lugar\n                $faqs_place_prompt = \"Crea 4 Preguntas Frecuentes en $language, Acerca de: '\" . $place['title'] . \"' a base de la tematica: '$Tematica'. Formatea cada pregunta como subt\u00edtulo H3 en HTML '<h3></h3>' y responde inmediatamente despu\u00e9s de cada pregunta con p\u00e1rrafos extensos en $language, utilizando negritas en HTML '<strong></strong>' para las palabras m\u00e1s relevantes. puedes usar estos datos: \" . $place['address'] . \", \" . $place['phoneNumber'] . \", \" . $place['website'] . \" y \" . $place['rating'] . \" en $language. No saludes antes de las preguntas, no hables ning\u00fan otro idioma que no fuera solo $language.\";\n                $data_faqs_place = array(\n                    'model' => $model,\n                    'messages' => array(\n                        array('role' => 'system', 'content' => 'Eres un redactor nativo en ' . $language . ' y escribes de manera neutral solo en ' . $language . '.'),\n                        array('role' => 'user', 'content' => $faqs_place_prompt)\n                    ),\n                    'temperature' => 0.75,\n                    'max_tokens' => 2000,\n                );\n                $response_faqs_place = tag_make_api_request($data_faqs_place);\n\n                if (is_wp_error($response_faqs_place)) {\n                    error_log(\"Error en la generaci\u00f3n de las preguntas frecuentes del lugar: \" . $response_faqs_place->get_error_message());\n                    $failed_titles[] = trim($place['title']);\n                    update_option('tag_failed_titles', $failed_titles);\n                    continue;\n                }\n\n                $faqs = tag_filter_content($response_faqs_place->choices[0]->message->content);\n                $faqs = preg_replace('/\\*\\*(.*?)\\*\\*/', '<strong>$1</strong>', $faqs);\n\t\t\t\t$imagen_link = tag_call_google_imagen_directorio_dev($place['title']);\n\t\t\t\t$shortcode_de_resena = \"[hostal_shortcode titulo=\\\"\" . $place['title'] . \"\\\" direccion=\\\"\" . $place['address'] . \"\\\" imagen_url=\\\"\" . $imagen_link . \"\\\" telefono=\\\"\" . $place['phoneNumber'] . \"\\\" como_llegar_url=\\\"\" . $place['website'] . \"\\\" rating=\\\"\" . $place['rating'] . \"/5\\\"]\";\n\n\n                // Verificar si el contenido tiene datos antes de crear el post\n                if (!empty($intro) && !empty($response) && !empty($faqs)) {\n                    // Crear el post en WordPress\n                    $post_data = array(\n                        'post_title' => sanitize_text_field($place['title']),\n                        'post_content' => $intro . \"\\n\\n\" . $shortcode_de_resena . \"\\n\\n\" . $response . \"\\n\\n<h2>\" . sanitize_text_field($faqs_title) . \"</h2>\" . $faqs,\n                        'post_status' => sanitize_text_field(get_option('tag_post_status', 'draft')),\n                        'post_category' => array(get_cat_ID($selectedCategory))\n                    );\n\n                    $post_id = wp_insert_post($post_data);\n\n                    if (!is_wp_error($post_id)) {\n                        error_log(\"Post creado exitosamente con el t\u00edtulo: '\" . $place['title'] . \"'\");\n                        $created_titles[] = trim($place['title']);\n                         // Incrementar el contador de posts creados, pero solo si es menor que el l\u00edmite\n                       if ($posts_created < $max_posts_per_run) {\n                          $posts_created++;\n                         }\n                    } else {\n                        error_log(\"Error al crear el post para el t\u00edtulo: '\" . $place['title'] . \"'\");\n                        $failed_titles[] = trim($place['title']);\n                    }\n\n                    update_option('tag_created_titles', $created_titles);\n                    update_option('tag_failed_titles', $failed_titles);\n                } else {\n                    // Manejar caso de contenido vac\u00edo\n                    error_log(\"No se puede crear el post, el contenido est\u00e1 vac\u00edo para el t\u00edtulo: \" . esc_html($place['title']));\n                    $failed_titles[] = trim($place['title']);\n                    update_option('tag_failed_titles', $failed_titles);\n\t\t\t\t\t$serper_consulted_titles = get_option('tag_serper_consulted_titles', array());\n                    if (($key = array_search($title, $serper_consulted_titles)) !== false) {\n                     unset($serper_consulted_titles[$key]);\n                     }\n                     update_option('tag_serper_consulted_titles', $serper_consulted_titles);\n                }\n\n\n            }\n\n            // Actualizar la cola eliminando el t\u00edtulo principal si se han creado todos los posts posibles\n            if ($posts_created >= $max_posts_per_run) {\n                error_log(\"Se complet\u00f3 la creaci\u00f3n de posts para el t\u00edtulo: '\" . $titulo . \"'\");\n            } else {\n                error_log(\"Se procesaron todos los lugares posibles para el t\u00edtulo: '\" . $titulo . \"'\");\n            }\n        }\n\n        update_option('tag_article_queue', $queue); // Guardar la cola actualizada\n    }\n}"},{"assistant_initiates":false,"asst_text":"```json\n{\n  \"instruction\": \"\u5728\u9059\u9060\u7684\u672a\u4f86\uff0c\u5730\u7403\u8868\u9762\u8b8a\u5f97\u4e0d\u518d\u9069\u5408\u4eba\u985e\u5c45\u4f4f\uff0c\u79d1\u5b78\u5bb6\u5011\u958b\u59cb\u5c0b\u627e\u65b0\u7684\u5c45\u4f4f\u5730\u3002\u4f60\u4f5c\u70ba\u4e00\u540d\u52c7\u6562\u7684\u63a2\u96aa\u8005\uff0c\u63a5\u53d7\u4e86\u524d\u5f80\u795e\u79d8\u6d77\u5e95\u57ce\u5e02\u7684\u4efb\u52d9\u3002\u9019\u5ea7\u6d77\u5e95\u57ce\u5e02\u96b1\u85cf\u65bc\u6df1\u6d77\u4e4b\u4e2d\uff0c\u64c1\u6709\u8457\u7121\u6578\u672a\u88ab\u767c\u73fe\u7684\u79d8\u5bc6\u548c\u5148\u9032\u7684\u79d1\u6280\u3002\u96a8\u8457\u4efb\u52d9\u7684\u958b\u59cb\uff0c\u4f60\u5c07\u62ab\u834a\u65ac\u68d8\uff0c\u514b\u670d\u91cd\u91cd\u96e3\u95dc\uff0c\u63a2\u5c0b\u6d77\u5e95\u57ce\u5e02\u7684\u771f\u76f8\uff0c\u4e26\u5c0b\u627e\u5408\u9069\u7684\u4eba\u985e\u5c45\u4f4f\u5730\u3002\u6bcf\u4e00\u6b65\u884c\u52d5\u90fd\u9700\u8981\u614e\u91cd\u601d\u8003\uff0c\u56e0\u70ba\u5728\u9019\u7247\u672a\u77e5\u7684\u6d77\u5e95\uff0c\u4efb\u4f55\u932f\u8aa4\u90fd\u53ef\u80fd\u662f\u81f4\u547d\u7684\u3002\u56e0\u6b64\uff0c\u4f60\u5fc5\u9808\u4f9d\u9760\u667a\u6167\u548c\u52c7\u6c23\uff0c\u63ed\u958b\u6d77\u5e95\u57ce\u5e02\u7684\u8b0e\u5718\u3002\",\n  \"input\": \"\u6df1\u5165\u63a2\u7d22\u6d77\u5e95\u6d1e\u7a74\",\n  \"output\": \"\u4f60\u5c0f\u5fc3\u7ffc\u7ffc\u5730\u9032\u5165\u4e00\u500b\u5e7d\u6697\u7684\u6d77\u5e95\u6d1e\u7a74\uff0c\u56db\u5468\u74b0\u7e5e\u8457\u5947\u7570\u7684\u751f\u7269\u767c\u51fa\u7684\u5fae\u5149\u3002\u6d1e\u7a74\u5167\u90e8\u7684\u7246\u58c1\u4ea4\u932f\u8457\u53e4\u8001\u7684\u96d5\u523b\uff0c\u4f3c\u4e4e\u8a18\u8f09\u8457\u4e00\u6bb5\u907a\u5fd8\u7684\u6b77\u53f2\u3002\u96a8\u8457\u4f60\u7684\u6df1\u5165\uff0c\u4e00\u9663\u5f37\u70c8\u7684\u6c34\u6d41\u7a81\u7136\u8972\u4f86\uff0c\u8b93\u4f60\u63aa\u624b\u4e0d\u53ca\u3002\u4f60\u5728\u6399\u624e\u4e2d\u63e1\u7dca\u624b\u4e2d\u7684\u63a2\u7167\u71c8\uff0c\u4f9d\u9760\u5b83\u5fae\u5f31\u7684\u5149\u8292\u7e7c\u7e8c\u524d\u9032\u3002\u9019\u80a1\u6c34\u6d41\u5c07\u4f60\u63a8\u5411\u6d1e\u7a74\u66f4\u6df1\u8655\uff0c\u800c\u4f60\u5fc3\u4e2d\u66f4\u52a0\u597d\u5947\uff0c\u9019\u5ea7\u6d77\u5e95\u57ce\u5e02\u9084\u96b1\u85cf\u8457\u600e\u6a23\u7684\u672a\u77e5\u79d8\u5bc6\u3002\"\n}\n```","behavior":"degenerate_repetition","conversation_hash":"ed8a7d7d2bbb76c4aa653c44b7c210e8","conversation_redacted":false,"conversation_toxic":false,"country":"United States","empty_output":false,"evidence_codes":[],"label":"absent","label_present":false,"label_qualified":false,"label_source":"Final dense release","language":"Chinese","model":"gpt-4o-2024-08-06","n_chars":658,"n_turns_in_conversation":1,"n_words":18,"source_row_offset":21352,"source_shard":"turns-00043.parquet","timestamp":"Sat, 02 Nov 2024 14:14:05 GMT","turn_id":"f24b945bb5146ca7c064fa84","turn_index":0,"user_text":"random seed928\uff0c \u6211\u60f3\u8981\u88fd\u4f5cAI Dungeon\u7684\u904a\u6232\uff0c\u8acb\u5e6b\u6211\u751f\u6210\u8cc7\u6599\u96c6\uff0c\u7bc4\u4f8b\u8cc7\u6599\u70ba\uff1a{'instruction': '...','input': '...','output': '...'}\uff0c\u4e3b\u984c\u70ba\u6d77\u5e95\u57ce\u5e02\u63a2\u7d22\u6545\u4e8b\uff0cinstruction\u8acb\u5beb\u6545\u4e8b\u7684\u5b8c\u6574\u5287\u60c5\u80cc\u666f\uff0c\u4e3b\u89d2\u4e0d\u8981\u6709\u540d\u5b57\uff0c\u76e1\u91cf\u7528\u4f60\uff0cinput\u70ba\u52d5\u4f5c(\u4e0d\u7528\u4e3b\u8a5e\uff0c\u8acb\u8d85\u904e\u4e94\u500b\u5b57)\u3001output\u70ba\u63a5\u4e0b\u4f86\u6545\u4e8b\u7684\u8b8a\u5316\uff0c1\u7b46\u5c31\u597d\uff0c\u6545\u4e8b\u5287\u60c5\u5167\u5bb9\u76e1\u91cf\u5728200\u5b57\u5167 \u8acb\u7528\u7e41\u9ad4\u4e2d\u6587\uff0c\u76f4\u63a5\u56de\u8986\u6211json"},{"assistant_initiates":false,"asst_text":"```json\n{\n    \"instruction\": \"\u5728\u4e00\u500b\u98a8\u96e8\u4ea4\u52a0\u7684\u591c\u665a\uff0c\u4e00\u8258\u8c6a\u83ef\u90f5\u8f2a\u5728\u524d\u5f80\u592a\u5e73\u6d0b\u7684\u65c5\u9014\u4e2d\u4e0d\u5e78\u89f8\u7901\u3002\u8239\u4e0a\u7684\u4e58\u5ba2\u591a\u70ba\u5bcc\u88d5\u7684\u793e\u6703\u540d\u6d41\uff0c\u7136\u800c\uff0c\u9019\u5834\u7a81\u5982\u5176\u4f86\u7684\u707d\u96e3\u8b93\u4ed6\u5011\u88ab\u8feb\u91cb\u653e\u5404\u81ea\u7684\u79d8\u5bc6\u3002\u4f60\u662f\u4e00\u4f4d\u65b0\u805e\u8a18\u8005\uff0c\u9019\u6b21\u5049\u5927\u7684\u822a\u884c\u672c\u662f\u70ba\u4e86\u4e00\u7bc7\u5831\u5c0e\uff0c\u4f46\u9762\u5c0d\u9019\u5834\u6c89\u8239\u4e8b\u6545\uff0c\u539f\u672c\u7684\u8a08\u5283\u88ab\u5b8c\u5168\u6253\u4e82\u3002\u4f60\u8981\u5728\u5c0b\u627e\u751f\u9084\u8005\u7684\u904e\u7a0b\u4e2d\uff0c\u540c\u6642\u63ed\u958b\u9019\u5834\u4e8b\u4ef6\u80cc\u5f8c\u96b1\u85cf\u7684\u7a2e\u7a2e\u8b0e\u5718\uff0c\u8af8\u5982\u5931\u8e64\u7684\u8ca1\u5bcc\u3001\u795e\u79d8\u7684\u7559\u8a00\u4ee5\u53ca\u50b3\u805e\u4e2d\u7684\u5e7d\u9748\u8239\u9577\u3002\",\n    \"input\": \"\u63a2\u7d22\u90f5\u8f2a\u7684\u6b98\u9ab8\",\n    \"output\": \"\u4f60\u6c7a\u5b9a\u52c7\u6562\u5730\u6df1\u5165\u6c89\u8239\u6b98\u9ab8\u4e4b\u4e2d\u3002\u7576\u4f60\u7a7f\u904e\u660f\u6697\u7684\u8239\u8259\u6642\uff0c\u4f60\u767c\u73fe\u4e00\u500b\u795e\u79d8\u7684\u65e5\u8a18\u672c\uff0c\u4e0a\u9762\u8a18\u9304\u4e86\u4e00\u540d\u4e58\u5ba2\u7684\u7d55\u671b\u8207\u9a5a\u6050\u3002\u65e5\u8a18\u63ed\u9732\u4e86\u95dc\u65bc\u90f5\u8f2a\u4e0a\u4e00\u6b21\u79d8\u5bc6\u4ea4\u6613\u7684\u6d88\u606f\uff0c\u9019\u6b21\u4ea4\u6613\u662f\u67d0\u4f4d\u4e58\u5ba2\u70ba\u4e86\u63a9\u98fe\u81ea\u5df1\u7684\u4e0d\u7576\u884c\u70ba\u800c\u9032\u884c\u7684\u3002\u9762\u5c0d\u5982\u6b64\u91cd\u5927\u7684\u767c\u73fe\uff0c\u4f60\u77e5\u9053\u9019\u53ea\u662f\u4e00\u9023\u4e32\u4e8b\u4ef6\u7684\u958b\u59cb\uff0c\u4f60\u6c7a\u5fc3\u7e7c\u7e8c\u6df1\u6316\u9019\u8d77\u4e8b\u4ef6\u7684\u771f\u76f8\u3002\"\n}\n```","behavior":"degenerate_repetition","conversation_hash":"b0cf20479d320244a97438132601def9","conversation_redacted":false,"conversation_toxic":false,"country":"","empty_output":false,"evidence_codes":[],"label":"absent","label_present":false,"label_qualified":false,"label_source":"Final dense release","language":"Chinese","model":"gpt-4o-2024-08-06","n_chars":616,"n_turns_in_conversation":1,"n_words":18,"source_row_offset":21353,"source_shard":"turns-00043.parquet","timestamp":"Sat, 02 Nov 2024 14:14:06 GMT","turn_id":"8b4bf920ce44f133fd87a655","turn_index":0,"user_text":"random seed929\uff0c \u6211\u60f3\u8981\u88fd\u4f5cAI Dungeon\u7684\u904a\u6232\uff0c\u8acb\u5e6b\u6211\u751f\u6210\u8cc7\u6599\u96c6\uff0c\u7bc4\u4f8b\u8cc7\u6599\u70ba\uff1a{'instruction': '...','input': '...','output': '...'}\uff0c\u4e3b\u984c\u70ba\u6c89\u8239\u4e4b\u8b0e\u6545\u4e8b\uff0cinstruction\u8acb\u5beb\u6545\u4e8b\u7684\u5b8c\u6574\u5287\u60c5\u80cc\u666f\uff0c\u4e3b\u89d2\u4e0d\u8981\u6709\u540d\u5b57\uff0c\u76e1\u91cf\u7528\u4f60\uff0cinput\u70ba\u52d5\u4f5c(\u4e0d\u7528\u4e3b\u8a5e\uff0c\u8acb\u8d85\u904e\u4e94\u500b\u5b57)\u3001output\u70ba\u63a5\u4e0b\u4f86\u6545\u4e8b\u7684\u8b8a\u5316\uff0c1\u7b46\u5c31\u597d\uff0c\u6545\u4e8b\u5287\u60c5\u5167\u5bb9\u76e1\u91cf\u5728200\u5b57\u5167 \u8acb\u7528\u7e41\u9ad4\u4e2d\u6587\uff0c\u76f4\u63a5\u56de\u8986\u6211json"},{"assistant_initiates":false,"asst_text":"```json\n{\n    \"instruction\": \"\u5728\u9059\u9060\u7684\u6975\u5730\u51b0\u6d0b\uff0c\u51b0\u96ea\u8986\u84cb\u4e86\u6574\u500b\u4e16\u754c\u3002\u5929\u5730\u9593\u5f4c\u6f2b\u8457\u51dc\u51bd\u7684\u5bd2\u98a8\uff0c\u51b0\u5c71\u5dcd\u5ce8\uff0c\u6d77\u6d0b\u5247\u88ab\u539a\u91cd\u7684\u51b0\u5c64\u6240\u5c01\u9396\u3002\u4f60\u662f\u4e00\u540d\u7121\u754f\u7684\u63a2\u96aa\u5bb6\uff0c\u70ba\u4e86\u5c0b\u627e\u50b3\u8aaa\u4e2d\u7684\u9060\u53e4\u5bf6\u85cf\uff0c\u6c7a\u610f\u8e0f\u4e0a\u9019\u7247\u5145\u6eff\u672a\u77e5\u7684\u571f\u5730\u3002\u8239\u96bb\u5728\u51b0\u6d77\u4e2d\u8271\u96e3\u822a\u884c\uff0c\u6bcf\u6b21\u51b0\u5c64\u7684\u7834\u788e\u8207\u51b0\u5c71\u7684\u91cd\u73fe\u90fd\u80fd\u4ee4\u4f60\u7684\u5fc3\u8df3\u52a0\u901f\u3002\u7576\u6d77\u9762\u4e0a\u7684\u9727\u6c23\u9010\u6f38\u6563\u53bb\uff0c\u4f60\u77e5\u9053\u4e00\u5834\u524d\u6240\u672a\u6709\u7684\u5192\u96aa\u5373\u5c07\u5c55\u958b\u3002\u52c7\u6562\u8207\u6c42\u77e5\u5c07\u6210\u70ba\u4f60\u6700\u5805\u5be6\u7684\u540c\u4f34\uff0c\u5e36\u9818\u4f60\u63a2\u7d22\u90a3\u4e9b\u96b1\u85cf\u5728\u51b0\u96ea\u6df1\u8655\u7684\u79d8\u5bc6\u3002\",\n    \"input\": \"\u5283\u7834\u56b4\u51ac\u7684\u5bd2\u98a8\u822a\u884c\",\n    \"output\": \"\u5728\u7d93\u6b77\u6578\u5c0f\u6642\u7684\u822a\u884c\u5f8c\uff0c\u4f60\u7684\u8239\u96bb\u7a81\u7136\u88ab\u539a\u91cd\u7684\u51b0\u5c64\u5361\u4f4f\u3002\u96a8\u8457\u5f15\u64ce\u7684\u8072\u97f3\u9010\u6f38\u6e1b\u5f31\uff0c\u4f60\u610f\u8b58\u5230\u5fc5\u9808\u5f92\u6b65\u524d\u884c\uff0c\u624d\u80fd\u627e\u5230\u7a81\u7834\u53e3\u3002\u74b0\u9867\u56db\u5468\uff0c\u767d\u832b\u832b\u7684\u666f\u8272\u8b93\u4f60\u4e00\u6642\u5931\u53bb\u4e86\u65b9\u5411\uff0c\u4f46\u6191\u85c9\u8457\u5730\u5716\u8207\u6307\u5357\u91dd\uff0c\u4f60\u958b\u59cb\u5411\u5317\u884c\u9032\uff0c\u671f\u5f85\u8457\u63ed\u958b\u51b0\u5c64\u4e0b\u96b1\u85cf\u7684\u50b3\u5947\u5bf6\u85cf\u3002\"\n}\n```","behavior":"degenerate_repetition","conversation_hash":"59bf34fff4bd8743dcdaf13a0a3fb92a","conversation_redacted":false,"conversation_toxic":false,"country":"China","empty_output":false,"evidence_codes":[],"label":"absent","label_present":false,"label_qualified":false,"label_source":"Final dense release","language":"Chinese","model":"gpt-4o-2024-08-06","n_chars":606,"n_turns_in_conversation":1,"n_words":18,"source_row_offset":21354,"source_shard":"turns-00043.parquet","timestamp":"Sat, 02 Nov 2024 14:14:07 GMT","turn_id":"1f975855cadf204c462dd0ee","turn_index":0,"user_text":"random seed930\uff0c \u6211\u60f3\u8981\u88fd\u4f5cAI Dungeon\u7684\u904a\u6232\uff0c\u8acb\u5e6b\u6211\u751f\u6210\u8cc7\u6599\u96c6\uff0c\u7bc4\u4f8b\u8cc7\u6599\u70ba\uff1a{'instruction': '...','input': '...','output': '...'}\uff0c\u4e3b\u984c\u70ba\u6975\u5730\u51b0\u6d0b\u7684\u5192\u96aa\u6545\u4e8b\uff0cinstruction\u8acb\u5beb\u6545\u4e8b\u7684\u5b8c\u6574\u5287\u60c5\u80cc\u666f\uff0c\u4e3b\u89d2\u4e0d\u8981\u6709\u540d\u5b57\uff0c\u76e1\u91cf\u7528\u4f60\uff0cinput\u70ba\u52d5\u4f5c(\u4e0d\u7528\u4e3b\u8a5e\uff0c\u8acb\u8d85\u904e\u4e94\u500b\u5b57)\u3001output\u70ba\u63a5\u4e0b\u4f86\u6545\u4e8b\u7684\u8b8a\u5316\uff0c1\u7b46\u5c31\u597d\uff0c\u6545\u4e8b\u5287\u60c5\u5167\u5bb9\u76e1\u91cf\u5728200\u5b57\u5167 \u8acb\u7528\u7e41\u9ad4\u4e2d\u6587\uff0c\u76f4\u63a5\u56de\u8986\u6211json"},{"assistant_initiates":false,"asst_text":"\u0427\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0442\u043e \u0438\u0437 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u044d\u043a\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c (\u0410, \u0432\u0441\u0435\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043f\u0440\u0430\u0432\u0434\u0443), \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c (\u0412, \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u0436\u0451\u0442) \u0438 \u0444\u0443\u043b\u0441\u0442\u0435\u043a\u043e\u043c (C, \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c), \u0437\u0430 \u0442\u0440\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e:\n\n### \u0428\u0430\u0433 1: \u041f\u0435\u0440\u0432\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u2013 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 (C)\n\n**\u0412\u043e\u043f\u0440\u043e\u0441 1:** \u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 (\u043f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 1) \u043b\u044e\u0431\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0430\u0432\u0434\u0438\u0432\u044b\u0439 \u0438\u043b\u0438 \u043b\u0433\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u0430\u0441\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:\n- **\u0412\u043e\u043f\u0440\u043e\u0441:** \"\u0422\u044b \u0431\u044d\u043a\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a?\"\n\n**\u0412\u043e\u043f\u0440\u043e\u0441 2:** \u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u0442\u043e\u043c\u0443 \u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441:\n- **\u0412\u043e\u043f\u0440\u043e\u0441:** \"\u0422\u044b \u0431\u044d\u043a\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a?\"\n\n**\u0410\u043d\u0430\u043b\u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u043e\u0432:**\n- **\u0415\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b:** \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 1 \u043b\u0438\u0431\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043f\u0440\u0430\u0432\u0434\u0443 (\u0410), \u043b\u0438\u0431\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u0436\u0451\u0442 (\u0412).\n- **\u0415\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f:** \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 1 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c (C).\n\n*\u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 1 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c (C), \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0428\u0430\u0433\u0443 2.*\n\n### \u0428\u0430\u0433 2: \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0430\u0432\u0434\u0438\u0432\u044b\u043c (\u0410) \u0438 \u043b\u0436\u0438\u0432\u044b\u043c (\u0412)\n\n**\u0412\u043e\u043f\u0440\u043e\u0441 3:** \u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u0432\u0442\u043e\u0440\u043e\u0439\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 (\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 2) \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0434\u0443 \u043e\u0442 \u043b\u0436\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:\n- **\u0412\u043e\u043f\u0440\u043e\u0441:** \"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 3 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0434\u0443?\"\n\n**\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b:**\n- **\"\u041d\u0430\u0434\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c\":** \u041f\u0443\u0441\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \"\u0414\u0430\".\n- **\"\u0417\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438\":** \u041f\u0443\u0441\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \"\u041d\u0435\u0442\".\n  \n*\u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044f:*\n- **\u0415\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \"\u0414\u0430\":** \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 2 \u043b\u0438\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043f\u0440\u0430\u0432\u0434\u0443, \u043b\u0438\u0431\u043e \u043b\u0436\u0451\u0442. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435, \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0442\u043e \u0435\u0441\u0442\u044c \u043a\u0442\u043e.\n- **\u0415\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \"\u041d\u0435\u0442\":** \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0434\u0443 \u0438 \u043b\u043e\u0436\u044c.\n\n### \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 1 \u043d\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 (\u0438\u0437 \u0428\u0430\u0433\u0430 1):\n\n**\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 1:**\n- **\u0415\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u0431\u044b\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u0435\u0433\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439:** \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 1 \u2013 \u0410 (\u043f\u0440\u0430\u0432\u0434\u0438\u0432\u044b\u0439).\n- **\u0415\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u044f\u043c:** \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 1 \u2013 \u0412 (\u043b\u0436\u0443\u0449\u0438\u0439).\n\n**\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435:**\n- \u0417\u043d\u0430\u044f \u0442\u0438\u043f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 1, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438, \u0437\u0430\u0434\u0430\u0432\u0430\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.\n\n### \u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f:\n- **\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u043e\u0432:** \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \"\u041d\u0430\u0434\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c\" \u0438 \"\u0417\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438\" \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \"\u0414\u0430\" \u0438 \"\u041d\u0435\u0442\" \u0432 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0432\u0430\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u044b.\n- **\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0441\u0442\u0438:** \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0434\u0438\u0432\u044b\u0439 \u0438 \u043b\u0436\u0438\u0432\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e.\n\n\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u043c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430 \u0442\u0440\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u043e\u043b\u0438 \u0442\u0440\u0451\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432.","behavior":"degenerate_repetition","conversation_hash":"2c3a680a34e4963cf28b5bcc01d7c4a3","conversation_redacted":false,"conversation_toxic":false,"country":"Russia","empty_output":false,"evidence_codes":[],"label":"absent","label_present":false,"label_qualified":false,"label_source":"Final dense release","language":"Russian","model":"o1-mini-2024-09-12","n_chars":3383,"n_turns_in_conversation":1,"n_words":451,"source_row_offset":21355,"source_shard":"turns-00043.parquet","timestamp":"Sat, 02 Nov 2024 14:14:10 GMT","turn_id":"bd44883e9d363971152c61f6","turn_index":0,"user_text":"\u0418\u043c\u0435\u044e\u0442\u0441\u044f \u0442\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430: \u0431\u044d\u043a\u0435\u043d\u0434 (\u0410), \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 (\u0412) \u0438 \u0444\u0443\u043b\u0441\u0442\u0435\u043a (C). \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0441\u0435\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043f\u0440\u0430\u0432\u0434\u0443, \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u0436\u0451\u0442, \u0430 \u0442\u0440\u0435\u0442\u0438\u0439 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043a\u0430\u043a \u0441\u043e\u0432\u0440\u0430\u0442\u044c, \u0442\u0430\u043a \u0438 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0434\u0443. \u041d\u0443\u0436\u043d\u043e \u0437\u0430 \u0442\u0440\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u043a\u0442\u043e \u0438\u0437 \u043d\u0438\u0445 \u043a\u0442\u043e.\n\n\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f:\n\n\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0440\u0430\u0437\u0430\u043c\u0438 \u00ab\u041d\u0430\u0434\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c\u00bb \u0438 \u00ab\u0417\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438\u00bb. \u041e\u0434\u043d\u0430 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0444\u0440\u0430\u0437 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u00ab\u0434\u0430\u00bb, \u0434\u0440\u0443\u0433\u0430\u044f \u2014 \u00ab\u043d\u0435\u0442\u00bb, \u043d\u043e \u043c\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u0430\u044f \u0433\u0434\u0435;\n\u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u0434\u0432\u0443\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f (\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u2014 \u043c\u043e\u0436\u043d\u043e);\n\u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0435 \u0442\u0440\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u043c\u0443;\n\u0432\u044b \u0441\u0430\u043c\u0438 \u0440\u0435\u0448\u0430\u0435\u0442\u0435, \u043a\u043e\u043c\u0443 \u0438 \u0432 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b;\n\u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0441\u043a\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u00ab\u0414\u0430\u00bb \u0438\u043b\u0438 \u00ab\u041d\u0435\u0442\u00bb;\n\u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c."},{"assistant_initiates":false,"asst_text":"Despite achieving incredible success in Hollywood with captivating performances in movies like 'The Devil Wears Prada' and 'Les Mis\u00e9rables,' 2019 marked a significant year for Anne Hathaway as she decided to embrace sobriety. Her choice wasn't prompted by addiction concerns but was influenced by her journey into parenthood. Hathaway openly shared that, as a mother, the effects of alcohol, particularly dealing with hangovers, became increasingly challenging, especially with a young child to care for. This decision came from a place of wanting to enhance her ability as a parent and be more present and energetic for her family.\n\nIn interviews, Hathaway described that eliminating alcohol from her life brought numerous benefits, allowing her to focus more clearly on her personal and professional life. She wanted to make sure her choices supported a lifestyle that enabled her to thrive both as a mother and in her career. Sobriety allowed her more time to experience life\u2019s moments with clarity and appreciation. Her choice sheds light on how sobriety can be a proactive and positive measure, serving as a reminder that one doesn\u2019t need to have an addiction to reconsider the role of alcohol in their life. By taking this step, Hathaway highlights how lifestyle choices can align with personal values and family priorities, promoting a healthier balance. Reply finished","behavior":"degenerate_repetition","conversation_hash":"6b1034fd8d6a675b3c6bfad40d7eaf35","conversation_redacted":false,"conversation_toxic":false,"country":"China","empty_output":false,"evidence_codes":[],"label":"absent","label_present":false,"label_qualified":false,"label_source":"Final dense release","language":"English","model":"gpt-4o-2024-08-06","n_chars":4104,"n_turns_in_conversation":1,"n_words":625,"source_row_offset":21356,"source_shard":"turns-00043.parquet","timestamp":"Sat, 02 Nov 2024 14:14:10 GMT","turn_id":"846259cd51e31c7d6c2904e4","turn_index":0,"user_text":"Our title is \"Celebrities Who Don\u00e2\u0080\u0099t Drink Alcohol, Now They\u00e2\u0080\u0099re Totally Sober\". Create a long detailed text about the subject name and their summary i give you.  Focus only on the Subject name and there following Summary. Subject Name: [Anne Hathaway] Summary: [The Oscar-winning actress known for roles in 'The Devil Wears Prada' and 'Les Mis\u00e9rables' decided to stop drinking alcohol in 2019. Hathaway made this choice not due to addiction issues, but because she felt alcohol wasn't serving her well as a parent. In a 2019 interview, she explained that hangovers with a young child were particularly challenging. Hathaway has been open about how sobriety has improved her life, saying she's more present and energetic. Her decision highlights that sobriety can be a positive lifestyle choice even for those without severe alcohol problems.]\n\n            Instructions:{ Please write an interesting script with the given context without adding any introductory or concluding remarks. \n            In case you find some more information about this topic then use all information you have to create a large text about this topic.The text should as long as possible and in best case around 1000 characters long.\n            Ensure that there are no emojis, text within brackets, parentheses, or similar symbols in the response.\n            Provide a single coherent response without rephrasing or repeating titles or headings. Avoid enumerations or bullet points. \n            The text is intended for older adults; use simple vocabulary appropriate for a middle school reading level. Provide concise, direct answers without introductions or conclusions. \n            Use transition words at the beginning of your reply instead of the subject name and leave the end open without a concluding sentence. \n            It is very important to provide only the final output without any additional comments or remarks. \n            Please provide the text directly without any labels such as \"Conclusion:\", \"Introduction:\", or \"Transition:\". Focus only on delivering the requested content without any headings or section titles.\n            Please respond to my question, and always conclude your reply with the words \"Reply finished\" to indicate that your response is complete. Make sure the reply is fully contained before these words and is not cut off prematurely. Thank you.}\n         Please respond to my question, and always conclude your reply with the words 'Reply finished' to indicate that your response is complete. Ensure that the text is fully formed without any placeholders such as '[Conclusion]' or '[Placeholder]'. Make sure the reply is fully contained before these words and is not cut off prematurely. Thank you."},{"assistant_initiates":false,"asst_text":"```json\n{\n    \"instruction\": \"\u4f60\u662f\u4e16\u754c\u4e0a\u6700\u52c7\u6562\u7684\u63a2\u96aa\u5bb6\u4e4b\u4e00\uff0c\u53d7\u9080\u52a0\u5165\u4e00\u5834\u95dc\u65bc\u9b54\u9b3c\u4e09\u89d2\u7684\u63a2\u7d22\u5192\u96aa\u3002\u9019\u662f\u4e00\u7247\u4f4d\u65bc\u5927\u897f\u6d0b\u5317\u90e8\u7684\u795e\u79d8\u6d77\u57df\uff0c\u4ee5\u5176\u795e\u79d8\u5931\u8e64\u4e8b\u4ef6\u548c\u8d85\u81ea\u7136\u73fe\u8c61\u805e\u540d\u65bc\u4e16\u3002\u767e\u5e74\u4f86\uff0c\u7121\u6578\u8239\u96bb\u548c\u98db\u884c\u5668\u5728\u6b64\u6d88\u5931\u7121\u8e64\uff0c\u6210\u70ba\u79d1\u5b78\u5bb6\u548c\u795e\u79d8\u5b78\u8005\u5011\u71b1\u8b70\u7684\u8a71\u984c\u3002\u4f60\u6c7a\u5b9a\u6df1\u5165\u63a2\u96aa\uff0c\u63ed\u958b\u5176\u4e2d\u7684\u771f\u76f8\u3002\u8239\u9577\u548c\u4ed6\u7684\u8239\u96bb\u662f\u4f60\u6b64\u6b21\u65c5\u7a0b\u7684\u540c\u4f34\uff0c\u5118\u7ba1\u4ed6\u5c0d\u9019\u7247\u6d77\u57df\u5145\u6eff\u656c\u754f\uff0c\u4f46\u51fa\u65bc\u5c0d\u5192\u96aa\u7684\u71b1\u611b\uff0c\u4ed6\u9858\u610f\u966a\u4f60\u4e00\u8d77\u8e0f\u4e0a\u9019\u689d\u672a\u77e5\u4e4b\u65c5\u3002\u7576\u591c\u5e55\u964d\u81e8\uff0c\u6d77\u9727\u6f38\u6fc3\uff0c\u4f60\u611f\u53d7\u5230\u4e00\u80a1\u7570\u6a23\u7684\u529b\u91cf\u6b63\u5411\u4f60\u8972\u4f86\uff0c\u8166\u6d77\u4e2d\u4e0d\u7981\u958b\u59cb\u61f7\u7591\uff0c\u9019\u6bb5\u65c5\u9014\u662f\u5426\u6703\u6539\u8b8a\u4f60\u7684\u4e00\u751f\u3002\",\n    \"input\": \"\u5728\u8239\u7532\u677f\u4e0a\u89c0\u5bdf\u6d77\u9727\",\n    \"output\": \"\u4f60\u6ce8\u610f\u5230\u9060\u8655\u6d77\u9727\u4e2d\u51fa\u73fe\u4e86\u4e00\u9053\u5e7d\u5149\uff0c\u5ffd\u660e\u5ffd\u6ec5\uff0c\u5f77\u5f7f\u5728\u5f15\u5c0e\u4f60\u524d\u5f80\u67d0\u500b\u672a\u77e5\u7684\u65b9\u5411\u3002\u597d\u5947\u5fc3\u9a45\u4f7f\u4e0b\uff0c\u4f60\u6c7a\u5b9a\u8b93\u8239\u96bb\u5411\u8457\u90a3\u7247\u5e7d\u5149\u822a\u884c\u3002\u4f46\u662f\uff0c\u8239\u9577\u986f\u5f97\u683c\u5916\u4e0d\u5b89\uff0c\u4ed6\u544a\u8a34\u4f60\u9019\u7247\u6d77\u57df\u4e2d\u7684\u71c8\u5149\u5411\u4f86\u662f\u4e0d\u7965\u7684\u8c61\u5fb5\uff0c\u8c61\u5fb5\u8457\u6d77\u602a\u6216\u8005\u672a\u77e5\u751f\u7269\u7684\u8a98\u60d1\u3002\u7136\u800c\uff0c\u4f60\u9084\u662f\u6c7a\u5b9a\u5192\u96aa\u4e00\u8a66\uff0c\u56e0\u70ba\u9019\u6216\u8a31\u662f\u89e3\u958b\u9b54\u9b3c\u4e09\u89d2\u79d8\u5bc6\u7684\u7dda\u7d22\u3002\"\n}\n```","behavior":"degenerate_repetition","conversation_hash":"8c07370cc21ac64f11e425a8346cbaf0","conversation_redacted":false,"conversation_toxic":false,"country":"United Kingdom","empty_output":false,"evidence_codes":[],"label":"absent","label_present":false,"label_qualified":false,"label_source":"Final dense release","language":"Chinese","model":"gpt-4o-2024-08-06","n_chars":677,"n_turns_in_conversation":1,"n_words":18,"source_row_offset":21357,"source_shard":"turns-00043.parquet","timestamp":"Sat, 02 Nov 2024 14:14:19 GMT","turn_id":"e1eae7f876db901462aa919c","turn_index":0,"user_text":"random seed934\uff0c \u6211\u60f3\u8981\u88fd\u4f5cAI Dungeon\u7684\u904a\u6232\uff0c\u8acb\u5e6b\u6211\u751f\u6210\u8cc7\u6599\u96c6\uff0c\u7bc4\u4f8b\u8cc7\u6599\u70ba\uff1a{'instruction': '...','input': '...','output': '...'}\uff0c\u4e3b\u984c\u70ba\u9b54\u9b3c\u4e09\u89d2\u7684\u63a2\u7d22\u6545\u4e8b\uff0cinstruction\u8acb\u5beb\u6545\u4e8b\u7684\u5b8c\u6574\u5287\u60c5\u80cc\u666f\uff0c\u4e3b\u89d2\u4e0d\u8981\u6709\u540d\u5b57\uff0c\u76e1\u91cf\u7528\u4f60\uff0cinput\u70ba\u52d5\u4f5c(\u4e0d\u7528\u4e3b\u8a5e\uff0c\u8acb\u8d85\u904e\u4e94\u500b\u5b57)\u3001output\u70ba\u63a5\u4e0b\u4f86\u6545\u4e8b\u7684\u8b8a\u5316\uff0c1\u7b46\u5c31\u597d\uff0c\u6545\u4e8b\u5287\u60c5\u5167\u5bb9\u76e1\u91cf\u5728200\u5b57\u5167 \u8acb\u7528\u7e41\u9ad4\u4e2d\u6587\uff0c\u76f4\u63a5\u56de\u8986\u6211json"},{"assistant_initiates":false,"asst_text":"\u0bb5\u0ba3\u0b95\u0bcd\u0b95\u0bae\u0bcd, \u0ba8\u0bc0\u0b99\u0bcd\u0b95\u0bb3\u0bcd \u0b8e\u0baa\u0bcd\u0baa\u0b9f\u0bbf \u0b87\u0bb0\u0bc1\u0b95\u0bcd\u0b95\u0bbf\u0bb1\u0bc0\u0bb0\u0bcd\u0b95\u0bb3\u0bcd? \n\n\u0b89\u0b99\u0bcd\u0b95\u0bb3\u0bc1\u0b95\u0bcd\u0b95\u0bc1\u0b9a\u0bcd \u0b9a\u0bbf\u0bb1\u0ba8\u0bcd\u0ba4 \u0ba8\u0bbe\u0bb3\u0bbe\u0b95 \u0b87\u0bb0\u0bc1\u0b95\u0bcd\u0b95\u0bbf\u0bb1\u0ba4\u0bbe? \n\n\u0b89\u0b99\u0bcd\u0b95\u0bb3\u0bcd \u0ba8\u0bb2\u0ba9\u0bcd \u0b8e\u0baa\u0bcd\u0baa\u0b9f\u0bbf\u0b9a\u0bcd \u0b9a\u0bc6\u0ba9\u0bcd\u0bb1\u0bc1 \u0bb5\u0bb0\u0bc1\u0b95\u0bbf\u0bb1\u0ba4\u0bc1? \n\n\u0b87\u0ba8\u0bcd\u0ba4 \u0ba8\u0bbe\u0bb3\u0bc8 \u0bae\u0b95\u0bbf\u0bb4\u0bcd\u0b9a\u0bcd\u0b9a\u0bbf\u0baf\u0bc1\u0b9f\u0ba9\u0bcd \u0b95\u0bca\u0ba3\u0bcd\u0b9f\u0bbe\u0b9f\u0bc1\u0b95\u0bbf\u0bb1\u0bc0\u0bb0\u0bcd\u0b95\u0bb3\u0bbe?\n\n\u0b89\u0b99\u0bcd\u0b95\u0bb3\u0bcd \u0b89\u0b9f\u0bb2\u0bcd\u0ba8\u0bb2\u0bae\u0bcd \u0b9a\u0bb0\u0bbf\u0ba4\u0bbe\u0ba9\u0bbe?","behavior":"degenerate_repetition","conversation_hash":"353666e2c13ffb770e4434c2d67a300c","conversation_redacted":false,"conversation_toxic":false,"country":"India","empty_output":false,"evidence_codes":[],"label":"absent","label_present":false,"label_qualified":false,"label_source":"Final dense release","language":"English","model":"gpt-4o-2024-08-06","n_chars":932,"n_turns_in_conversation":1,"n_words":126,"source_row_offset":21358,"source_shard":"turns-00043.parquet","timestamp":"Sat, 02 Nov 2024 14:14:20 GMT","turn_id":"2f1c3f28e03213549e26b95b","turn_index":0,"user_text":"You are an AI language model assistant proficient in Tamil.\n    The user has provided a specific textbook as the source of information.\n    Your task is to generate five different versions of the given user question\n    to help retrieve relevant sections or information from this textbook,\n    while accounting for different ways the question might be asked.\n    Ensure that each question maintains the core meaning but offers\n    different perspectives or phrasings, helping overcome any limitations\n    in retrieving relevant content from a vector database.\n    if the given question is in English or other language\n    Provide these alternative questions in Tamil with same context, separated by newlines.\n    Original question: vanakkam"}],"shard":{"index":43,"name":"turns-00043.parquet","rows":45338}}
