# ai-sdk-preview-python-streaming **Repository Path**: dext7r/ai-sdk-preview-python-streaming ## Basic Information - **Project Name**: ai-sdk-preview-python-streaming - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: dependabot/pip/jinja2-3.1.5 - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-15 - **Last Updated**: 2025-09-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AI SDK Python Streaming Preview This template demonstrates the usage of [Data Stream Protocol](https://sdk.vercel.ai/docs/ai-sdk-ui/stream-protocol#data-stream-protocol) to stream chat completions from a Python endpoint ([FastAPI](https://fastapi.tiangolo.com)) and display them using the [useChat](https://sdk.vercel.ai/docs/ai-sdk-ui/chatbot#chatbot) hook in your Next.js application. ## Deploy your own [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fai-sdk-preview-python-streaming&env=OPENAI_API_KEY&envDescription=API%20keys%20needed%20for%20application&envLink=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fai-sdk-preview-python-streaming%2Fblob%2Fmain%2F.env.example) ## How to use Run [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example: ```bash npx create-next-app --example https://github.com/vercel-labs/ai-sdk-preview-python-streaming ai-sdk-preview-python-streaming-example ``` ```bash yarn create next-app --example https://github.com/vercel-labs/ai-sdk-preview-python-streaming ai-sdk-preview-python-streaming-example ``` ```bash pnpm create next-app --example https://github.com/vercel-labs/ai-sdk-preview-python-streaming ai-sdk-preview-python-streaming-example ``` To run the example locally you need to: 1. Sign up for accounts with the AI providers you want to use (e.g., OpenAI, Anthropic). 2. Obtain API keys for each provider. 3. Set the required environment variables as shown in the `.env.example` file, but in a new file called `.env`. 4. `pnpm install` to install the required Node dependencies. 5. `virtualenv venv` to create a virtual environment. 6. `source venv/bin/activate` to activate the virtual environment. 7. `pip install -r requirements.txt` to install the required Python dependencies. 8. `pnpm dev` to launch the development server. ## Learn More To learn more about the AI SDK or Next.js by Vercel, take a look at the following resources: - [AI SDK Documentation](https://sdk.vercel.ai/docs) - [Next.js Documentation](https://nextjs.org/docs)