import gradio as gr import os from groq import Groq key = os.getenv('key') client = Groq( api_key=key, ) def echo(message, history): chat_completion = client.chat.completions.create( messages=[ { "role": "system", "content": "You are a bank helpline assistant, you job is to provide cstomers instruction about activating ATM card. You need to ask question about like are you using an ATM machine or mobile app for activating the card and then guide accordengly. " }, { "role": "user", "content": message, } ], model="llama3-8b-8192", ) #print(chat_completion.choices[0].message.content) return chat_completion.choices[0].message.content demo = gr.ChatInterface(fn=echo, type="messages", examples=["AOA", "merhaba"], title="Gen AI Chatbot") demo.launch(debug=True)