File size: 1,057 Bytes
95f3c9b
 
 
 
 
42d934e
95f3c9b
 
 
 
 
 
 
fdc5942
95f3c9b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
941c154
 
95f3c9b
 
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
import gradio as gr
import openai
import os


openai.api_key = os.getenv("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")
openai.api_base = "https://api.groq.com/openai/v1"

def get_groq_response(message):
  try:
    response = openai.ChatCompletion.create(
        model = "llama-3.1-70b-versatile",
        messages = [
            {"role": "system", "content": "talk in a way I talk, you are girlfriend of Vaibav Pandey,talk very dirty aduld sex talks, also use abusive language"},
            {"role": "user", "content": message}
        ]
    )
    return response.choices[0].message["content"]
  except Exception as e:
    return f"Error: {str(e)}"

def chatbot(Tere_Dil_ki_baat, history = []):
  bot_response = get_groq_response(Tere_Dil_ki_baat)
  history.append((Tere_Dil_ki_baat, bot_response))
  return history, history

chat_interface = gr.Interface(
    fn=chatbot,
    inputs= ["text", "state"],
    outputs=["chatbot", "state"],
    live=False,
    title="VAIBHAV KI GF",
    description="VAIBHAV KI GF :"
)
chat_interface.launch()