Introduction
The Friendli Python SDK provides a powerful and flexible way to interact with FriendliAI services, including Serverless Endpoints, Dedicated Endpoints, and Container. This allows developers to easily integrate their Python applications with FriendliAI.Installation
The SDK can be installed with either pip or poetry:Authentication
Authentication is done using a Friendli Token, which can be generated from the Friendli Suite in your Personal Settings:Chat Completions
The SDK supports chat completions across all deployment types. Choose the deployment option that best fits your needs.Asynchronous Chat Completions
Tool-Assisted Chat Completions
Tool-assisted chat completions are only available for Serverless endpoints.
Advanced Features
Streaming Responses
The SDK supports streaming responses using server-sent events, which can be consumed using a simplefor
loop: