# Python AI SDK ## Docs - [Basic text generation](https://pythonaisdk.mintlify.app/examples/basic-text.md): Your first ai_sdk call – generate a greeting with one function. - [Vector search](https://pythonaisdk.mintlify.app/examples/embeddings-search.md): Embed a corpus and find the most similar sentence via cosine similarity. - [Streaming responses](https://pythonaisdk.mintlify.app/examples/streaming.md): Display tokens as they arrive using stream_text. - [Structured outputs](https://pythonaisdk.mintlify.app/examples/structured-output.md): Ask the model to return JSON validated against a Pydantic schema. - [Tool-calling agents](https://pythonaisdk.mintlify.app/examples/tool-agent.md): Let the model call real Python functions to answer user queries. - [Agent](https://pythonaisdk.mintlify.app/sdk/agent.md): Create AI agents with persistent state, system prompts, and tool-calling capabilities. - [Concepts & architecture](https://pythonaisdk.mintlify.app/sdk/concepts.md): Understand the design goals and internal building blocks of ai_sdk. - [cosine_similarity](https://pythonaisdk.mintlify.app/sdk/cosine_similarity.md): Calculate cosine similarity between two embedding vectors for semantic similarity analysis. - [embed](https://pythonaisdk.mintlify.app/sdk/embed.md): Embed a single text value into a high-dimensional vector for semantic analysis. - [embed_many](https://pythonaisdk.mintlify.app/sdk/embed_many.md): Embed multiple text values efficiently with automatic batching and retry logic. - [generate_object](https://pythonaisdk.mintlify.app/sdk/generate_object.md): Parse model output directly into your own Pydantic models with automatic validation and retries. - [generate_text](https://pythonaisdk.mintlify.app/sdk/generate_text.md): Generate text synchronously with a single call - returns a GenerateTextResult with rich metadata. - [Introduction](https://pythonaisdk.mintlify.app/sdk/introduction.md): The Python AI SDK is a pure Python re-implementation of Vercel's popular AI SDK for TypeScript. - [Providers](https://pythonaisdk.mintlify.app/sdk/providers.md): Factory functions that create ready-to-use model instances for different AI providers. - [Anthropic Provider](https://pythonaisdk.mintlify.app/sdk/providers/anthropic.md): Claude models with OpenAI-compatible API interface for seamless integration. - [OpenAI Provider](https://pythonaisdk.mintlify.app/sdk/providers/openai.md): Full OpenAI integration with GPT models, embeddings, function calling, and structured output. - [stream_object](https://pythonaisdk.mintlify.app/sdk/stream_object.md): Stream structured output asynchronously with real-time validation and partial object updates. - [stream_text](https://pythonaisdk.mintlify.app/sdk/stream_text.md): Stream text asynchronously for low-latency real-time generation with optional callbacks. - [Tool Calling](https://pythonaisdk.mintlify.app/sdk/tool.md): Define and use tools with the AI SDK for function calling capabilities. - [Data types](https://pythonaisdk.mintlify.app/sdk/types.md): Pydantic models used by the SDK – message hierarchy, token usage, tool calls and more. ## Optional - [GitHub](https://github.com/python-ai-sdk/sdk) - [PyPI](https://pypi.org/project/ai-sdk-python/)