Skip to content

Commit

Permalink
update how to get workai model
Browse files Browse the repository at this point in the history
Signed-off-by: oilbeater <[email protected]>
  • Loading branch information
oilbeater committed Oct 11, 2024
1 parent d2ee7db commit 8bb13a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions src/providers/workersAI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ export const workersAIProvider: AIProvider = {
getModelName: getModelName,
getTokenCount: getTokenCount,
handleRequest: async (c: Context<{ Bindings: Env }>) => {
const provider = c.req.param('provider');
const repo = c.req.param('repo');
const model = c.req.param('model');
const response = await c.env.AI.run(`${provider}/${repo}/${model}`,
const model = getModelName(c);
const response = await c.env.AI.run(`${model}`,
await c.req.json());

if (response instanceof ReadableStream) {
Expand Down

0 comments on commit 8bb13a4

Please sign in to comment.