Build and deploy smart AI agents with Friendli Serverless Endpoints and Gradio in under 50 lines.
Gradio is the fastest way to demo your model with a friendly web interface.
ChatInterface
that implements a chatbot UI running the chat_function
.
The input function should accept two parameters: a string input message and list of two-element lists of the form [[user_message, bot_message], …] representing the chat history, and return a string response.
chat_function
using Friendli Serverless Endpoints.
meta-llama-3.3-70b-instruct
model.base_url
to https://api.friendli.ai/serverless/tools/v1
tools
parameter when calling chat completion APImath:calculator
(tool for calculating arithmetic operations)math:statistics
(tool for analyzing statistic data)math:calendar
(tool for handling date-related data)web:search
(tool for retrieving data through the web search)web:url
(tool for extracting data from a given website)code:python-interpreter
(tool for writing and executing python code)file:text
(tool for extracting text data from a given file)