Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@effect/ai@0.27.0
Minor Changes
#5469
42b914aThanks @IMax153! - Refactor the Effect AI SDK and associated provider packagesThis pull request contains a complete refactor of the base Effect AI SDK package
as well as the associated provider integration packages to improve flexibility
and enhance ergonomics. Major changes are outlined below.
Modules
All modules in the base Effect AI SDK have had the leading
Aiprefix droppedfrom their name (except for the
AiErrormodule).For example, the
AiLanguageModelmodule is now theLanguageModelmodule.In addition, the
AiInputmodule has been renamed to thePromptmodule.Prompts
The
Promptmodule has been completely redesigned with flexibility in mind.The
Promptmodule now supports building a prompt using either the constructorsexposed from the
Promptmodule, or using raw prompt content parts / messages,which should be familiar to those coming from other AI SDKs.
In addition, the
systemoption has been removed from allLanguageModelmethodsand must now be provided as part of the prompt.
Prompt Constructors
Raw Prompt Input
NOTE: Providing a plain string as a prompt is still supported, and will be converted
internally into a user message with a single text content part.
Provider-Specific Options
To support specification of provider-specific options when interacting with large
language model providers, support has been added for adding provider-specific
options to the parts of a
Prompt.Responses
The
Responsemodule has also been completely redesigned to support a widervariety of response parts, particularly when streaming.
Streaming Responses
When streaming text via the
LanguageModel.streamTextmethod, you will nowreceive a stream of content parts instead of a stream of responses, which should
make it much simpler to filter down the stream to the parts you are interested in.
In addition, additional content parts will be present in the stream to allow you to track,
for example, when a text content part starts / ends.
Tool Calls / Tool Call Results
The decoded parts of a
Response(as returned by the methods ofLanguageModel)are now fully type-safe on tool calls / tool call results. Filtering the content parts of a
response to tool calls will narrow the type of the tool call
paramsbased on the toolname. Similarly, filtering the response to tool call results will narrow the type of thetool call
resultbased on the toolname.Provider Metadata
As with provider-specific options, provider-specific metadata is now returned as
part of the response from the large language model provider.
Tool Calls
The
Toolmodule has been enhanced to support provider-defined tools (e.g.web search, computer use, etc.). Large language model providers which support
calling their own tools now have a separate module present in their provider
integration packages which contain definitions for their tools.
These provider-defined tools can be included alongside user-defined tools in
existing
Toolkits. Provider-defined tools that require a user-space handlerwill be raise a type error in the associated
Toolkitlayer if no such handleris defined.
AiError
The
AiErrortype has been refactored into a union of different error typeswhich can be raised by the Effect AI SDK. The goal of defining separate error
types is to allow providing the end-user with more granular information about
the error that occurred.
For now, the following errors have been defined. More error types may be added
over time based upon necessity / use case.
@effect/ai-amazon-bedrock@0.7.0
Minor Changes
#5469
42b914aThanks @IMax153! - Refactor the Effect AI SDK and associated provider packagesThis pull request contains a complete refactor of the base Effect AI SDK package
as well as the associated provider integration packages to improve flexibility
and enhance ergonomics. Major changes are outlined below.
Modules
All modules in the base Effect AI SDK have had the leading
Aiprefix droppedfrom their name (except for the
AiErrormodule).For example, the
AiLanguageModelmodule is now theLanguageModelmodule.In addition, the
AiInputmodule has been renamed to thePromptmodule.Prompts
The
Promptmodule has been completely redesigned with flexibility in mind.The
Promptmodule now supports building a prompt using either the constructorsexposed from the
Promptmodule, or using raw prompt content parts / messages,which should be familiar to those coming from other AI SDKs.
In addition, the
systemoption has been removed from allLanguageModelmethodsand must now be provided as part of the prompt.
Prompt Constructors
Raw Prompt Input
NOTE: Providing a plain string as a prompt is still supported, and will be converted
internally into a user message with a single text content part.
Provider-Specific Options
To support specification of provider-specific options when interacting with large
language model providers, support has been added for adding provider-specific
options to the parts of a
Prompt.Responses
The
Responsemodule has also been completely redesigned to support a widervariety of response parts, particularly when streaming.
Streaming Responses
When streaming text via the
LanguageModel.streamTextmethod, you will nowreceive a stream of content parts instead of a stream of responses, which should
make it much simpler to filter down the stream to the parts you are interested in.
In addition, additional content parts will be present in the stream to allow you to track,
for example, when a text content part starts / ends.
Tool Calls / Tool Call Results
The decoded parts of a
Response(as returned by the methods ofLanguageModel)are now fully type-safe on tool calls / tool call results. Filtering the content parts of a
response to tool calls will narrow the type of the tool call
paramsbased on the toolname. Similarly, filtering the response to tool call results will narrow the type of thetool call
resultbased on the toolname.Provider Metadata
As with provider-specific options, provider-specific metadata is now returned as
part of the response from the large language model provider.
Tool Calls
The
Toolmodule has been enhanced to support provider-defined tools (e.g.web search, computer use, etc.). Large language model providers which support
calling their own tools now have a separate module present in their provider
integration packages which contain definitions for their tools.
These provider-defined tools can be included alongside user-defined tools in
existing
Toolkits. Provider-defined tools that require a user-space handlerwill be raise a type error in the associated
Toolkitlayer if no such handleris defined.
AiError
The
AiErrortype has been refactored into a union of different error typeswhich can be raised by the Effect AI SDK. The goal of defining separate error
types is to allow providing the end-user with more granular information about
the error that occurred.
For now, the following errors have been defined. More error types may be added
over time based upon necessity / use case.
Patch Changes
42b914a]:@effect/ai-anthropic@0.17.0
Minor Changes
#5469
42b914aThanks @IMax153! - Refactor the Effect AI SDK and associated provider packagesThis pull request contains a complete refactor of the base Effect AI SDK package
as well as the associated provider integration packages to improve flexibility
and enhance ergonomics. Major changes are outlined below.
Modules
All modules in the base Effect AI SDK have had the leading
Aiprefix droppedfrom their name (except for the
AiErrormodule).For example, the
AiLanguageModelmodule is now theLanguageModelmodule.In addition, the
AiInputmodule has been renamed to thePromptmodule.Prompts
The
Promptmodule has been completely redesigned with flexibility in mind.The
Promptmodule now supports building a prompt using either the constructorsexposed from the
Promptmodule, or using raw prompt content parts / messages,which should be familiar to those coming from other AI SDKs.
In addition, the
systemoption has been removed from allLanguageModelmethodsand must now be provided as part of the prompt.
Prompt Constructors
Raw Prompt Input
NOTE: Providing a plain string as a prompt is still supported, and will be converted
internally into a user message with a single text content part.
Provider-Specific Options
To support specification of provider-specific options when interacting with large
language model providers, support has been added for adding provider-specific
options to the parts of a
Prompt.Responses
The
Responsemodule has also been completely redesigned to support a widervariety of response parts, particularly when streaming.
Streaming Responses
When streaming text via the
LanguageModel.streamTextmethod, you will nowreceive a stream of content parts instead of a stream of responses, which should
make it much simpler to filter down the stream to the parts you are interested in.
In addition, additional content parts will be present in the stream to allow you to track,
for example, when a text content part starts / ends.
Tool Calls / Tool Call Results
The decoded parts of a
Response(as returned by the methods ofLanguageModel)are now fully type-safe on tool calls / tool call results. Filtering the content parts of a
response to tool calls will narrow the type of the tool call
paramsbased on the toolname. Similarly, filtering the response to tool call results will narrow the type of thetool call
resultbased on the toolname.Provider Metadata
As with provider-specific options, provider-specific metadata is now returned as
part of the response from the large language model provider.
Tool Calls
The
Toolmodule has been enhanced to support provider-defined tools (e.g.web search, computer use, etc.). Large language model providers which support
calling their own tools now have a separate module present in their provider
integration packages which contain definitions for their tools.
These provider-defined tools can be included alongside user-defined tools in
existing
Toolkits. Provider-defined tools that require a user-space handlerwill be raise a type error in the associated
Toolkitlayer if no such handleris defined.
AiError
The
AiErrortype has been refactored into a union of different error typeswhich can be raised by the Effect AI SDK. The goal of defining separate error
types is to allow providing the end-user with more granular information about
the error that occurred.
For now, the following errors have been defined. More error types may be added
over time based upon necessity / use case.
Patch Changes
42b914a]:@effect/ai-google@0.6.0
Minor Changes
#5469
42b914aThanks @IMax153! - Refactor the Effect AI SDK and associated provider packagesThis pull request contains a complete refactor of the base Effect AI SDK package
as well as the associated provider integration packages to improve flexibility
and enhance ergonomics. Major changes are outlined below.
Modules
All modules in the base Effect AI SDK have had the leading
Aiprefix droppedfrom their name (except for the
AiErrormodule).For example, the
AiLanguageModelmodule is now theLanguageModelmodule.In addition, the
AiInputmodule has been renamed to thePromptmodule.Prompts
The
Promptmodule has been completely redesigned with flexibility in mind.The
Promptmodule now supports building a prompt using either the constructorsexposed from the
Promptmodule, or using raw prompt content parts / messages,which should be familiar to those coming from other AI SDKs.
In addition, the
systemoption has been removed from allLanguageModelmethodsand must now be provided as part of the prompt.
Prompt Constructors
Raw Prompt Input
NOTE: Providing a plain string as a prompt is still supported, and will be converted
internally into a user message with a single text content part.
Provider-Specific Options
To support specification of provider-specific options when interacting with large
language model providers, support has been added for adding provider-specific
options to the parts of a
Prompt.Responses
The
Responsemodule has also been completely redesigned to support a widervariety of response parts, particularly when streaming.
Streaming Responses
When streaming text via the
LanguageModel.streamTextmethod, you will nowreceive a stream of content parts instead of a stream of responses, which should
make it much simpler to filter down the stream to the parts you are interested in.
In addition, additional content parts will be present in the stream to allow you to track,
for example, when a text content part starts / ends.
Tool Calls / Tool Call Results
The decoded parts of a
Response(as returned by the methods ofLanguageModel)are now fully type-safe on tool calls / tool call results. Filtering the content parts of a
response to tool calls will narrow the type of the tool call
paramsbased on the toolname. Similarly, filtering the response to tool call results will narrow the type of thetool call
resultbased on the toolname.Provider Metadata
As with provider-specific options, provider-specific metadata is now returned as
part of the response from the large language model provider.
Tool Calls
The
Toolmodule has been enhanced to support provider-defined tools (e.g.web search, computer use, etc.). Large language model providers which support
calling their own tools now have a separate module present in their provider
integration packages which contain definitions for their tools.
These provider-defined tools can be included alongside user-defined tools in
existing
Toolkits. Provider-defined tools that require a user-space handlerwill be raise a type error in the associated
Toolkitlayer if no such handleris defined.
AiError
The
AiErrortype has been refactored into a union of different error typeswhich can be raised by the Effect AI SDK. The goal of defining separate error
types is to allow providing the end-user with more granular information about
the error that occurred.
For now, the following errors have been defined. More error types may be added
over time based upon necessity / use case.
Patch Changes
42b914a]:@effect/ai-openai@0.30.0
Minor Changes
#5469
42b914aThanks @IMax153! - Refactor the Effect AI SDK and associated provider packagesThis pull request contains a complete refactor of the base Effect AI SDK package
as well as the associated provider integration packages to improve flexibility
and enhance ergonomics. Major changes are outlined below.
Modules
All modules in the base Effect AI SDK have had the leading
Aiprefix droppedfrom their name (except for the
AiErrormodule).For example, the
AiLanguageModelmodule is now theLanguageModelmodule.In addition, the
AiInputmodule has been renamed to thePromptmodule.Prompts
The
Promptmodule has been completely redesigned with flexibility in mind.The
Promptmodule now supports building a prompt using either the constructorsexposed from the
Promptmodule, or using raw prompt content parts / messages,which should be familiar to those coming from other AI SDKs.
In addition, the
systemoption has been removed from allLanguageModelmethodsand must now be provided as part of the prompt.
Prompt Constructors
Raw Prompt Input
NOTE: Providing a plain string as a prompt is still supported, and will be converted
internally into a user message with a single text content part.
Provider-Specific Options
To support specification of provider-specific options when interacting with large
language model providers, support has been added for adding provider-specific
options to the parts of a
Prompt.Responses
The
Responsemodule has also been completely redesigned to support a widervariety of response parts, particularly when streaming.
Streaming Responses
When streaming text via the
LanguageModel.streamTextmethod, you will nowreceive a stream of content parts instead of a stream of responses, which should
make it much simpler to filter down the stream to the parts you are interested in.
In addition, additional content parts will be present in the stream to allow you to track,
for example, when a text content part starts / ends.
Tool Calls / Tool Call Results
The decoded parts of a
Response(as returned by the methods ofLanguageModel)are now fully type-safe on tool calls / tool call results. Filtering the content parts of a
response to tool calls will narrow the type of the tool call
paramsbased on the toolname. Similarly, filtering the response to tool call results will narrow the type of thetool call
resultbased on the toolname.Provider Metadata
As with provider-specific options, provider-specific metadata is now returned as
part of the response from the large language model provider.
Tool Calls
The
Toolmodule has been enhanced to support provider-defined tools (e.g.web search, computer use, etc.). Large language model providers which support
calling their own tools now have a separate module present in their provider
integration packages which contain definitions for their tools.
These provider-defined tools can be included alongside user-defined tools in
existing
Toolkits. Provider-defined tools that require a user-space handlerwill be raise a type error in the associated
Toolkitlayer if no such handleris defined.
AiError
The
AiErrortype has been refactored into a union of different error typeswhich can be raised by the Effect AI SDK. The goal of defining separate error
types is to allow providing the end-user with more granular information about
the error that occurred.
For now, the following errors have been defined. More error types may be added
over time based upon necessity / use case.
Patch Changes
42b914a]: