workers-ai-provider
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -32,4 +32,4 @@ import { LanguageModelV1 } from '@ai-sdk/provider'; | ||
/** | ||
Creates a model for text generation. | ||
*/ | ||
* Creates a model for text generation. | ||
**/ | ||
chat(modelId: BaseAiTextGenerationModels, settings?: WorkersAIChatSettings): WorkersAIChatLanguageModel; | ||
@@ -39,5 +39,5 @@ } | ||
/** | ||
Provide an `env.AI` binding to use for the AI inference. | ||
You can set up an AI bindings in your Workers project | ||
by adding the following this to `wrangler.toml`: | ||
* Provide an `env.AI` binding to use for the AI inference. | ||
* You can set up an AI bindings in your Workers project | ||
* by adding the following this to `wrangler.toml`: | ||
@@ -47,10 +47,11 @@ ```toml | ||
binding = "AI" | ||
``` */ | ||
``` | ||
**/ | ||
binding: Ai; | ||
} | ||
/** | ||
Create a Workers AI provider instance. | ||
*/ | ||
declare function createWorkersAIProvider(options: WorkersAISettings): WorkersAI; | ||
* Create a Workers AI provider instance. | ||
**/ | ||
declare function createWorkersAI(options: WorkersAISettings): WorkersAI; | ||
export { type WorkersAI, type WorkersAISettings, createWorkersAIProvider }; | ||
export { type WorkersAI, type WorkersAISettings, createWorkersAI }; |
@@ -225,3 +225,3 @@ var __create = Object.create; | ||
// node_modules/@ai-sdk/provider-utils/node_modules/nanoid/non-secure/index.js | ||
// node_modules/nanoid/non-secure/index.js | ||
var customAlphabet = (alphabet, defaultSize = 21) => { | ||
@@ -485,3 +485,5 @@ return (size = defaultSize) => { | ||
const { args, warnings } = this.getArgs(options); | ||
console.warn(warnings); | ||
if (warnings && warnings.length > 0) { | ||
console.warn(warnings); | ||
} | ||
const response = await this.config.binding.run(args.model, { | ||
@@ -597,3 +599,3 @@ messages: args.messages | ||
// src/index.ts | ||
function createWorkersAIProvider(options) { | ||
function createWorkersAI(options) { | ||
const createChatModel = (modelId, settings = {}) => new WorkersAIChatLanguageModel(modelId, settings, { | ||
@@ -615,4 +617,4 @@ provider: "workerai.chat", | ||
export { | ||
createWorkersAIProvider | ||
createWorkersAI | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "dist/index.js", | ||
@@ -8,0 +8,0 @@ "types": "dist/index.d.ts", |
@@ -144,3 +144,5 @@ import { | ||
console.warn(warnings); | ||
if (warnings && warnings.length > 0) { | ||
console.warn(warnings); | ||
} | ||
@@ -147,0 +149,0 @@ const response = (await this.config.binding.run(args.model, { |
Sorry, the diff of this file is not supported yet
89703
1119