Skip to content

aiXplainKit v2: Clean-slate SDK rewrite aligned with Python v2 architecture#13

Open
MaiaJP-AIXplain wants to merge 1 commit intomainfrom
v2_agents
Open

aiXplainKit v2: Clean-slate SDK rewrite aligned with Python v2 architecture#13
MaiaJP-AIXplain wants to merge 1 commit intomainfrom
v2_agents

Conversation

@MaiaJP-AIXplain
Copy link
Collaborator

Summary

Complete v2 rewrite of the aiXplainKit Swift SDK, replacing all v1 code with a clean-slate implementation aligned with the aiXplain Python SDK v2.

185 files changed (~9,000 lines added, ~8,800 lines removed).

What changed

  • Auth & Credentials — new Credential type with API-key and environment-variable resolution; AuthenticationScheme enum for header injection.
  • HTTP Client — unified AixplainClient with configurable base URL, retry policy, and typed Response<T> wrapper; replaces the old Networking layer.
  • Entry Point — single Aixplain context object replaces AiXplainKit.shared / APIKeyManager globals.
  • Agents — full lifecycle: Agent.get, Agent.search, Agent.save, Agent.run, Agent.delete, multi-turn sessions via generateSessionId(), output format control, task/history introspection, and cloning.
  • ModelsModel.get, Model.search, Model.run, and streaming support. ModelResult response type.
  • Tools & IntegrationsTool (subclass of Model), Integration.get/connect, AgentToolConvertible protocol, AgentToolDict for agent composition.
  • Index & SearchIndex.get, Index.create, Index.upsert, Index.search with IndexFilter operators and Record type.
  • Resources layer — shared BaseResource protocol, Page<T> pagination, AnyCodable, enums for AIFunction, AssetStatus, Supplier, ToolType.
  • Error hierarchy — structured AixplainError with nested domain errors (APIError, AuthError, ValidationError, ResourceError, TimeoutError, FileUploadError) and userMessage for display.
  • Examples — 8 runnable Swift examples covering quick-start through advanced agent workflows.
  • RFCs — 9 design documents in docs/rfcs/ describing every architectural decision.
  • Tests — new unit tests (Agents, Auth, Client, Errors, Index, Models, Resources, Tools) and E2E tests (Agent, Client, Index, Model, Tool).
  • Removed — all v1 modules (Networking, Provider/*, Modules/*, old Asset hierarchy, APIKeyManager, FileManager, v1 tutorials and DocC snippets).

How to test

  1. Unit tests (no API key needed)

    swift test --filter Unit

    Covers JSON decoding, error construction, credential resolution, model/agent/tool/index/resource logic, and client request building.

  2. E2E tests (requires API key)

    export TEAM_API_KEY="<your-team-key>"
    swift test --filter E2E

    Runs live calls against the aiXplain platform for agents, models, tools, indexes, and the HTTP client.

  3. Run examples manually
    Open any file in Examples/ (e.g. 01-QuickStart.swift) and follow the inline instructions — each is a self-contained snippet showing a specific feature.

  4. Build check

    swift build

    Verify the package compiles cleanly on macOS (or Linux).

Made with Cursor

- Enhanced README with a new quick start guide, installation instructions, and detailed API key setup options.
- Added multiple example files demonstrating usage of models, agents, tools, indexing, error handling, and advanced agent features.
- Updated .gitignore to exclude new documentation files.
- Introduced a new `Aixplain` class as the main entry point for the SDK, replacing the previous `AiXplainKit` class.
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.

2 participants