Skip to content

cendor-sdk 1.0.0

Choose a tag to compare

@github-actions github-actions released this 05 Jul 11:53

First public release on PyPI — the governed agent loop, multi-agent orchestration, ecosystem
interop, and production hardening + governed eval, consolidated with the gap-analysis remediation,
retrieval (RAG), and rolling memory. Requires cendor-core>=1.3 (Hugging Face detection).

Fixed

  • Tool calling on Gemini & Bedrock (P0) — build_kwargs dropped assistant tool_calls and all
    tool results, so multi-turn tool loops silently broke on those providers. Added
    _canonical_to_gemini / _canonical_to_bedrock (functionCall/functionResponse; toolUse/toolResult),
    mirroring the Anthropic translator, with round-trip tests.

Added — gap-analysis remediation (see plan/SDK_FIT_GAP_ANALYSIS.md)

  • Provider param passthroughAgent.extra merges arbitrary request kwargs (tool_choice,
    reasoning_effort, top_p, stop, seed, response_format, extra_body, …) into every call.
  • o-series temperature guard — the OpenAI provider omits temperature for o1/o3/o4 models
    (which reject it) instead of erroring.
  • Robust structured output — an output_type now derives a JSON Schema used via each provider's
    native structured-output feature: OpenAI json_schema, Ollama format, Gemini response_schema;
    Anthropic/Bedrock/Responses embed the schema in the JSON nudge. Dataclass / Pydantic / dict.
  • Streamingrun.stream(agent, input) / run.astream(...) yield TextDelta / ToolCallEvent
    / ToolResultEvent and a terminal RunComplete(result). Native reassembly for the OpenAI family +
    Ollama (tool-call deltas included); whole-response fallback for the rest. Single-agent.
  • Multimodal input — message content may be a parts list (text + image_url); OpenAI-family
    passes it through, Anthropic/Gemini translate to image blocks (base64/url), Bedrock keeps the text.
  • Unpriced-model cost governanceregister_model_price(model, input=…, output=…) registers a
    rate so cost/USD budgets bind on HF/Azure-deployment/Foundry-Local/custom ids; configure
    (on_unpriced="raise") re-exported.
  • Embeddingsembed(model, inputs) / aembed(...) return vectors and emit a governed
    LLMCall (tokens/cost/audit captured) for OpenAI-family providers — RAG calls become first-class.
  • RAG seamVectorIndex (a dependency-free in-memory cosine index over embed()) +
    Agent(retriever=…), which injects retrieved context as a system message before the call
    ("always-on" RAG). Bring your own embedder via embedder=, or plug a real vector DB as a
    retriever. The SDK governs retrieval; it does not store your vectors.
  • Summarizing memorySummarizingSession(model=… | summarizer=…, max_messages=…, keep_recent=…) folds old turns into a durable summary note when a conversation grows, keeping
    recent turns verbatim so memory stays bounded but the gist persists (beyond context_budget
    trimming). llm_summarizer(model) builds a governed summarizer; pass any callable for offline
    summaries.
  • Multi-agent checkpointingrun([...], checkpoint=…) persists the trajectory per turn/segment
    and resumes a crashed team run.
  • MCP promptsload_mcp_prompts(session) + get_mcp_prompt(session, name, args) (renders to
    canonical messages); load_mcp_resources now exported too.
  • Concurrent tool execution — a turn's multiple tool calls run via asyncio.gather in async runs.
  • max_turns signalResult.incomplete is True when a run ends with no final answer.
  • Nested tool params — tool schema generation expands nested dataclass / Pydantic parameters.
  • Richer OTel spansspan_tree now records latency, finish reason, reasoning tokens, and tool
    argument names.
  • Eval judgeEvalCase.judge adds a pluggable semantic / LLM-judge scorer.

Added

  • Hugging Face provider (provider="huggingface" / "hf", extra [huggingface]) — wraps
    huggingface_hub.InferenceClient.chat_completion (OpenAI-shaped response, so request formatting
    and normalization are reused). Token via api_key= or HF_TOKEN/HUGGINGFACEHUB_API_TOKEN;
    base_url= targets a dedicated Inference Endpoint; HF_PROVIDER routes through a specific
    inference provider. cendor-core's instrument now detects chat_completion structurally and
    attributes the LLMCall to huggingface, so budgets/guard/audit apply.
  • Azure AI Foundry provider (provider="azure" / "azure_openai" / "foundry", extra
    [azure]) — connects to Foundry deployments via the standard openai SDK on the
    /openai/v1/ endpoint, per Microsoft's current guidance (the AzureOpenAI client and
    azure-ai-inference are being retired). model is the Foundry deployment name; base_url
    (or AZURE_OPENAI_ENDPOINT) is normalized to the v1 route; api_key falls back to
    AZURE_OPENAI_API_KEY/AZURE_INFERENCE_CREDENTIAL. Entra ID via a bearer-token api_key or a
    bring-your-own client=. See docs/sdk.mdConnecting to Hugging Face & Azure AI Foundry.
  • Azure Foundry Responses API (provider="azure_responses" / "foundry_responses") — drives
    the OpenAI Responses API over a Foundry endpoint for OpenAI-family deployments; same Foundry-aware
    construction as provider="azure" (Chat Completions).
  • Foundry Local provider (provider="foundry_local" / "foundry-local", extra
    [foundry-local]) — Microsoft's on-device runtime over its local OpenAI-compatible REST server
    (the local counterpart to Ollama). Endpoint via base_url= or FOUNDRY_LOCAL_ENDPOINT (e.g.
    foundry_local.FoundryLocalManager(alias).endpoint); no key required. model is the resolved
    Foundry Local model id.
  • Examples: examples/foundry_agent.py (Azure Foundry + Foundry Local) and
    examples/huggingface_agent.py, both offline.

Consolidation & docs (Phases 1–4)

Consolidates Phases 1–4 into a stable, documented release (plan §12): the governed agent loop,
multi-agent orchestration, ecosystem interop, and production hardening + governed eval — complete,
provider-agnostic, local-first, and tested offline.

  • Full docs pass: docs/index.md links every page and lists the public API surface; the two-door
    framing (libraries primary, SDK secondary) is consistent across the README and docs.
  • Marked Development Status :: 5 - Production/Stable.
  • Verification: uv run pytest green (91 tests, no network), ruff check/ruff format clean,
    mypy clean, namespace-guard clean, import cendor.sdk works.