-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ai/core: export language model types (#1463)
- Loading branch information
Showing
12 changed files
with
119 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@ai-sdk/provider': patch | ||
'ai': patch | ||
--- | ||
|
||
ai/core: re-expose language model types. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export { | ||
APICallError, | ||
EmptyResponseBodyError, | ||
InvalidArgumentError, | ||
InvalidDataContentError, | ||
InvalidPromptError, | ||
InvalidResponseDataError, | ||
InvalidToolArgumentsError, | ||
JSONParseError, | ||
LoadAPIKeyError, | ||
NoObjectGeneratedError, | ||
NoSuchToolError, | ||
RetryError, | ||
ToolCallParseError, | ||
TypeValidationError, | ||
UnsupportedFunctionalityError, | ||
UnsupportedJSONSchemaError, | ||
} from '@ai-sdk/provider'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './errors'; | ||
export * from './language-model'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { | ||
LanguageModelV1, | ||
LanguageModelV1CallWarning, | ||
LanguageModelV1FinishReason, | ||
LanguageModelV1LogProbs, | ||
} from '@ai-sdk/provider'; | ||
|
||
/** | ||
Language model that is used by the AI SDK Core functions. | ||
*/ | ||
export type LanguageModel = LanguageModelV1; | ||
|
||
/** | ||
Reason why a language model finished generating a response. | ||
Can be one of the following: | ||
- `stop`: model generated stop sequence | ||
- `length`: model generated maximum number of tokens | ||
- `content-filter`: content filter violation stopped the model | ||
- `tool-calls`: model triggered tool calls | ||
- `error`: model stopped because of an error | ||
- `other`: model stopped for other reasons | ||
*/ | ||
export type FinishReason = LanguageModelV1FinishReason; | ||
|
||
/** | ||
Log probabilities for each token and its top log probabilities. | ||
*/ | ||
export type LogProbs = LanguageModelV1LogProbs; | ||
|
||
/** | ||
Warning from the model provider for this call. The call will proceed, but e.g. | ||
some settings might not be supported, which can lead to suboptimal results. | ||
*/ | ||
export type CallWarning = LanguageModelV1CallWarning; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.