You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
See AiClient.*.Enums and AiClient.Providers.*.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.
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 Adds Provider interfaces #35)
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.
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 a generic OpenAI API compatible provider, covering text generation (without function calling) and image generation, and include basic setup plumbing for Anthropic, Google, and OpenAI providers using this generic implementation (see Provider base and implementation for Anthropic, Google, and OpenAI via common abstractions #39)
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 Add the Prompt Builder #49)
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 AiClient, except for any methods related to operations, streaming, text to speech conversion, speech generation, or embedding generation (see Add the AiClient with testing suite #55)
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
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:
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.
AiClient.*.EnumsandAiClient.Providers.*.Enumsnamespaces in the class diagrams.AbstractEnum, with things like checking whether a given value is part of the enum) that effectively is our enum infrastructure.AiClient.*.DTOnamespaces in the class diagrams.getJsonSchema()method commonly found.AiClient.Providers.DTOandAiClient.Providers.*.DTOnamespaces in the class diagrams.HttpClientandAuthentication(see Adds Provider interfaces #35)AiClient.Providers.ContractsandAiClient.Providers.*.Contractsnamespaces in the class diagrams.HttpClientInterfaceandAuthenticationInterfaceomissions are due to additional considerations regarding ecosystem interoperability, which needs some extra consideration and therefore is better implemented separately.HttpClientandAuthentication(see Adds support for Provider HTTP Handling #47)AiClient.Providers.Contractsnamespace 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.AiProviderRegistry(see Implement ProviderRegistry with comprehensive test suite #38)AiClient.Providersnamespace in the class diagrams.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 Add the Prompt Builder #49)AiClient.Buildersnamespace in the class diagram.AiProviderRegistrybeing done first. They also are extra complex, and therefore should be handled separately.AiClient, except for any methods related to operations, streaming, text to speech conversion, speech generation, or embedding generation (see Add the AiClient with testing suite #55)AiClientnamespace in the class diagram.Tying it all together
These are mostly sequential.
AiProviderRegistryinstancePromptBuilder