Understand the design goals and internal building blocks of ai_sdk.
ai_sdk
aims to minimise boilerplate when working with modern LLMs while staying provider-agnostic and fully typed.
generate_text
, embed_many
, …) do 90 % of common work.LanguageModel
, EmbeddingModel
) keep providers pluggable.Factory helper returns a provider wrapper
Helper builds a provider-agnostic request
prompt/system/messages/tools
into the provider’s native schema.Provider SDK call & response normalisation
text
, finish_reason
, usage
, raw_response
, …Result objects give you typed access
embed_many
).LanguageModel
or EmbeddingModel
.mycloud(model="x")
).generate_object