Spaces:
Sleeping
Sleeping
Update brave.py
Browse files148 unmodified lines1491501511521531541551 unmodified line157158159160161162163164165166167168148 unmodified lines@retry(stop=stop_after_attempt(3), wait=wait_exponential(multiplier=1, min=4, max=10))def generate_detailed_explanation(query, context):prompt = f"""Based on the following summarized context, provide a detailed explanation of the topic. Make sure to incorporate all relevant details, facts, and figures from the context.Here's the topic: "{query}".Use this Context to answer the above query:1 unmodified lineImportant: Don't mention that you are answering based on the context. Just start with the main response. Avoid phrases like 'Based on the context provided, ...' etc.Detailed Explanation:"""try:chat_completion = groq_client.chat.completions.create(messages=[{"role": "system", "content": "You are a knowledgeable assistant that provides detailed explanations on various topics, incorporating all relevant information from the given context."},{"role": "user", "content": prompt}],model="llama-3.1-8b-instant",148 unmodified lines1491501511521531541551 unmodified line157158159160161162163164165166167168148 unmodified lines@retry(stop=stop_after_attempt(3), wait=wait_exponential(multiplier=1, min=4, max=10))def generate_detailed_explanation(query, context):prompt = f"""Based on the following summarized context, provide a good and easy to understand explanation of the topic. Make sure to incorporate all relevant details, facts, and figures from the context.Here's the topic: "{query}".Use this Context to answer the above query:1 unmodified lineImportant: Don't mention that you are answering based on the context. Just start with the main response. Avoid phrases like 'Based on the context provided, ...' etc.Explanation:"""try:chat_completion = groq_client.chat.completions.create(messages=[{"role": "system", "content": "You are a knowledgeable assistant that provides good and easy to understand explanations on various topics, incorporating all relevant information from the given context."},{"role": "user", "content": prompt}],model="llama-3.1-8b-instant",
brave.py+3-3