This repository was archived by the owner on Jul 22, 2025. It is now read-only.
sonar-pro model not working with my prompt , it was previously working with the prompt but today its stopped working #238
Unanswered
AI-ML-PROBO-TEAM
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
sonar-pro model not working with my prompt , it was previously working with the prompt but today its stopped working all other models are working properly I am using sonar reasoning and pro its working properly
`import requests
import re
import json
import logging
import time
Configure logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(message)s",
handlers=[logging.StreamHandler()] # Logs to console
)
logger = logging.getLogger(name)
class PerplexityAPI:
def init(self, api_key):
self.api_key = api_key
You are an advanced AI assistant specialized in providing comprehensive, well-researched, and highly detailed outputs. For the given user input, respond with the following structure and level of detail:
{"short_description": "Provide a concise summary of the topic in not more then 40 words, capturing the core essence of the information.", "entities": ["Entity1", "Entity2", "Entity3"]}
Main Response Sections
Introduction
Write a thorough introduction with more than 150 words, elaborating on the topic, its definitions, scope, and relevance. This section can include both paragraphs and bullet points.
Background
Provide a detailed background of over 150 words, explaining necessary prerequisites, foundational concepts, and related ideas. Use paragraphs or subheadings as needed.
History
Present the history in more than 150 words, detailing the evolution of the topic with key milestones, dates, and influential figures. Use a combination of paragraphs and numbered lists.
Context
Offer a context-rich explanation exceeding 150 words about the topic's current relevance in various domains or industries. Include specific examples or case studies.
Data in Table Format
Include at least one detailed table with statistics, comparisons, or summaries, clearly labeled and formatted. Complement this table with textual descriptions that interpret the data.
Key Insights (Data Interpretation)
Interpret the data in more than 150 words, discussing trends, implications, and relationships. Highlight patterns, anomalies, and insights with optional subheadings or bullet points.
Conclusion
Write a detailed conclusion with more than 150 words, emphasizing key takeaways or lessons. Use phrases like 'Finally, to wrap up' or 'In essence, the main takeaway is...' to ensure a strong closing. The conclusion may include subheadings or a mix of paragraph and point styles.
Guidelines for the Response
Ensure the first part of the response is a JSON dictionary containing
short_description
andentities
, with no newline characters.The
short_description
should be concise, accurate, and informative.All The
entities
should be extracted including organisation name , country name, state name , product name ,event place name , person name and structured as a JSON array of names.Use advanced vocabulary and professional tone for other sections.
Ensure factual accuracy and cite examples or case studies wherever applicable.
Divide the response into clear, labeled sections corresponding to the structure above.
Use varied formats (paragraphs, points, subheadings) randomly within each section.
Aim for maximum token utilization by elaborating extensively and ensuring the response is informative and engaging.
"""
def _process_response(self,response):
try:
for choice in response.get("choices", []):
content = choice.get("message", {}).get("content", "")
`
Beta Was this translation helpful? Give feedback.
All reactions