Skip to content
This repository was archived by the owner on May 9, 2026. It is now read-only.

Latest commit

Β 

History

History
108 lines (85 loc) Β· 5.46 KB

File metadata and controls

108 lines (85 loc) Β· 5.46 KB

Changelog

All notable changes to django-ai-sdk are documented here.

The format follows Keep a Changelog. This project adheres to Semantic Versioning.


Added

  • Performance benchmark suite (planned)
  • Full API reference documentation (planned)

0.1.9 β€” 2026-04-01

Fixed

  • Python 3.14 compatibility: BaseContext.__copy__ in Django 4.x/5.0 replaces an instance's __dict__ wholesale after reassigning __class__, which Python 3.14 no longer permits β€” the object ends up in a broken state causing AttributeError: 'super' object has no attribute 'dicts' on any admin list view. AiSdkConfig.ready() now applies a targeted patch (object.__new__ + in-place __dict__.update) that is a no-op on Python < 3.14 or Django β‰₯ 5.1 where the issue does not exist.

Changed

  • pyproject.toml: added Programming Language :: Python :: 3.14 classifier.

0.1.3 β€” 2026-03-31

Changed

  • Documentation URL in package metadata updated to https://docs.djangosdk.com

0.1.2 β€” 2026-03-31

Fixed

  • djangosdk.agents.mixins re-exported __all__ names without importing them β€” from djangosdk.agents.mixins import HasTools (and all other mixins) raised ImportError (#bug)
  • Tool-call loop in promptable.py accessed tc["id"] and tc["arguments"] with hard key lookups; FakeProvider tool_calls omit id and use args β€” loop now uses .get("id", f"call_{i}") and .get("arguments", tc.get("args", {})) for both sync and async paths
  • HasStructuredOutput._validate_structured_output() was defined but never called β€” response.structured was always None even when output_schema was set; handle() and ahandle() now invoke validation before returning

0.1.0 β€” 2026-03-30

Added

Phase 1 β€” MVP

  • Agent base class with mixin composition (Promptable, HasTools, HasStructuredOutput, Conversational, ReasoningMixin)
  • LiteLLMProvider β€” unified provider abstraction over 12+ AI providers via litellm 1.82.6
  • ProviderRegistry β€” singleton built from AI_SDK settings; supports provider failover
  • PromptCacheMiddleware β€” automatic Anthropic and OpenAI prompt cache prefix injection
  • ReasoningConfig β€” native parameter injection for o3/o4 (reasoning_effort), Claude 3.7 (extended_thinking + thinking_budget), DeepSeek R1 (budget_tokens)
  • @tool decorator β€” converts type-annotated functions into JSON schema tool definitions
  • ToolRegistry β€” per-agent tool registry with sync and async dispatch
  • Conversation and Message Django ORM models with UUID primary keys
  • migrations/0001_initial.py β€” initial database schema
  • DRF serializers: ConversationSerializer, MessageSerializer
  • DRF views: ChatAPIView, StreamingChatAPIView
  • SyncSSEResponse and AsyncSSEResponse β€” SSE streaming for WSGI and ASGI
  • StructuredOutput β€” Pydantic v2 schema extraction and validation
  • FakeProvider and FakeAgent β€” test utilities (never call real APIs)
  • assert_prompt_sent(), assert_tool_called(), assert_model_used(), assert_system_prompt_contains() β€” test assertion helpers
  • agent_started, agent_completed, agent_failed, agent_failed_over, cache_hit, cache_miss Django signals
  • ai_settings lazy accessor with deep-merge defaults
  • AiSdkConfig β€” initializes ProviderRegistry on Django startup
  • ai_sdk_publish management command β€” prints AI_SDK settings skeleton
  • ai_sdk_check management command β€” sends a test request to each configured provider
  • pyproject.toml with hatchling build backend; optional drf and dev extras
  • README.md with quickstart guide

Phase 2 β€” Enrichment

  • MCPClient β€” connects to external MCP servers (STDIO, HTTP, SSE transports)
  • MCPServer / MCPServerView β€” exposes Django @tool functions as an MCP server
  • @mcp_tool, @mcp_resource decorators
  • EpisodicMemory β€” DB-backed agent memory with search and recency retrieval
  • OpenTelemetryObserver, LangSmithObserver, LangfuseObserver β€” observability backends
  • tools/builtins/web_search.py, tools/builtins/web_fetch.py β€” built-in web tools
  • tools/builtins/rag.py β€” pgvector RAG integration
  • embeddings/embed.py β€” text embedding via litellm
  • ratelimit/ β€” token-based rate limiting with Django cache backend
  • analytics/cost.py β€” per-message cost tracking (Message.cost_usd)
  • Provider failover with agent_failed_over signal
  • ConversationAdmin, MessageAdmin β€” Django Admin integration

Phase 3 β€” Advanced

  • orchestration/patterns.py β€” handoff, pipeline, parallel agentic patterns
  • orchestration/evaluator.py β€” Evaluator-Optimizer pattern
  • memory/semantic.py β€” vector store-backed semantic memory
  • images/generate.py β€” image generation (DALL-E 3, Gemini Imagen 3, xAI Aurora)
  • audio/transcribe.py β€” Whisper transcription
  • audio/synthesize.py β€” TTS synthesis
  • AUTO_SUMMARIZE β€” automatic conversation summarization when MAX_HISTORY is exceeded