Tutorial not working due to deprecated OpenAI moderation model

未关闭
#151 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
45/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
停滞
技术栈
typescript
领域
documentation

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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
主要语言
TypeScript
星标
1.3k
派生
112
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CommandCodeAI/BaseAI 的其他 Issue

查看 CommandCodeAI/BaseAI 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。