@ai-sdk/provider-utils
Advanced tools
Comparing version 2.0.7 to 2.0.8
# @ai-sdk/provider-utils | ||
## 2.0.8 | ||
### Patch Changes | ||
- 00114c5: feat: expose IDGenerator and createIdGenerator | ||
## 2.0.7 | ||
@@ -4,0 +10,0 @@ |
@@ -29,8 +29,10 @@ import { JSONValue, JSONParseError, TypeValidationError, APICallError } from '@ai-sdk/provider'; | ||
/** | ||
* Creates an ID generator. The total length of the ID is the sum of the prefix, separator, and random part length. | ||
* | ||
* @param alphabet - The alphabet to use for the ID. Default: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'. | ||
* @param prefix - The prefix of the ID to generate. Default: ''. | ||
* @param separator - The separator between the prefix and the random part of the ID. Default: '-'. | ||
* @param size - The size of the random part of the ID to generate. Default: 16. | ||
Creates an ID generator. | ||
The total length of the ID is the sum of the prefix, separator, and random part length. | ||
Non-secure. | ||
@param alphabet - The alphabet to use for the ID. Default: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'. | ||
@param prefix - The prefix of the ID to generate. Default: ''. | ||
@param separator - The separator between the prefix and the random part of the ID. Default: '-'. | ||
@param size - The size of the random part of the ID to generate. Default: 16. | ||
*/ | ||
@@ -44,6 +46,10 @@ declare const createIdGenerator: ({ prefix, size: defaultSize, alphabet, separator, }?: { | ||
/** | ||
* Generates a 16-character random string to use for IDs. Not secure. | ||
* | ||
* @param size - The size of the ID to generate. Default: 16. | ||
A function that generates an ID. | ||
*/ | ||
type IDGenerator = () => string; | ||
/** | ||
Generates a 16-character random string to use for IDs. Not secure. | ||
@param size - The size of the ID to generate. Default: 16. | ||
*/ | ||
declare const generateId: (size?: number) => string; | ||
@@ -307,2 +313,2 @@ | ||
export { type FetchFunction, type ParseResult, type Resolvable, type ResponseHandler, type ToolCall, type ToolResult, type ValidationResult, type Validator, asValidator, combineHeaders, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertUint8ArrayToBase64, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonResponseHandler, createJsonStreamResponseHandler, extractResponseHeaders, generateId, getErrorMessage, isAbortError, isParsableJson, isValidator, loadApiKey, loadOptionalSetting, loadSetting, parseJSON, postJsonToApi, postToApi, resolve, safeParseJSON, safeValidateTypes, validateTypes, validator, validatorSymbol, withoutTrailingSlash, zodValidator }; | ||
export { type FetchFunction, type IDGenerator, type ParseResult, type Resolvable, type ResponseHandler, type ToolCall, type ToolResult, type ValidationResult, type Validator, asValidator, combineHeaders, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertUint8ArrayToBase64, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonResponseHandler, createJsonStreamResponseHandler, extractResponseHeaders, generateId, getErrorMessage, isAbortError, isParsableJson, isValidator, loadApiKey, loadOptionalSetting, loadSetting, parseJSON, postJsonToApi, postToApi, resolve, safeParseJSON, safeValidateTypes, validateTypes, validator, validatorSymbol, withoutTrailingSlash, zodValidator }; |
{ | ||
"name": "@ai-sdk/provider-utils", | ||
"version": "2.0.7", | ||
"version": "2.0.8", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4304216
51693