Tutorial not working due to deprecated OpenAI moderation model

Open
#151 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
45/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
documentation

Research direction

Open the run-pipe tutorial at https://baseai.dev/learn/run-pipe and locate the moderation example using text-moderation-007. Update the tutorial to use omni-moderation-latest, then run the documented npx tsx index.ts example and confirm it no longer requests the deprecated model.

Written by the indexing model from the issue text.

Description

Description

Follow the tutorial, specifically the page https://baseai.dev/learn/run-pipe

Code example

It tries to moderate using text-moderation-007 but the current moderation model is omni-moderation-latest.

Additional context

Error message

npx tsx index.ts
(node:34160) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
/Users/fabiovedovelli/Code/my-ai-project/node_modules/@baseai/core/src/common/errors.ts:75
				return new BadRequestError(status, error, message, headers);
				       ^


BadRequestError: 400 Error from OpenAI: 403 Project `proj_yIE96rr2PYpDK55CfxPorTFx` does not have access to model `text-moderation-007`
    at Function.generate (/Users/fabiovedovelli/Code/my-ai-project/node_modules/@baseai/core/src/common/errors.ts:75:12)
    at Request.handleErrorResponse (/Users/fabiovedovelli/Code/my-ai-project/node_modules/@baseai/core/src/common/request.ts:126:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Request.send (/Users/fabiovedovelli/Code/my-ai-project/node_modules/@baseai/core/src/common/request.ts:62:4)
    at async Pipe.run (/Users/fabiovedovelli/Code/my-ai-project/node_modules/@baseai/core/src/pipes/pipes.ts:309:18)
    at async main (/Users/fabiovedovelli/Code/my-ai-project/index.ts:17:22) {
  status: 400,
  headers: {
    'access-control-allow-origin': '*',
    connection: 'keep-alive',
    'content-length': '256',
    'content-type': 'application/json',
    date: 'Wed, 12 Feb 2025 11:24:28 GMT',
    env: 'local',
    'keep-alive': 'timeout=5',
    'lb-powered-by': 'Langbase',
    'powered-by': 'BaseAI'
  },
  request_id: undefined,
  error: {
    code: 'BAD_REQUEST',
    status: 400,
    message: 'Error from OpenAI: 403 Project `proj_yIE96rr2PYpDK55CfxPorTFx` does not have access to model `text-moderation-007`',
    docs: 'https://langbase.com/docs/api-reference/errors/bad_request'
  },
  code: 'BAD_REQUEST'
}

Node.js v23.6.1
Dominant language
TypeScript
Stars
1.3k
Forks
112
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CommandCodeAI/BaseAI

All issues in CommandCodeAI/BaseAI

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.