Skip to content

Commit 9206a9f

Browse files
committed
Mention the two alternative implementer API surfaces in the introduction.
1 parent af606a1 commit 9206a9f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/ARCHITECTURE.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ This document outlines the architecture for the PHP AI Client. It is critical th
44

55
## High-level API design
66

7-
The API design at a high level is heavily inspired by the [Vercel AI SDK](https://github.com/vercel/ai), which is widely used in the NodeJS ecosystem and one of the very few comprehensive AI client SDKs available.
7+
The architecture at a high level is heavily inspired by the [Vercel AI SDK](https://github.com/vercel/ai), which is widely used in the NodeJS ecosystem and one of the very few comprehensive AI client SDKs available.
88

99
The main additional aspect that the Vercel AI SDK does not cater for easily is for a developer to use AI in a way that the choice of provider remains with the user. To clarify with an example: Instead of "Generate text with Google's model `gemini-2.5-flash`", go with "Generate text using any provider model that supports text generation and multimodal input". In other words, there needs to be a mechanism that allows finding any configured model that supports the given set of required AI capabilities and options.
1010

11+
For the implementer facing API surface, two alternative APIs are available:
12+
13+
* A fluent API is used as the primary means of using the AI client SDK, for easy-to-read code by chaining declarative methods.
14+
* A traditional method based API inspired by the Vercel AI SDK, which is more aligned with traditional WordPress patterns such as passing an array of arguments.
15+
1116
### Code examples
1217

1318
The following examples indicate how this SDK could eventually be used.

0 commit comments

Comments
 (0)