Skip to content

Conversation

arre-ankit
Copy link
Member

TLDR

This PR adds the Images primitive to the Python SDK, enabling image generation capabilities through various AI providers (OpenAI, Google, Together AI, OpenRouter).

Key Changes:

  • ✨ New Images primitive class with generate() method
  • 📝 Type definitions for image generation requests and responses
  • 📚 Example scripts for OpenAI, Google, Together AI, and OpenRouter

Dive Deeper

  1. Consistency across Python SDK
  2. Error Handling: Comprehensive validation ensures helpful error messages for missing required parameters
  3. Header Management: API key is correctly sent via LB-LLM-Key header, not in the request body
  4. Type Safety: Full type annotations using TypedDict for response structures
  5. Examples: Production-ready example scripts with proper environment variable handling and error messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant