Skip to content

Initial MVP task breakdown #20

@felixarntz

Description

@felixarntz

This issue proposes a breakdown of all the work based on the proposed architecture (see #2) to get to an MVP of this SDK, also taking into consideration the development roadmap (see #8).

What is called MVP here is largely equivalent with what is "Phase 1" in #8.

Purpose

The primary purpose of this issue is to define the breakdown and later, once agreed upon, act as an overview issue to track the work until the MVP:

  • The breakdown below is largely sequenced.
  • Each checkbox should be considered an individual issue / pull request.
  • Some things may be worked on at the same time, and if someone wants to tackle multiple subsequent steps in one session (without having to wait for PR approval), it's always okay to create a branch based on another branch for an unreviewed PR.
  • Many tasks, especially in the "Foundation" section, are probably fine to start with a pull request directly. Some others are more complex and would likely benefit from some prior discussion in an issue. This can always be decided on a case-by-case basis.

Let's use the discussion in this issue to shape/refine this breakdown. As we discuss, iterations should be made directly on the issue description to keep things up to date in this source of truth.

Breakdown

Foundation

These almost entirely build on top of each other and therefore should mostly be sequenced.

  • Implement all enums for the implementer API
    • See AiClient.*.Enums namespaces in the class diagrams.
    • We won't be able to use PHP enums due to supporting PHP version support, but we can implement a very basic class foundation (e.g. AbstractEnum, with things like checking whether a given value is part of the enum) that effectively is our enum infrastructure.
  • Implement all data transfer objects for the implementer API, except omit any related to function calling
    • See AiClient.*.DTO namespaces in the class diagrams.
    • This also needs to include a few interfaces where appropriate, e.g. something to define the getJsonSchema() method commonly found.
    • Function calling will be implemented in a future milestone after the MVP.
  • Implement all enums for the extender API
    • See AiClient.Providers.*.Enums namespaces in the class diagrams.
    • For starters, we can use all the enum values currently defined. Not comprehensive, but a starting point to cover the basic options.
  • Implement all data transfer objects for the extender API
    • See AiClient.Providers.DTO and AiClient.Providers.*.DTO namespaces in the class diagrams.
  • Implement all interfaces (contracts) for the extender API, except the ones related to HttpClient and Authentication
    • See AiClient.Providers.Contracts and AiClient.Providers.*.Contracts namespaces in the class diagrams.
    • The HttpClientInterface and AuthenticationInterface omissions are due to additional considerations regarding ecosystem interoperability, which needs some extra consideration and therefore is better implemented separately.
  • Implement the extender API interfaces (contracts) related to HttpClient and Authentication
    • See AiClient.Providers.Contracts namespace in the class diagrams.

Main API entrypoints

These are mostly independent of each other and therefore can be worked on in parallel, except for the last point covering AiClient.

  • Implement infrastructure (provider and model classes) for Anthropic, covering text generation (without function calling)
  • Implement infrastructure (provider and model classes) for Google, covering text generation (without function calling) and image generation
  • Implement infrastructure (provider and model classes) for OpenAI, covering text generation (without function calling) and image generation
  • Implement AiProviderRegistry
    • See AiClient.Providers namespace in the class diagrams.
  • Implement PromptBuilder, except for any methods related to operations, streaming, text to speech conversion, speech generation, or embedding generation, and leave the terminate methods unimplemented
    • See AiClient.Builders namespace in the class diagram.
    • The omissions are crucial, as these aspects will be added later than the MVP. While it's reasonable to already cover them in the foundation, as the API design is clear and that part is purely about contracts and DTOs, the actual implementation is substantial and therefore makes sense to be deferred (also see Development roadmap #8).
    • The terminate methods depend on AiProviderRegistry being done first. They also are extra complex, and therefore should be handled separately.
  • Implement MessageBuilder
    • See AiClient.Builders namespace in the class diagram.
  • Implement AiClient, except for any methods related to operations, streaming, text to speech conversion, speech generation, or embedding generation
    • See AiClient namespace in the class diagram.
    • All methods not related to provider handling or to the fluent API are part of the traditional API and should wrap the respective fluent API logic. In other words, these can be implemented by calling the fluent API, even if the actual logic in the fluent API terminate methods is still missing.

Tying it all together

These are mostly sequential.

  • Properly register the 3 initial providers on the default AiProviderRegistry instance
  • Implement the AI utility classes, first and foremost RequirementsUtil, which is by far the most complex
    • See AiClient.Util namespace in the class diagram.
  • Implement the terminate methods on PromptBuilder

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] OverviewComprehensive, high level view of an area of focus often with multiple tracking issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions