Use LangChain or LiteLLM to switch between frontier models (GPT-4o, Claude, Gemini) with the same interface.
pip install langchain langchain-openai litellm
Gradio lets you prototype AI interfaces in minutes.
import gradio as gr
def chat(message, history):
return f"You said: {message}"
gr.ChatInterface(chat, title="AI Chatbot").launch()
system_prompt = "You are a helpful airline assistant."
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": "Book a flight from NYC to London."}
]
Build an agentic workflow where the LLM calls tools to query an SQLite database for flights.
import sqlite3
def search_flights(origin, destination, date):
conn = sqlite3.connect("flights.db")
cursor = conn.cursor()
cursor.execute("SELECT * FROM flights WHERE origin=? AND destination=?",
(origin, destination))
return cursor.fetchall()