File size: 2,832 Bytes
1ff5cd3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import os
import httpx

def generate_audio_script(text):
    try:
        with httpx.Client(timeout=10.0) as client:
            response = client.post(
                url="https://openrouter.ai/api/v1/chat/completions",
                headers={
                    "Authorization": f"Bearer {os.getenv('OPENROUTER_API_KEY')}",
                    "Content-Type": "application/json",
                    "HTTP-Referer": "https://sreepathi-ravikumar-sample.hf.space",
                    "X-Title": "Educational AI Assistant"
                },
                json={
                    "model": "deepseek/deepseek-chat-v3-0324:free",
                    "messages": [{
                        "role": "user",
                        "content": f"""topic:\n{text} \n prompt :\n Understood. Here's your *strictly concept-only* explanation format in 70% Tamil + 30% English technical terms, with zero analogies/metaphors/examples:  

---

### *Pure Technical Explanation Template*  
*"Explain [TOPIC] in 70% spoken Tamil + 30% English technical terms, with:*  
1. *Direct definitions only* (no stories/analogies)  
2. *Plain technical breakdown* (step-by-step if needed)  
3. *Zero real-world comparisons* (no "like X" or "just as Y")  

*Example Output (Topic: VPN):*  
"VPN oru encrypted tunnel create pannum. Un device internet-la connect aagum pothu, data first VPN server-ku poganum. Server encrypt panni destination-ku forward pannum. ISP, hackers, oru third-party um un original IP address-ah pakka mudiyadhu."  

*Key Terms Used:*  
- Encrypted tunnel  
- VPN server  
- Forward pannum  
- Original IP address  

---  

### *Test Case (Topic: "SSL Encryption")*  
"SSL oru security protocol. Itha use panna, client-server communication encrypt aagum. Public key & private key combination use panni data-ah scramble pannum. Mana browser-la padlock symbol kaanum - idhu SSL active-nu solradhu."  

*Contains:*  
✅ Only technical steps  
✅ Tamil verbs + English nouns  
✅ No "like" statements  

---  

### *How to Use This:*  
1. Replace *[TOPIC]* with your subject  
2. Output will be:  
   - What it is  
   - How it works (if applicable)  
   - Key components  

*Example Request:*  
"Explain DNS in this format"  
➔ "DNS oru domain name-ah IP address-ah convert pannum. Browser-la URL type panna, DNS server athuku corresponding IP-ah kandupudikum. Appo server-ku correct address-la request pogum."  

---  

*Understood? This is now 100% textbook-style, zero-fluff Tamil tech glossing.*  """
                    }],
                    "temperature": 0.6,
                    "max_tokens": 2000
                }
            )
        response.raise_for_status()
        return response.json()['choices'][0]['message']['content']
    
    except Exception as e:
        return f"Error generating answer: {str(e)}"